index-main/assets/js/header.js
Julie Blanc f28680f77e
All checks were successful
Deploy / Deploy to Production (push) Successful in 11s
panel/btn mobile & scripts
2026-01-25 19:40:55 +01:00

29 lines
697 B
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export function headerToggle() {
const header = document.getElementById("site-header");
const buttonToggle = document.querySelector("#menu-toggle");
if (!header || !buttonToggle) return;
buttonToggle.addEventListener("click", () => {
const isOpen = document.body.classList.toggle("menu-open");
});
}
// DELETE?
export function headerScrollVisibility() {
const header = document.getElementById("site-header");
if (!header) return;
function checkScroll() {
if (window.scrollY >= 300) {
header.classList.add("is-visible");
} else {
header.classList.remove("is-visible");
}
}
window.addEventListener("scroll", checkScroll);
checkScroll();
}