I'm trying to make the navbar switch colors when it goes down a specific y level using classList. For example if you have scrolled down 50 on the y axis it should add a class which has css making it a different color.
This is my js
`
const navbar = document.querySelector('nav');
window.onscroll = () => {
if (window.scrollY > 70) {
navbar.classList.add('sch');
} else {
navbar.classList.remove('sch');
}
};
`