Skip to content

Commit

Permalink
#
Browse files Browse the repository at this point in the history
  • Loading branch information
borishrncic committed Jul 2, 2024
1 parent b4a7442 commit 39c41c5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
32 changes: 32 additions & 0 deletions app/scripts.js
Original file line number Diff line number Diff line change
@@ -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`;
}
}
});
}
});
5 changes: 2 additions & 3 deletions app/styles-new.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ header {
}
}

/*
@media screen and (min-width: 1441px) {
.home-cover {
width: 100%;
Expand All @@ -72,10 +73,8 @@ header {
margin-left: auto;
margin-right: auto;
}
.sub-brands h2 {
text-align: center;
}
}
*/

.sub-brands {
margin-top: 80px;
Expand Down
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ function showNextSpan() {
and creative industries.</p>
</section>
<section class="container sub-brands">
<h2 class="heading-1">Family of Brands</h2>
<h2 class="heading-1 align-center">Family of Brands</h2>
<hr>
<?php include './includes/family-of-brands.php'; ?>
<hr>
</section>
</main>

<script src="https://polykit.xyz/app/js/polykit-v0-3.js"></script>
<script src="app/scripts.js"></script>

</body>

Expand Down

0 comments on commit 39c41c5

Please sign in to comment.