1let lastScrollY = window.scrollY; 2let delayedScrollY = lastScrollY; 3 4const children = document.querySelectorAll('.js--floating'); // è¤æ°ã®è¦ç´ ãåå¾ 5 6function lerp(start, end, factor) { 7 return start + (end - start) * factor; 8} 9 10function updatePosition() { 11 delayedScrollY = lerp(delayedScrollY, window.scrollY, 0.2); // ã¹ã ã¼ãºã«è¿½å¾ 12 let baseOffset = window.scrollY - delayedScrollY; // åºæ¬ã®è¿½å¾é 13 14 children.forEach(child => { 15 let offsetMultiplier = 1.5; // ããã©ã«ãã®è¿½å¾ã®é ãé 16 17 // ã¯ã©ã¹ã«ãã£ã¦è¿½å¾ã®é ãéã夿´ 18 if (child.classList.contains('js--floating_delay1')) { 19 offsetMultiplier = 0.5; 20 } else if (child.classList.contains('js--floating_delay2')) { 21 offsetMultiplier = 2.0; 22 } 23 24 let offset = baseOffset * offsetMultiplier; // é ãéãé©ç¨ 25 child.style.transform = `translateY(${offset}px)`; // åè¦ç´ ã«å¯¾ãã¦ã¢ãã¡ã¼ã·ã§ã³ãé©ç¨ 26 }); 27 28 requestAnimationFrame(updatePosition); // ã¢ãã¡ã¼ã·ã§ã³ãã¬ã¼ã ããªã¯ã¨ã¹ã 29} 30 31updatePosition();
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.