function clearHeaderNavy() {
document.documentElement.classList.remove("wtm-header-up");
document.body.classList.remove("wtm-header-up");
getHeaderElements().forEach(function (el) {
el.style.removeProperty("background");
el.style.removeProperty("background-color");
el.style.removeProperty("opacity");
el.style.removeProperty("visibility");
el.style.removeProperty("box-shadow");
el.style.removeProperty("border-bottom");
});
}
function handleScroll() {
var currentY = window.pageYOffset || document.documentElement.scrollTop || 0;
if (currentY <= threshold) {
clearHeaderNavy();
} else if (currentY < lastY) {
makeHeaderNavy();
} else if (currentY > lastY) {
clearHeaderNavy();
}
lastY = currentY <= 0 ? 0 : currentY;
}
window.addEventListener("scroll", handleScroll, { passive: true });
window.addEventListener("resize", handleScroll);
document.addEventListener("DOMContentLoaded", handleScroll);
})();