language switch functionality added
This commit is contained in:
@@ -145,36 +145,5 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Scroll behavior - only enable on index page
|
||||
if (window.location.pathname === '/' || window.location.pathname === '/index.html') {
|
||||
let lastScrollTop = 0;
|
||||
let scrollTimeout;
|
||||
|
||||
window.addEventListener('scroll', () => {
|
||||
if (scrollTimeout) {
|
||||
window.cancelAnimationFrame(scrollTimeout);
|
||||
}
|
||||
|
||||
scrollTimeout = window.requestAnimationFrame(() => {
|
||||
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
|
||||
// Don't hide header when near top of page
|
||||
if (scrollTop < 100) {
|
||||
header.style.transform = 'translateY(0)';
|
||||
return;
|
||||
}
|
||||
|
||||
// Hide header on scroll down, show on scroll up
|
||||
if (scrollTop > lastScrollTop) {
|
||||
header.style.transform = 'translateY(-100%)';
|
||||
} else {
|
||||
header.style.transform = 'translateY(0)';
|
||||
}
|
||||
|
||||
lastScrollTop = scrollTop;
|
||||
});
|
||||
}, { passive: true });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user