1/******* Do not edit this file ******* 2Simple Custom CSS and JS - by Silkypress.com 3Saved: Aug 26 2025 | 17:38:46 */ 4jQuery(document).ready(function ($) { 5 const $slider = $(".custom-slider"); 6 const $slides = $(".slide"); 7 const $prevBtn = $("#prevBtn"); 8 const $nextBtn = $("#nextBtn"); 9 const $rewards = $(".slider-rewards-box"); 10 11 let currentIndex = 0; 12 let totalSlides = $slides.length; 13 let isAnimating = false; 14 15 function getSlidesPerView() { 16 const width = $(window).width(); 17 if (width >= 1024) return 3; 18 if (width >= 768) return 2; 19 return 1; 20 } 21 22 function createInfiniteSlider() { 23 $slider.find('.slide-clone').remove(); 24 25 const slidesPerView = getSlidesPerView(); 26 27 for (let i = totalSlides - 1; i >= 0; i--) { 28 const $clone = $slides.eq(i).clone().addClass('slide-clone slide-clone-before'); 29 $slider.prepend($clone); 30 } 31 32 for (let i = 0; i < totalSlides; i++) { 33 const $clone = $slides.eq(i).clone().addClass('slide-clone slide-clone-after'); 34 $slider.append($clone); 35 } 36 37 currentIndex = 0; 38 updateSliderPosition(false); 39 } 40 41 function updateSliderPosition(animate = true) { 42 const slidesPerView = getSlidesPerView(); 43 const slideWidth = $slides.outerWidth(); 44 const gap = slidesPerView === 1 ? 0 : 24; 45 const totalSlideWidth = slideWidth + gap; 46 47 const offset = -(totalSlides + currentIndex) * totalSlideWidth; 48 49 if (!animate) { 50 $slider.css('transition', 'none'); 51 $slider.css("transform", `translateX(${offset}px)`); 52 setTimeout(() => { 53 $slider.css('transition', 'transform 0.3s ease'); 54 }, 50); 55 } else { 56 $slider.css("transform", `translateX(${offset}px)`); 57 } 58 } 59 60 $nextBtn.on("click", function () { 61 if (isAnimating) return; 62 63 isAnimating = true; 64 currentIndex++; 65 updateSliderPosition(true); 66 67 setTimeout(() => { 68 if (currentIndex >= totalSlides) { 69 currentIndex = 0; 70 updateSliderPosition(false); 71 } 72 isAnimating = false; 73 }, 300); 74 }); 75 76 $prevBtn.on("click", function () { 77 if (isAnimating) return; 78 79 isAnimating = true; 80 81 if (currentIndex === 0) { 82 currentIndex = totalSlides; 83 updateSliderPosition(false); 84 85 setTimeout(() => { 86 currentIndex--; 87 updateSliderPosition(true); 88 89 setTimeout(() => { 90 isAnimating = false; 91 }, 300); 92 }, 50); 93 } else { 94 currentIndex--; 95 updateSliderPosition(true); 96 97 setTimeout(() => { 98 isAnimating = false; 99 }, 300); 100 } 101 }); 102 103 $(window).on("resize", function () { 104 if (isAnimating) return; 105 106 currentIndex = 0; 107 createInfiniteSlider(); 108 }); 109 110 if ($rewards.length) { 111 $slider.css('transition', 'transform 0.3s ease'); 112 createInfiniteSlider(); 113 } 114});
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.