const fades = document.querySelectorAll('.fade');
const observer = new IntersectionObserver(entries=>{
entries.forEach(entry=>{
if(entry.isIntersecting) entry.target.classList.add('show');
});
},{threshold:0.2});
fades.forEach(el=>observer.observe(el));
window.addEventListener('scroll',()=>{
document.querySelector('.header')
.classList.toggle('scrolled', window.scrollY > 50);
});