fix: edge case

This commit is contained in:
Tim Rijkse
2026-01-15 10:56:09 +01:00
parent f5d2b242c0
commit 0344f06d71

View File

@@ -34,7 +34,12 @@ class SiteHeader extends HTMLElement {
this.collapsibleHeight = this.collapsible.scrollHeight;
}
if (isScrollingDown) {
// Always show header when at top of page
if (currentScrollPos === 0) {
this.upwardScroll = 0;
this.headerOffset = 0;
this.classList.add("reveal");
} else if (isScrollingDown) {
this.upwardScroll = 0;
this.headerOffset = Math.min(
this.collapsibleHeight,