1// News Swiper Initialization 2// Only enable on mobile (768px and below) 3document.addEventListener('DOMContentLoaded', function() { 4 const newsSwipers = document.querySelectorAll('.swiper-news-grid'); 5 let swiperInstances = []; 6 7 function initSwipers() { 8 // Only initialize on mobile 9 // if (window.innerWidth <= 768) { 10 newsSwipers.forEach(function(swiperEl) { 11 const swiper = new Swiper(swiperEl, { 12 slidesPerView: 'auto', 13 spaceBetween: 24, 14 freeMode: { 15 enabled: true, 16 // momentum: true, 17 // momentumRatio: 0.8, 18 // momentumVelocityRatio: 0.8, 19 }, 20 // direction: 'horizontal', 21 // mousewheel: false, 22 // allowTouchMove: false, 23 // touchRatio: 1, 24 // followFinger: true, 25 // resistance: true, 26 // resistanceRatio: 0.85, 27 speed: 600, 28 breakpoints: { 29 320: { 30 spaceBetween: 16, 31 }, 32 480: { 33 spaceBetween: 16, 34 }, 35 768: { 36 spaceBetween: 18, 37 }, 38 820: { 39 spaceBetween: 24, 40 }, 41 } 42 }); 43 swiperInstances.push(swiper); 44 }); 45 // } 46 } 47 48 function destroySwipers() { 49 swiperInstances.forEach(function(swiper) { 50 if (swiper) swiper.destroy(true, true); 51 }); 52 swiperInstances = []; 53 } 54 55 // Initialize on load 56 initSwipers(); 57 58 // Reinitialize on resize 59 let resizeTimer; 60 window.addEventListener('resize', function() { 61 clearTimeout(resizeTimer); 62 resizeTimer = setTimeout(function() { 63 destroySwipers(); 64 initSwipers(); 65 }, 250); 66 }); 67});
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.