2026-01-06 13:57:45 +01:00
|
|
|
|
export function headerToggle() {
|
|
|
|
|
|
const header = document.getElementById("site-header");
|
|
|
|
|
|
const buttonToggle = document.querySelector("#menu-toggle");
|
|
|
|
|
|
|
|
|
|
|
|
if (!header || !buttonToggle) return;
|
|
|
|
|
|
buttonToggle.addEventListener("click", () => {
|
2026-01-25 19:40:55 +01:00
|
|
|
|
const isOpen = document.body.classList.toggle("menu-open");
|
2026-01-06 13:57:45 +01:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-23 17:38:08 +01:00
|
|
|
|
|
|
|
|
|
|
// DELETE ?
|
2026-01-06 13:57:45 +01:00
|
|
|
|
export function headerScrollVisibility() {
|
|
|
|
|
|
const header = document.getElementById("site-header");
|
|
|
|
|
|
|
2026-01-09 14:57:48 +01:00
|
|
|
|
if (!header) return;
|
2026-01-06 13:57:45 +01:00
|
|
|
|
|
|
|
|
|
|
function checkScroll() {
|
2026-01-22 14:46:05 +01:00
|
|
|
|
if (window.scrollY >= 300) {
|
|
|
|
|
|
header.classList.add("is-visible");
|
2026-01-06 13:57:45 +01:00
|
|
|
|
} else {
|
2026-01-22 14:46:05 +01:00
|
|
|
|
header.classList.remove("is-visible");
|
2026-01-06 13:57:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener("scroll", checkScroll);
|
2026-01-22 14:46:05 +01:00
|
|
|
|
checkScroll();
|
2026-01-06 13:57:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|