window.addEventListener('scroll', function() { const navbar = document.getElementById('navbar'); const buttons = document.querySelectorAll('#navButton'); // Select all nav buttons if (window.scrollY > 0) { navbar.classList.add('scrolled'); buttons.forEach(button => { button.classList.remove('light'); button.classList.add('dark'); }); } else { navbar.classList.remove('scrolled'); buttons.forEach(button => { button.classList.remove('dark'); button.classList.add('light'); }); } });