diff --git a/app/scripts.js b/app/scripts.js new file mode 100644 index 0000000..91c1420 --- /dev/null +++ b/app/scripts.js @@ -0,0 +1,32 @@ +const header = document.querySelector('header'); + + + +document.addEventListener("DOMContentLoaded", function () { + let header = document.querySelector('header'); + if (header) { + let body = document.querySelector("body"); + + window.addEventListener("scroll", function () { + let scroll = window.scrollY; + + if (window.innerWidth > 768) { + if (scroll >= 60) { + header.classList.add("header-position-fixed"); + } else { + header.classList.remove("header-position-fixed"); + } + } + + if (scroll >= 60) { + header.style.top = '0px'; + } else { + if (body.classList.contains("landing-page")) { + header.style.top = '0px'; + } else { + header.style.top = `${hellobarHeight + 0}px`; + } + } + }); + } +}); \ No newline at end of file diff --git a/app/styles-new.css b/app/styles-new.css index 6a4c5ca..6eedfd3 100644 --- a/app/styles-new.css +++ b/app/styles-new.css @@ -62,6 +62,7 @@ header { } } +/* @media screen and (min-width: 1441px) { .home-cover { width: 100%; @@ -72,10 +73,8 @@ header { margin-left: auto; margin-right: auto; } - .sub-brands h2 { - text-align: center; - } } + */ .sub-brands { margin-top: 80px; diff --git a/index.php b/index.php index 10dc5b4..f3573dd 100644 --- a/index.php +++ b/index.php @@ -84,7 +84,7 @@ function showNextSpan() { and creative industries.

-

Family of Brands

+

Family of Brands



@@ -92,6 +92,7 @@ function showNextSpan() { +