PageSourceSearch

https://www.iplay.com/wp-content/themes/iplay/assets/js/main.js?ver=1790940678

js iplay.com collected 2026-10-02 11:33:51 UTC 7,317 bytes, 199 lines download raw bytes

1(function($) {
2    $(document).ready(function () {
3        const heroSliderContainerSelector = '.hero-slider';
4        $(heroSliderContainerSelector).on('click', '.hero-slider__item', function (event) {
5            const radioId = event.currentTarget.getAttribute('for');
6            const radioInput = document.getElementById(radioId);
7            if (radioInput && radioInput.checked) {
8                const sliderContentLinkEl = event.currentTarget.querySelector('.slide__content-link');
9                if (sliderContentLinkEl) {
10                    window.location.href = sliderContentLinkEl.getAttribute('href');
11                }
12            }
13
14            document.querySelectorAll('.hero-slider .slide__video').forEach(function(el) {
15                if (!el.paused) {
16                    el.classList.add('pause');
17                    el.load();
18                    el.pause();
19                }
20            });
21
22            if (event.currentTarget.querySelector('.slide__video').classList.contains('pause')) {
23                event.currentTarget.querySelector('video').play();
24
25                return;
26            }
27
28            loadVideo(event.currentTarget);
29        });
30
31        loadVideo();
32
33        $(document).on('click', '.short-description__read-more', function () {
34            $('.short-description__hide').css('display', 'block');
35            $(this).css('display', 'none');
36        });
37
38        let minicartUpsellSwiper = new Swiper('.minicart__upsell .swiper', {
39            pagination: {
40                el: ".minicart__upsell .swiper-pagination",
41                clickable: true,
42            },
43        })
44
45        $('.game-product__tabs').tabs({
46            show: {
47                duration: 'ease'
48            },
49            hide: {
50                duration: 'ease'
51            }
52        });
53
54        $('.add-form .add-form__field ').click(function () {
55            let $field = $('.add-form .add-form__field');
56
57            $field.removeClass('active');
58            $field.children('input[name="price"]').attr('checked', false);
59            $field.children('input[name="product_offer"]').prop("disabled", true);
60            $field.children('input[name="product_offer_coupon"]').prop("disabled", true);
61            $(this).addClass('active');
62            $(this).children('input[name="price"]').attr('checked', true);
63            $(this).children('input[name="product_offer"]').prop("disabled", false);
64            $(this).children('input[name="product_offer_coupon"]').prop("disabled", false);
65        })
66
67        $('.ratings__icons .ratings__icon').on('click', function () {
68            $(this).addClass('active');
69            $(this).prevAll().addClass('active');
70            $(this).nextAll().removeClass('active');
71            $(this).closest('#review_form_wrapper').find('.reply-form__submit-btn.btn.btn__submit').addClass('active');
72        })
73
74        let productGalleryThumb = new Swiper(".swiper.swiper__thumb", {
75            spaceBetween: 10,
76            slidesPerView: 'auto',
77            freeMode: true,
78            watchSlidesProgress: true,
79        });
80        let productGalleryMain = new Swiper(".swiper.swiper__main", {
81            autoHeight: true,
82            thumbs: {
83                swiper: productGalleryThumb,
84            },
85        });
86
87        let mostPlayedSwiperSelector = '.most-played .swiper';
88        let mostPlayedSwiper = new Swiper(mostPlayedSwiperSelector, {
89            loop: true,
90            autoplayDisableOnInteraction: false,
91            slidesPerView: 1,
92            autoplay: {
93                delay: 3000,
94            },
95            effect: 'fade',
96            fadeEffect: {
97                crossFade: true
98            },
99            pagination: {
100                el: '.most-played.swiper-pagination',
101                clickable: 'false',
102                type: 'bullets',
103                renderBullet: function (index, className) {
104                    return '<span class="' + className + '">' + '<em>'+'</em>' + '<i></i>' + '<b></b>'  + '</span>';
105                },
106
107            },
108        })
109
110        $(mostPlayedSwiperSelector).mouseenter(function() {
111            mostPlayedSwiper.autoplay.stop();
112        });
113
114        $(mostPlayedSwiperSelector).mouseleave(function() {
115            mostPlayedSwiper.autoplay.start();
116        });
117
118        let popularCategoriesSwiper = function () {
119            if ($(window).width() > 767) {
120                new Swiper('.popular-categories .swiper', {
121                    slidesPerView: 'auto',
122                    spaceBetween: 28,
123                    navigation: {
124                        nextEl: ".popular-categories .slider-wrapper > .swiper-button-next",
125                        prevEl: ".popular-categories .slider-wrapper > .swiper-button-prev",
126                    }
127                })
128            } else {
129                new Swiper('.popular-categories .swiper').destroy(true, true);
130            }
131        }
132
133        if ($('.popular-categories .swiper').length) {
134            popularCategoriesSwiper();
135            window.addEventListener('resize', popularCategoriesSwiper);
136        }
137
138        window.initSwiper();
139    });
140
141    function loadVideo(item = null)
142    {
143        const heroSliderContainerSelector = '.hero-slider';
144
145        if (item === null) {
146            let checkedInput = document.querySelector(`${heroSliderContainerSelector} .hero-slider__radio:checked`);
147
148            if (checkedInput === null) {
149                return;
150            }
151
152            item = document.querySelector(`${heroSliderContainerSelector} label[for=${checkedInput.id}]`);
153        }
154
155        const observer = lozad(`label[for=${item.attributes.for.value}] video.lozad`);
156        observer.observe();
157    }
158
159
160    function generateString() {
161        const characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
162
163        let result = ' ';
164        const charactersLength = characters.length;
165
166        for ( let i = 0; i < 5; i++ ) {
167            result += characters.charAt(Math.floor(Math.random() * charactersLength));
168        }
169
170        return result;
171    }
172
173    window.initSwiper = function () {
174        let swiperContainers = document.querySelectorAll('[class*=swiper-container]:not(.swiper-initialized)');
175
176        window.swiperIterator = window.swiperIterator ?? 0;
177
178        for (let i = 0; i < swiperContainers.length; i++) {
179            swiperContainers[i].classList.add('swiper-container-' + window.swiperIterator);
180
181            let slider = new Swiper('.swiper-container-' + window.swiperIterator, {
182                slidesPerView: 'auto',
183                spaceBetween: 10,
184                navigation: {
185                    nextEl: `.swiper-container-${window.swiperIterator} ~ .swiper-button-next`,
186                    prevEl: `.swiper-container-${window.swiperIterator} ~ .swiper-button-prev`,
187                },
188                breakpoints: {
189                    768: {
190                        slidesPerView: 'auto',
191                        spaceBetween: 24,
192                    }
193                }
194            });
195
196            window.swiperIterator++;
197        }
198    }
199})(jQuery);

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.