1(function () { 2 var root = document.querySelector(".intro-slider"); 3 if (!root) return; 4 5 var slides = Array.prototype.slice.call(root.querySelectorAll(".intro-slide")); 6 if (slides.length < 2) return; 7 8 var index = 0; 9 var elapsed = 0; 10 var TICK = 500; 11 var DELAY = 11000; 12 var hovering = false; 13 14 function restartZoom(slide) { 15 var img = slide.querySelector("img"); 16 if (!img) return; 17 img.style.animation = "none"; 18 void img.offsetWidth; 19 img.style.animation = ""; 20 } 21 22 function show(i) { 23 index = (i + slides.length) % slides.length; 24 elapsed = 0; 25 slides.forEach(function (s, n) { 26 s.classList.toggle("is-active", n === index); 27 s.setAttribute("aria-hidden", n === index ? "false" : "true"); 28 var link = s.querySelector(".intro-link"); 29 if (link) link.setAttribute("tabindex", n === index ? "0" : "-1"); 30 if (n === index) restartZoom(s); 31 }); 32 } 33 34 function paused() { 35 if (document.hidden) return true; 36 if (hovering) return true; 37 var a = document.activeElement; 38 return !!(a && a !== document.body && root.contains(a)); 39 } 40 41 var canHover = window.matchMedia && window.matchMedia("(hover: hover)").matches; 42 if (canHover) { 43 root.addEventListener("mouseenter", function () { hovering = true; }); 44 root.addEventListener("mouseleave", function () { hovering = false; }); 45 } 46 47 show(0); 48 window.setInterval(function () { 49 if (paused()) return; 50 elapsed += TICK; 51 if (elapsed >= DELAY) show(index + 1); 52 }, TICK); 53})();
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.