Site (not home)>menu>add small when scroll
All checks were successful
Deploy / Deploy to Production (push) Successful in 5s

This commit is contained in:
Camilledenoray 2026-06-21 16:29:32 +02:00
parent 3effa55017
commit 41a193d37b
2 changed files with 19 additions and 0 deletions

View file

@ -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;

View file

@ -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");
}
});