function revealOnScroll() { const reveals = document.querySelectorAll('.reveal'); const windowHeight = window.innerHeight; reveals.forEach((el) => { const elementTop = el.getBoundingClientRect().top; const visiblePoint = 100; if (elementTop < windowHeight - visiblePoint) { el.classList.add('active'); } }); } window.addEventListener('scroll', revealOnScroll); window.addEventListener('load', revealOnScroll);