1(function () { 2 'use strict'; 3 4 if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) { 5 return; 6 } 7 8 var cards = document.querySelectorAll('[data-image-cycle="true"]'); 9 10 cards.forEach(function (card) { 11 if (card.dataset.cycleReady === 'true') { 12 return; 13 } 14 15 var images = Array.prototype.slice.call(card.querySelectorAll('.about-lavra__direction-image')); 16 17 if (images.length < 2) { 18 return; 19 } 20 21 card.dataset.cycleReady = 'true'; 22 var current = 0; 23 var timer = null; 24 25 var showNext = function () { 26 var next = (current + 1) % images.length; 27 images[next].classList.add('is-active'); 28 images[current].classList.remove('is-active'); 29 current = next; 30 }; 31 32 var start = function () { 33 if (!timer) { 34 timer = window.setInterval(showNext, 5500); 35 } 36 }; 37 38 var stop = function () { 39 if (timer) { 40 window.clearInterval(timer); 41 timer = null; 42 } 43 }; 44 45 if ('IntersectionObserver' in window) { 46 var observer = new IntersectionObserver(function (entries) { 47 entries.forEach(function (entry) { 48 if (entry.isIntersecting) { 49 start(); 50 } else { 51 stop(); 52 } 53 }); 54 }, { threshold: 0.15 }); 55 56 observer.observe(card); 57 } else { 58 start(); 59 } 60 }); 61}());
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.