PageSourceSearch

https://soas.co.jp/wp-content/themes/simplist/js/countup.js?ver=A20250910A

js soas.co.jp collected 2026-10-07 13:44:07 UTC 1,212 bytes, 43 lines download raw bytes

1//数字を0からカウントアップ
2
3document.addEventListener('DOMContentLoaded', () => {
4  const counts = document.querySelectorAll('.countup');
5
6  const animateCountUp = (el, duration = 1000) => {
7    const targetValue = +el.textContent;
8    const startTime = performance.now();
9
10    const updateCount = (currentTime) => {
11      const elapsedTime = currentTime - startTime;
12      const progress = elapsedTime / duration;
13      const currentCount = Math.min(targetValue * progress, targetValue);
14
15      el.textContent = Math.floor(currentCount);
16
17      if (currentCount < targetValue) {
18        requestAnimationFrame(updateCount);
19      } else {
20        el.textContent = targetValue;
21      }
22    };
23
24    requestAnimationFrame(updateCount);
25  };
26
27  const onEntry = (entries, observer) => {
28    entries.forEach(entry => {
29      if (entry.isIntersecting) {
30        animateCountUp(entry.target);
31        observer.unobserve(entry.target); // Stop observing after animation
32      }
33    });
34  };
35
36  const observer = new IntersectionObserver(onEntry, {
37    threshold: 0.5  // Adjust as needed to start animation when element is 50% visible
38  });
39
40  counts.forEach(count => {
41    observer.observe(count);
42  });
43});

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.