PageSourceSearch

https://testpro.io/wp-content/themes/testpro/assets/js/main.js?ver=1790532999

js testpro.io collected 2026-09-29 15:06:50 UTC 18,860 bytes, 511 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    $(document).ready(function () {
5        if ( typeof Swiper !== 'undefined' ) {
6            const swiper = new Swiper('.peoples-lives-section', {
7                slidesPerView: 1,
8                centeredSlides: false,
9                spaceBetween: 30,
10                loop: true,
11                breakpoints: {
12                    320: {
13                        slidesPerView: 1
14                    },
15                    768: {
16                        slidesPerView: 3
17                    },
18                    1200: {
19                        slidesPerView: 6
20                    }
21
22                }
23
24                /* slidesPerView: 6, // Default to show 6 slides like Slick
25                 spaceBetween: 0,  // Equivalent to centerPadding: 0
26                 centeredSlides: true, // Equivalent to centerMode: true in Slick
27                 loop: true,  // Equivalent to infinite: true in Slick
28                 speed: 300,  // Transition speed
29                 /!*pagination: {
30                     el: '.swiper-pagination', // Show dots
31                     clickable: true, // Allow clicking on the dots for navigation
32                 },*!/
33                 autoplay: false, // Set to false if you don't need autoplay
34                 navigation: false, // Hide navigation arrows (nextArrow, prevArrow set to false)
35
36                 breakpoints: {
37                     1400: {
38                         slidesPerView: 4,
39                         spaceBetween: '20%', // Equivalent to centerPadding: '20%'
40                     },
41                     1024: {
42                         slidesPerView: 3,
43                         spaceBetween: '20%',
44                     },
45                     998: {
46                         slidesPerView: 3,
47                         spaceBetween: '20%',
48                     },
49                     768: {
50                         slidesPerView: 1,
51                         spaceBetween: '20%',
52                     }
53                 }*/
54            });
55        }
56
57        /**
58         * Popup 1 time after 5 sec
59         * @type {string}
60         */
61        const firstTime = localStorage.getItem('testpro_first_time');
62        if(!firstTime) {
63            setTimeout(function() {
64                //document.querySelector('.modal-webinar').click()
65            }, 5000);
66            localStorage.setItem("testpro_first_time","1");
67        }
68
69        if ( $(window).width() < 768 ) {
70            $('.header-box').click(function() {
71                //document.querySelector('.modal-webinar').click()
72                $('[data-modal]:not(.modal)').click();
73            })
74        }
75
76
77        let skillsBtns = document.getElementsByClassName("expend-button");
78        let skillsSection = document.querySelectorAll(".skills-section");
79
80        for (let i = 0; i < skillsBtns.length; i++) {
81            skillsBtns[i].addEventListener('click', function () {
82                skillsSection[i].classList.toggle('expended');
83                let iconPlus = skillsBtns[i].querySelector('.fa-plus');
84                let iconMinus = skillsBtns[i].querySelector('.fa-window-minimize');
85                if (iconPlus) {
86                    iconPlus.classList.remove('fa-plus');
87                    iconPlus.classList.add('fa-window-minimize');
88                    iconPlus.style.marginTop = '-10px';
89                } else if (iconMinus) {
90                    iconMinus.classList.remove('fa-window-minimize');
91                    iconMinus.classList.add('fa-plus');
92                    iconMinus.style.marginTop = '0';
93                }
94            })
95        }
96        // FAQ SHOW ALL END //
97
98
99        //  PACIFIC TIME START //
100        /*const boxes = document.getElementsByClassName('pacific-time-box');
101        for (let i = 0; i < boxes.length; i++) {
102            boxes[i].addEventListener('click', function () {
103                boxes[i].classList.toggle('active')
104            })
105        }*/
106        //  PACIFIC TIME END //
107
108
109        //  ACCARDION START //
110        const faqAccordion = document.querySelectorAll('.faq-section-accordion-box')
111
112        for (let i = 0; i < faqAccordion.length; i++) {
113            faqAccordion[i].addEventListener("click", function (event) {
114                event.currentTarget.classList.toggle('active')
115            })
116        }
117        //  ACCARDION END //
118
119
120        //  POPUP START //
121        const openModal = document.querySelectorAll('.openModal');
122        //const popupSection = document.querySelector('.popup-section');
123        let popupSection = '';
124        const overlay = document.querySelector('.overlay');
125        let closeButton = '';
126        //const popupJoin = document.querySelector('.popup-join')
127        const popupForm = document.querySelector('.popup-form')
128        const popupDone = document.querySelector('.popup-done')
129        //const doneBtn = document.querySelector('.done-btn')
130        let doneBtn = '';
131        const body = document.querySelector('body')
132
133        for (let i = 0; i < openModal.length; i++) {
134            openModal[i].addEventListener('click', function (event) {
135                document.querySelector('#modal-webinar .popup-form').classList.remove('d-none');
136                document.querySelector('#modal-webinar .popup-done').classList.add('d-none');
137                document.querySelector('#modal-webinar .popup-form button').textContent = 'Join';
138
139                document.querySelector('#modal-call .popup-form').classList.remove('d-none');
140                document.querySelector('#modal-call .popup-done').classList.add('d-none');
141                document.querySelector('#modal-call .popup-form button').textContent = 'Send';
142
143                let popup = '';
144                if ( event.target.classList.contains('modal-coursepacket')) {
145                    popup = 'modal-coursepacket';
146                } else if ( event.target.classList.contains('modal-webinar')) {
147                    popup = 'modal-webinar';
148                } else if ( event.target.classList.contains('modal-call')) {
149                    popup = 'modal-call';
150                }
151                console.log(popup);
152                popupSection = document.querySelector('#'+popup+' .popup-section');
153                closeButton = document.querySelector('#'+popup+' .close');
154                doneBtn = document.querySelector('#'+popup+' .done-btn')
155                if (closeButton) {
156                    closeButton.addEventListener('click', function (e) {
157                        e.preventDefault()
158                        popupSection.classList.remove('d-block');
159                        overlay.classList.remove('d-block');
160                        body.classList.remove('modal-open');
161                        //body.style.overflow = "auto"
162                    })
163                }
164
165                if (doneBtn) {
166                    doneBtn.addEventListener('click', function (e) {
167                        e.preventDefault()
168                        popupSection.classList.remove('d-block');
169                        overlay.classList.remove('d-block');
170                        body.classList.remove('modal-open');
171                        //body.style.overflow = "auto"
172                    });
173                }
174
175                popupSection.classList.add('d-block');
176                overlay.classList.add('d-block');
177                body.classList.add('modal-open');
178                //body.style.overflow = "hidden"
179                event.preventDefault();
180            });
181        }
182        if ( overlay ) {
183            overlay.addEventListener('click', function () {
184                popupSection.classList.toggle('d-block');
185                overlay.classList.toggle('d-block');
186                body.classList.remove('modal-open');
187                //body.style.overflow = "auto"
188            });
189        }
190
191        /*if (popupJoin) {
192            popupJoin.addEventListener('click', function (e) {
193                e.preventDefault()
194                popupForm.classList.toggle('d-none');
195                popupDone.classList.toggle('d-none');
196                body.style.overflow = "auto"
197            })
198        }*/
199
200
201        //  POPUP END //
202        const navLinksScroll = document.querySelector('.nav-links-scroll');
203
204        function handleNavScroll() {
205            if (navLinksScroll) {
206                if (window.scrollY >= 200) {
207                    navLinksScroll.style.display = 'flex';
208                    navLinksScroll.style.position = 'fixed';
209                    navLinksScroll.style.top = '5px';
210                    navLinksScroll.style.left = '50%';
211                    navLinksScroll.style.transform = 'translate(-50%, -10%)';
212                    navLinksScroll.style.zIndex = '3';
213                    navLinksScroll.style.background = 'rgba(255, 255, 255, 0.8)';
214                    //navLinksScroll.style.backdropFilter = 'blur(13.5914px)';
215                    //navLinksScroll.style.webkitBackdropFilter = 'blur(13.5914px)';
216                    navLinksScroll.style.width = '100%';
217
218                    const mediaQuery = window.matchMedia('(max-width: 1024px)');
219                    if (mediaQuery.matches) {
220                        navLinksScroll.style.padding = '10px 10px';
221                    } else {
222                        navLinksScroll.style.padding = '16px 10px';
223                    }
224                } else {
225                    navLinksScroll.style.display = '';
226                    navLinksScroll.style.position = '';
227                    navLinksScroll.style.top = '';
228                    navLinksScroll.style.left = '';
229                    navLinksScroll.style.transform = '';
230                    navLinksScroll.style.zIndex = '';
231                    navLinksScroll.style.background = '';
232                    navLinksScroll.style.backdropFilter = '';
233                    navLinksScroll.style.webkitBackdropFilter = '';
234                    navLinksScroll.style.width = '';
235                    navLinksScroll.style.padding = '';
236                }
237            }
238        }
239
240        window.addEventListener('scroll', handleNavScroll);
241        // Menu in scroll START //
242
243
244        //  Login icon position START //
245        window.addEventListener('scroll', function () {
246            let loginScroll = document.querySelector('.login_scroll');
247            if (loginScroll) {
248                if (window.scrollY >= 200) {
249                    loginScroll.style.top = '19px';
250                } else {
251                    loginScroll.style.display = '';
252                }
253            }
254        });
255        //  Login icon position START //
256
257
258        //  Header other menu scroll START //
259        window.addEventListener('scroll', function () {
260            let headerSection = document.querySelector('.header-section');
261            if (headerSection) {
262                if (window.scrollY >= 200) {
263                    headerSection.style.display = 'block';
264                } else {
265                    headerSection.style.display = '';
266                }
267            }
268        });
269        //  Header other menu scroll END //
270
271
272        //  Header section ships START //
273        const headerSectionBtn = document.querySelector('.header-section-btn');
274        const darkMode = document.querySelector('.dark-mode');
275
276        if (headerSectionBtn) {
277            headerSectionBtn.addEventListener("click", function (e) {
278                e.preventDefault()
279                const headerShips = document.querySelector('.header-section-ships')
280                if (headerShips) {
281                    if (headerShips.style.display !== 'flex') {
282                        headerShips.style.display = 'flex'
283                    } else {
284                        headerShips.style.display = 'none'
285                    }
286                }
287
288                if (darkMode) {
289                    if (darkMode.style.display !== 'block') {
290                        darkMode.style.display = 'block'
291                    } else {
292                        darkMode.style.display = 'none'
293                    }
294                }
295
296                darkMode.addEventListener("click", function () {
297                    headerShips.style.display = 'none'
298                    darkMode.style.display = 'none'
299
300                })
301            })
302        }
303        //  Header section ships END //
304
305
306        //  Menu in right START //
307        const mediaRightMenu = document.querySelector('.media-right-menu')
308        const menuMobile = document.querySelectorAll('.menu-mobile ')
309        const primaryIcon = document.querySelectorAll('.primary-icon')
310        const headerSectionClosed = document.querySelector('.header-section-closed')
311        const blur = document.querySelector('.blur')
312
313        for (let i = 0; i < primaryIcon.length; i++) {
314            primaryIcon[i].addEventListener('click', function () {
315                mediaRightMenu.style.right = "0px";
316            });
317        }
318
319        for (let i = 0; i < menuMobile.length; i++) {
320            menuMobile[i].addEventListener('click', function () {
321                mediaRightMenu.style.right = "0px";
322                blur.classList.toggle('d-block');
323            });
324        }
325        if (headerSectionClosed) {
326            headerSectionClosed.addEventListener('click', function () {
327
328                mediaRightMenu.style.right = "-400px";
329                blur.classList.toggle('d-none');
330
331            })
332            blur.addEventListener('click', function () {
333                blur.classList.toggle('d-block');
334                mediaRightMenu.style.right = "-400px";
335            });
336        }
337
338        //  Menu in right END //
339
340
341        // COUNTER SECTION START //
342        $('.counter-section').slick({
343            dots: true,
344            infinite: true,
345            speed: 300,
346            slidesToShow: 5,
347            slidesToScroll: 5,
348            nextArrow: false,
349            prevArrow: false,
350            responsive: [{
351                breakpoint: 1025, settings: {
352                    slidesToShow: 4, slidesToScroll: 1, infinite: true, dots: false
353                }
354            }, {
355                breakpoint: 998, settings: {
356                    slidesToShow: 3, slidesToScroll: 2, infinite: true, dots: false
357                }
358            }, {
359                breakpoint: 768, settings: {
360                    slidesToShow: 2, slidesToScroll: 1, dots: false
361                }
362            }, {
363                breakpoint: 578, settings: {
364                    slidesToShow: 1, slidesToScroll: 1, dots: true
365                }
366            }, {
367                breakpoint: 414, settings: {
368                    slidesToShow: 1, slidesToScroll: 1, dots: true
369                }
370            }]
371        });
372
373
374        //  BRAND SECTION START //
375        $('.brand-section').slick({
376            dots: true,
377            infinite: true,
378            speed: 300,
379            slidesToShow: 6,
380            slidesToScroll: 6,
381            nextArrow: false,
382            prevArrow: false,
383            responsive: [{
384                breakpoint: 1024, settings: {
385                    slidesToShow: 5, slidesToScroll: 1, infinite: true, dots: true,
386                }
387            }, {
388                breakpoint: 998, settings: {
389                    slidesToShow: 4, slidesToScroll: 1, infinite: true, dots: true,
390                }
391            }, {
392                breakpoint: 769, settings: {
393                    slidesToShow: 1, slidesToScroll: 1, infinite: true, dots: true,
394                }
395            }, {
396                breakpoint: 500, settings: {
397                    slidesToShow: 1, slidesToScroll: 1, infinite: true, dots: true,
398                }
399            }, {
400                breakpoint: 415, settings: {
401                    slidesToShow: 1, slidesToScroll: 1, infinite: true, dots: true,
402                }
403            }]
404        });
405        //  BRAND SECTION START //
406
407
408        //  REVIEWS SECTION START //
409        $('.reviews-box').slick({
410            dots: true,
411            infinite: true,
412            speed: 300,
413            slidesToShow: 3,
414            slidesToScroll: 3,
415            nextArrow: false,
416            prevArrow: false,
417            responsive: [{
418                breakpoint: 1025, settings: {
419                    slidesToShow: 2, variableWidth: true, slidesToScroll: 1, infinite: true, dots: false,
420                }
421            }, {
422                breakpoint: 998, settings: {
423                    slidesToShow: 2, slidesToScroll: 1, infinite: true, dots: false,
424                }
425            }, {
426                breakpoint: 769, settings: {
427                    slidesToShow: 1.8, slidesToScroll: 1, infinite: true, dots: false,
428                }
429            }, {
430                breakpoint: 577, settings: {
431                    slidesToShow: 1, slidesToScroll: 1,
432                }
433            }]
434        });
435        //  REVIEWS SECTION END //
436
437
438        //  TEACHERS SECTION START //
439        $('.teachers-box-section').slick({
440            dots: true,
441            infinite: true,
442            speed: 300,
443            slidesToShow: 3,
444            slidesToScroll: 3,
445            nextArrow: false,
446            prevArrow: false,
447            responsive: [{
448                breakpoint: 1024, settings: {
449                    slidesToShow: 3, slidesToScroll: 1, infinite: true,
450
451                }
452            }, {
453                breakpoint: 998, settings: {
454                    slidesToShow: 3, slidesToScroll: 1
455                }
456            }, {
457                breakpoint: 768, settings: {
458                    slidesToShow: 1, slidesToScroll: 1
459                }
460            }, {
461                breakpoint: 500, settings: {
462                    slidesToShow: 1, slidesToScroll: 1
463                }
464            }]
465        });
466        //  TEACHERS SECTION END //
467
468        $('.what-we-teach-gallery').slick({
469            dots: false,
470            infinite: true,
471            slidesToShow: 6,
472            slidesToScroll: 6
473        });
474
475        /**
476         *
477         */
478        TestPro.intlTelInputInit('.testpro-form');
479        TestPro.analyticsInit();
480        TestPro.botDetection();
481        TestPro.getUtmParams();
482
483
484
485        /**
486         *
487         */
488        $(document).on( 'applied_coupon_in_checkout', function(event, coupon){
489            $('#apply_coupon').removeClass('non-applied');
490            const price_before_coupon = $('.tp-price').text();
491            const price_after_coupon = Math.ceil($('.order-total').data('price'));
492
493            $('.tp-regular-price').text('$'+price_after_coupon).removeClass('hide');
494            console.log(coupon);
495        });
496
497        /**
498         *
499         */
500        $('[data-modal]:not(.modal)').click(function(){
501            $('.modal[data-modal="'+$(this).attr('data-modal')+'"]').addClass('open');
502        });
503
504        $('.modalClose, .modalBack').click(function(){
505            $('.modal').removeClass('open');
506        });
507    });
508
509})(jQuery);
510
511

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.