feat: implement sticky header with height compression and glassmorphism
All checks were successful
Deploy Theme / deploy (push) Successful in 13s
All checks were successful
Deploy Theme / deploy (push) Successful in 13s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user