We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85ba03b commit f937966Copy full SHA for f937966
src/components/Header.astro
@@ -51,18 +51,18 @@ import links from "@data/links.json";
51
document.addEventListener("DOMContentLoaded", function() {
52
var navbar = document.getElementById("navbar") as HTMLElement;
53
if (!navbar) return;
54
-
+
55
var prevScrollPos = window.pageYOffset || document.documentElement.scrollTop;
56
57
window.addEventListener("scroll", function() {
58
var currentScrollPos = window.pageYOffset || document.documentElement.scrollTop;
59
60
if (prevScrollPos > currentScrollPos) {
61
navbar.style.transform = "translateY(0)";
62
} else {
63
navbar.style.transform = "translateY(-100%)";
64
}
65
66
prevScrollPos = currentScrollPos;
67
});
68
0 commit comments