iamdjbones/ethervox-vocal-processor
0
1document.addEventListener('DOMContentLoaded', () => {2 // Smooth scrolling for anchor links3 document.querySelectorAll('a[href^="#"]').forEach(anchor => {4 anchor.addEventListener('click', function (e) {5 e.preventDefault();6 document.querySelector(this.getAttribute('href')).scrollIntoView({7 behavior: 'smooth'8 });9 });10 });11 12 // Animation on scroll13 const animateOnScroll = () => {14 const elements = document.querySelectorAll('.animate-on-scroll');15 elements.forEach(element => {16 const elementPosition = element.getBoundingClientRect().top;17 const screenPosition = window.innerHeight / 1.3;18 19 if (elementPosition < screenPosition) {20 element.classList.add('animate-fadeIn');21 }22 });23 };24 25 window.addEventListener('scroll', animateOnScroll);26 animateOnScroll(); // Run once on load27});