im lazy writing commit messagesm please take a look by yourself thx

This commit is contained in:
2025-10-05 14:08:03 +07:00
parent a454f82cc5
commit c0ba4e534f
10 changed files with 138 additions and 83 deletions
+24 -1
View File
@@ -10,4 +10,27 @@ function applyHeaderShadow() {
}
});
}
document.addEventListener("DOMContentLoaded", applyHeaderShadow);
document.addEventListener("DOMContentLoaded", applyHeaderShadow);
function applyHeaderAutoHide() {
const header = document.querySelector(".web-header-autohide");
if (!header) return;
let lastScrollY = window.scrollY;
window.addEventListener("scroll", () => {
const currentScrollY = window.scrollY;
if (currentScrollY > lastScrollY && currentScrollY > 0) {
// Scrolling down -> hide header
header.classList.add("web-header-hidden");
} else {
// Scrolling up -> show header
header.classList.remove("web-header-hidden");
}
lastScrollY = currentScrollY;
});
}
document.addEventListener("DOMContentLoaded", applyHeaderAutoHide);