PageSourceSearch

https://www.allimmunology.org/js/animate-on-scroll.js

js allimmunology.org collected 2026-09-25 08:59:00 UTC 2,246 bytes, 54 lines download raw bytes

1if (document.body.classList.contains("cc-animate-enabled"))
2  if ("IntersectionObserver" in window && "MutationObserver" in window) {
3    const initAnimateOnScroll = () => {
4        const animatableElems = document.querySelectorAll(
5          "[data-cc-animate]:not(.cc-animate-init)",
6        );
7        if (animatableElems.length > 0) {
8          const intersectionObserver = new IntersectionObserver(
9            (entries, observer) => {
10              entries.forEach((entry) => {
11                entry.isIntersecting &&
12                  !entry.target.classList.contains("cc-animate-in") &&
13                  (entry.target.classList.add("cc-animate-in"),
14                  observer.unobserve(entry.target));
15              });
16            },
17          );
18          animatableElems.forEach((elem) => {
19            (elem.dataset.ccAnimateDelay &&
20              (elem.style.animationDelay = elem.dataset.ccAnimateDelay),
21              elem.dataset.ccAnimateDuration &&
22                (elem.style.animationDuration = elem.dataset.ccAnimateDuration),
23              elem.dataset.ccAnimate &&
24                elem.classList.add(elem.dataset.ccAnimate),
25              elem.classList.add("cc-animate-init"),
26              intersectionObserver.observe(elem));
27          });
28        }
29      },
30      aosMinWidth =
31        getComputedStyle(document.documentElement).getPropertyValue(
32          "--aos-min-width",
33        ) || "0",
34      mq = window.matchMedia(`(min-width: ${aosMinWidth}px)`);
35    if (mq.matches)
36      (initAnimateOnScroll(),
37        document.addEventListener("DOMContentLoaded", () => {
38          new MutationObserver(debounce(initAnimateOnScroll, 250)).observe(
39            document.body,
40            { subtree: !0, childList: !0 },
41          );
42        }));
43    else {
44      document.body.classList.remove("cc-animate-enabled");
45      try {
46        mq.addEventListener("change", (event) => {
47          event.matches &&
48            (document.body.classList.add("cc-animate-enabled"),
49            setTimeout(initAnimateOnScroll, 100));
50        });
51      } catch {}
52    }
53  } else document.body.classList.remove("cc-animate-enabled");
54//# sourceMappingURL=/cdn/shop/t/146/assets/animate-on-scroll.js.map?v=15249566486942820451778112651

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.