feat: implement sticky header with height compression and glassmorphism
All checks were successful
Deploy Theme / deploy (push) Successful in 13s

This commit is contained in:
2026-02-20 12:45:32 +01:00
parent 78dc8cbd08
commit d33dcd7fb9
2 changed files with 11 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
mobileMenuOpen: false,
currentPath: window.location.pathname,
showScrollTop: false,
isSticky: false,
init() {
$watch('theme', val => {
localStorage.setItem('theme', val);
@@ -13,9 +14,10 @@
document.documentElement.setAttribute('data-theme', this.theme);
document.documentElement.classList.remove('hidden');
// Handle scroll for scroll-to-top button
// Handle scroll for sticky header and scroll-to-top button
window.addEventListener('scroll', () => {
this.showScrollTop = window.scrollY > 400;
this.isSticky = window.scrollY > 50;
});
// Update currentPath on navigation to keep menu highlights in sync