1const scrollElements = document.querySelectorAll(".scrollElement"); 2 3 4const options = { 5 root: null, 6 rootMargin: '0px', 7 threshold: 0.1 8} 9 10const observer = new IntersectionObserver((entries) => { 11 12 entries.forEach(entry => { 13 if(entry.isIntersecting) { 14 entry.target.classList.add("slideUp"); 15 } 16 }) 17}, options); 18 19scrollElements.forEach(animatedElement => { 20 observer.observe(animatedElement) 21}); 22 23document.addEventListener('DOMContentLoaded', function() { 24 const oval1 = document.getElementById('parallax-oval-1'); 25 const oval2 = document.getElementById('parallax-oval-2'); 26 27 function updateParallax() { 28 const scrollPosition = window.scrollY; 29 30 const oval1Offset = scrollPosition * 0.5; 31 const oval2Offset = -scrollPosition * 0.5; 32 33 oval1.style.transform = `translateY(${oval1Offset}px)`; 34 oval2.style.transform = `translateY(${oval2Offset}px)`; 35 36 } 37 38 let ticking = false; 39 40 function onScroll() { 41 if (!ticking) { 42 window.requestAnimationFrame(function() { 43 updateParallax(); 44 ticking = false; 45 }); 46 ticking = true; 47 } 48 } 49 50 window.addEventListener('scroll', onScroll, { passive: true }); 51 52 updateParallax(); 53 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.