Site (not home)>menu>add small when scroll
All checks were successful
Deploy / Deploy to Production (push) Successful in 5s
All checks were successful
Deploy / Deploy to Production (push) Successful in 5s
This commit is contained in:
parent
3effa55017
commit
41a193d37b
2 changed files with 19 additions and 0 deletions
|
|
@ -12,6 +12,16 @@
|
|||
font-family: var(--menu-font);
|
||||
font-weight: 600;
|
||||
|
||||
&.small {
|
||||
.characters svg {
|
||||
height: 0;
|
||||
}
|
||||
.characters {
|
||||
margin: 0;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
nav ul {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
|
|
|||
|
|
@ -79,3 +79,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
initEventFilters();
|
||||
const gallery = new CreditsSlideshow(".gallery");
|
||||
});
|
||||
|
||||
window.addEventListener("scroll", (event) => {
|
||||
const mainHeader = document.querySelector(".main-header");
|
||||
if (window.scrollY > 130 && !mainHeader.classList.contains("small")) {
|
||||
mainHeader.classList.add("small");
|
||||
} else if (window.scrollY < 90) {
|
||||
mainHeader.classList.remove("small");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue