Devardas/mukha-ormanli-clone
0
1document.addEventListener('DOMContentLoaded', function() {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 // Add animation classes to sections13 const sections = document.querySelectorAll('section');14 const observer = new IntersectionObserver((entries) => {15 entries.forEach(entry => {16 if (entry.isIntersecting) {17 entry.target.classList.add('fade-in');18 }19 });20 }, { threshold: 0.1 });21 22 sections.forEach(section => {23 observer.observe(section);24 });25});