diff --git a/public/js/nav.js b/public/js/nav.js new file mode 100644 index 0000000..61df352 --- /dev/null +++ b/public/js/nav.js @@ -0,0 +1,13 @@ +function applyHeaderShadow() { + const header = document.querySelector(".web-header-emit-shadow-when-top"); + if (!header) return; + + window.addEventListener("scroll", () => { + if (window.scrollY > 0) { + header.classList.add("shadow-active"); + } else { + header.classList.remove("shadow-active"); + } + }); +} +document.addEventListener("DOMContentLoaded", applyHeaderShadow); \ No newline at end of file