1document.addEventListener('DOMContentLoaded', () => { 2 if (window.innerWidth <= 600) { // ã¹ããçã®ã¿å®è¡ 3 const images = document.querySelectorAll('#background-container-sp .bg-image'); 4 const scrollSteps = [1000, 2500, 3500, 4500]; // åèæ¯ç»åãã¨ã®ã¹ã¯ãã¼ã«è·é¢ï¼ã¹ããçï¼ 5 6 let currentImageIndex = 0; 7 8 function updateBackground() { 9 const scrollPosition = window.scrollY; 10 11 // æ°ããã¤ã³ããã¯ã¹ãè¨ç® 12 let newIndex = scrollSteps.findIndex(step => scrollPosition < step); 13 14 if (newIndex === -1) { 15 newIndex = scrollSteps.length - 1; // æå¾ã®ç»åã表示ãããããã«èª¿æ´ 16 } 17 18 if (newIndex !== currentImageIndex) { 19 images[currentImageIndex].classList.remove('active'); 20 images[currentImageIndex].classList.add('fade-out'); 21 22 currentImageIndex = newIndex; 23 24 images[currentImageIndex].classList.remove('fade-out'); 25 images[currentImageIndex].classList.add('active'); 26 } 27 } 28
29 window.addEventListener('scroll', updateBackground); 30 images[currentImageIndex].classList.add('active'); 31 } 32});
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.