{
const currentScrollY = window.scrollY;
if (Math.abs(currentScrollY - lastScrollY) > navThreshold / 4) { // Add some tolerance
if (currentScrollY > lastScrollY && currentScrollY > navThreshold && !isProfileDropdownOpen && !isMobileMenuOpen) {
showNav = false; // Scrolling down
} else {
showNav = true; // Scrolling up or near top
}
lastScrollY = currentScrollY;
}
}" @hide-navbar.window="showNav = false" -navbar.window="showNav = true" x-show="showNav"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 transform -translate-y-full"
x-transition:enter-end="opacity-100 transform translate-y-0" x-transition:leave="transition ease-in duration-300"
x-transition:leave-start="opacity-100 transform translate-y-0"
x-transition:leave-end="opacity-0 transform -translate-y-full">
Global Lens
Yasith Wijesinghe
Understanding how local events ripple across our interconnected world - where a factory closure in one country affects global supply chains, political unrest influences international markets, environmental changes cross all borders, and social movements inspire action...