1/** 2 * CCUS Slider â Infinite Vertical Scroll 3 * Isolated from the homepage slider: targets .ccus-slider-track, reads ccusSettings. 4 */ 5 6(function () { 7 'use strict'; 8 9 document.addEventListener('DOMContentLoaded', function () { 10 const track = document.querySelector('.ccus-slider-track'); 11 12 if (!track) { 13 return; 14 } 15 16 let speed = 0.3; 17 let cloneCount = 8; 18 19 if (typeof ccusSettings !== 'undefined') { 20 speed = parseFloat(ccusSettings.speed) || 0.3; 21 cloneCount = parseInt(ccusSettings.cloneCount) || 8; 22 } 23 24 const originalContent = track.innerHTML; 25 26 if (cloneCount > 0 && originalContent) { 27 track.innerHTML = originalContent.repeat(cloneCount); 28 } 29 30 let halfHeight = 0; 31 let position = 0; 32 33 function animate() { 34 if (!halfHeight) { 35 halfHeight = track.scrollHeight / 2; 36 if (!halfHeight) { 37 requestAnimationFrame(animate); 38 return; 39 } 40 } 41 42 position = (position + speed) % halfHeight; 43 track.style.transform = `translateY(-${position}px)`; 44 requestAnimationFrame(animate); 45 } 46 47 animate(); 48 49 let resizeTimeout; 50 window.addEventListener('resize', function () { 51 clearTimeout(resizeTimeout); 52 resizeTimeout = setTimeout(function () { 53 const newHalfHeight = track.scrollHeight / 2; 54 position = position % newHalfHeight; 55 halfHeight = newHalfHeight; 56 }, 250); 57 }); 58 }); 59})();
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.