Skip to content

Commit

Permalink
Fix regression from #29 with hero image height on mobile (#30)
Browse files Browse the repository at this point in the history
* Fix regression with hero image
* Move function to comply with the screen resolution
  • Loading branch information
conradolandia committed Mar 5, 2024
1 parent 54b83f8 commit ea5f04d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions assets/static/js/main-singlelayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ https://github.com/spyder-ide/lektor-icon/blob/master/NOTICE.txt

const heroHeight = function () {
const headerHeight = $(".js-sticky").outerHeight();
if ($(window).outerWidth() > 768) {
if ($(window).outerWidth() >= 768) {
$(".js-fullheight-home").css(
"height",
`calc(100dvh - ${headerHeight}px)`
);
$(".hero-section").css("margin-top", `${headerHeight}px`);
} else {
$(".js-fullheight-home").css("height", `50dvh - ${headerHeight}px)`);
$(".js-fullheight-home").css("height", "50dvh");
$(".hero-section").css("margin-top", "0px");
}
$(".hero-section").css("margin-top", `${headerHeight}px`);
};

const setHeroHeight = function () {
Expand Down

0 comments on commit ea5f04d

Please sign in to comment.