1(function () { 2 function animateGroup(container) { 3 const duration = parseInt(container.dataset.duration || '1500', 10); 4 const nums = Array.from(container.querySelectorAll('.counter__num')); 5 const targets = nums.map(el => parseInt(el.dataset.target || '0', 10)); 6 7 const start = performance.now(); 8 function frame(now) { 9 const t = Math.min((now - start) / duration, 1); 10 nums.forEach((el, i) => { 11 const target = targets[i]; 12 el.textContent = Math.round(t * target).toLocaleString(); 13 }); 14 if (t < 1) requestAnimationFrame(frame); 15 } 16 requestAnimationFrame(frame); 17 } 18 19 function boot() { 20 document.querySelectorAll('[data-counter-sync]').forEach(container => { 21 if (container._ran) return; 22 container._ran = true; 23 24 if ('IntersectionObserver' in window) { 25 const io = new IntersectionObserver((entries, obs) => { 26 entries.forEach(e => { 27 if (e.isIntersecting) { 28 animateGroup(container); 29 obs.unobserve(container); 30 } 31 }); 32 }, { threshold: 0.25 }); 33 io.observe(container); 34 } else { 35 animateGroup(container); 36 } 37 }); 38 } 39 40 if (document.readyState !== 'loading') boot(); 41 else document.addEventListener('DOMContentLoaded', boot); 42})();
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.