1tb.onRootElementReady((tbRootElement) => { 2 const counters = document.querySelectorAll('.tb-numbers .number'); 3 function executeCounter() { 4 counters.forEach((counter) => { 5 //should be a number 6 if (isNaN(counter.getAttribute('data-target'))) return; 7 8 let prefix = counter.getAttribute('data-prefix'); 9 counter.innerText = '0'; 10 const updateCounter = () => { 11 const target = +counter.getAttribute('data-target'); 12 const count = +counter.innerText; 13 const increment = target / 200; 14 if (count < target) { 15 counter.innerText = `${Math.ceil(count + increment)}`; 16 setTimeout(updateCounter, 1); 17 } else { 18 if (prefix == '%') { 19 counter.innerText = target + prefix; 20 } else { 21 counter.innerText = prefix + target; 22 } 23 } 24 }; 25 updateCounter(); 26 }); 27 } 28 29 let observerCounterEl = document.querySelector('.tb-numbers'); 30 if (observerCounterEl) { 31 const observerCounter = new IntersectionObserver((entries) => { 32 entries.forEach((entry) => { 33 const intersecting = entry.isIntersecting; 34 35 if (intersecting) { 36 executeCounter(); 37 } 38 39 if (entry.intersectionRatio > 0) { 40 observerCounter.unobserve(entry.target); 41 } 42 }); 43 }); 44 45 const optionsCounter = { 46 root: observerCounterEl, 47 threshold: 0.2, 48 }; 49 50 observerCounter.observe(observerCounterEl, optionsCounter); 51 } 52});
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.