PageSourceSearch

https://joelandrada.com/wp-content/themes/newsphere/assets/script.js?ver=6.2.2

js joelandrada.com collected 2026-10-07 13:15:55 UTC 21,477 bytes, 620 lines download raw bytes

1(function (e) {
2    "use strict";
3    var n = window.AFTHRAMPES_JS || {};
4    $ = jQuery;
5
6    n.mobileMenu = {
7        init: function () {
8            //var element = document.getElementsByClassName("main-navigation");
9
10            this.toggleMenu(), this.menuMobile(), this.menuArrow();
11
12            if (e('.aft-mobile-navigation').length) {
13                var element = document.querySelector(".aft-mobile-navigation");
14                this.trapFocus(element);
15            }
16        },
17
18        toggleMenu: function () {
19            e('#masthead').on('click', '.toggle-menu', function (event) {
20                var ethis = e('.main-navigation .menu .menu-mobile');
21                if (ethis.css('display') == 'block') {
22                    ethis.slideUp('300');
23                } else {
24                    ethis.slideDown('300');
25                }
26                e('.ham').toggleClass('exit');
27            });
28
29
30            e('#masthead .main-navigation ').on('click', '.menu-mobile a button', function (event) {
31                event.preventDefault();
32                var ethis = e(this),
33                    eparent = ethis.closest('li');
34
35                if (eparent.find('> .children').length) {
36                    var esub_menu = eparent.find('> .children');
37                } else {
38                    var esub_menu = eparent.find('> .sub-menu');
39                }
40
41
42                if (esub_menu.css('display') == 'none') {
43                    esub_menu.slideDown('300');
44                    ethis.addClass('active');
45                } else {
46                    esub_menu.slideUp('300');
47                    ethis.removeClass('active');
48                }
49                return false;
50            });
51        },
52
53        trapFocus: function (element) {
54            console.log(element)
55            var focusableEls = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),
56                firstFocusableEl = focusableEls[0],
57                lastFocusableEl = focusableEls[focusableEls.length - 1],
58                KEYCODE_TAB = 9;
59
60            element.addEventListener('keydown', function (e) {
61                var isTabPressed = (e.key === 'Tab' || e.keyCode === KEYCODE_TAB);
62
63                if (!isTabPressed) {
64                    return;
65                }
66
67                if (e.shiftKey) /* shift + tab */ {
68                    if (document.activeElement === firstFocusableEl) {
69                        lastFocusableEl.focus();
70                        e.preventDefault();
71                    }
72                } else /* tab */ {
73                    if (document.activeElement === lastFocusableEl) {
74                        firstFocusableEl.focus();
75                        e.preventDefault();
76                    }
77                }
78
79            });
80        },
81
82        menuMobile: function () {
83            if (e('.main-navigation .menu > ul').length) {
84                var ethis = e('.main-navigation .menu > ul'),
85                    eparent = ethis.closest('.main-navigation'),
86                    pointbreak = eparent.data('epointbreak'),
87                    window_width = window.innerWidth;
88                if (typeof pointbreak == 'undefined') {
89                    pointbreak = 991;
90                }
91                if (pointbreak >= window_width) {
92                    ethis.addClass('menu-mobile').removeClass('menu-desktop');
93                    e('.main-navigation .toggle-menu').css('display', 'block');
94                    e('.aft-dynamic-navigation-elements').addClass('aft-mobile-navigation');
95                } else {
96                    ethis.addClass('menu-desktop').removeClass('menu-mobile').css('display', '');
97                    e('.main-navigation .toggle-menu').css('display', '');
98                    e('.aft-dynamic-navigation-elements').removeClass('aft-mobile-navigation');
99                }
100
101            }
102        },
103        menuArrow: function () {
104            if (e('#masthead .main-navigation div.menu > ul').length) {
105                e('#masthead .main-navigation div.menu > ul .sub-menu').parent('li').find('> a').append('<button class="mobile-has-submenu">');
106                e('#masthead .main-navigation div.menu > ul .children').parent('li').find('> a').append('<button class="mobile-has-submenu">');
107            }
108        }
109    },
110
111
112        n.DataBackground = function () {
113            var pageSection = e(".data-bg");
114            pageSection.each(function (indx) {
115                if (e(this).attr("data-background")) {
116                    e(this).css("background-image", "url(" + e(this).data("background") + ")");
117                }
118            });
119
120            e('.bg-image').each(function () {
121                var src = e(this).children('img').attr('src');
122                e(this).css('background-image', 'url(' + src + ')').children('img').hide();
123            });
124        },
125
126        n.setInstaHeight = function () {
127            e('.insta-slider-block').each(function () {
128                var img_width = e(this).find('.insta-item .af-insta-height').eq(0).innerWidth();
129                e(this).find('.insta-item .af-insta-height').css('height', img_width);
130            });
131        },
132
133        n.setHeaderHeight = function () {
134            if (e('#main-navigation-bar').length > 0) {
135                var menuHeight = e('#main-navigation-bar').height();
136                e('.header-menu-part').height(menuHeight);
137            }
138        },
139
140
141        n.Offcanvas = function () {
142            e('.offcanvas-nav').sidr({
143                side: 'left',
144                displace: false,
145            });
146
147            e('.sidr-class-sidr-button-close').on('click',function () {
148                e.sidr('close', 'sidr');
149            });
150        },
151
152        // SHOW/HIDE SCROLL UP //
153        n.show_hide_scroll_top = function () {
154            if (e(window).scrollTop() > e(window).height() / 2) {
155                e("#scroll-up").fadeIn(300);
156            } else {
157                e("#scroll-up").fadeOut(300);
158            }
159        },
160
161        n.scroll_up = function () {
162            e("#scroll-up").on("click", function () {
163                e("html, body").animate({
164                    scrollTop: 0
165                }, 800);
166                return false;
167            });
168        },
169
170
171        n.MagnificPopup = function () {
172
173            e('.gallery').each(function () {
174                e(this).magnificPopup({
175                    delegate: 'a',
176                    type: 'image',
177                    gallery: {
178                        enabled: true
179                    },
180                    zoom: {
181                        enabled: true,
182                        duration: 300,
183                        opener: function (element) {
184                            return element.find('img');
185                        }
186                    }
187                });
188            });
189
190            e('.wp-block-gallery').each(function () {
191                e(this).magnificPopup({
192                    delegate: 'a',
193                    type: 'image',
194                    gallery: {
195                        enabled: true
196                    },
197                    zoom: {
198                        enabled: true,
199                        duration: 300,
200                        opener: function (element) {
201                            return element.find('img');
202                        }
203                    }
204                });
205            });
206        },
207
208
209        n.em_sticky = function () {
210            jQuery('.home #secondary.aft-sticky-sidebar').theiaStickySidebar({
211                additionalMarginTop: 30
212            });
213        },
214
215        n.jQueryMarquee = function () {
216            e('.marquee.aft-flash-slide').marquee({
217                //duration in milliseconds of the marquee
218                speed: 80000,
219                //gap in pixels between the tickers
220                gap: 0,
221                //time in milliseconds before the marquee will start animating
222                delayBeforeStart: 0,
223                //'left' or 'right'
224                // direction: 'right',
225                //true or false - should the marquee be duplicated to show an effect of continues flow
226                duplicated: true,
227                pauseOnHover: true,
228                startVisible: true
229            });
230        },
231
232        n.SwiperSlider = function () {
233
234            var MainBannerCarouselDefault = new Swiper('.banner-carousel-default', {
235                direction: 'horizontal',
236                loop: true,
237                 autoplay: {
238delay: 6000,
239},
240                slidesPerView: 1,
241                
242                spaceBetween: 20,
243                navigation: {
244                    nextEl: '.swiper-button-next',
245                    prevEl: '.swiper-button-prev'
246                }
247            });
248
249            if (jQuery('.banner-carousel-default').length > 0) {
250                $(".banner-carousel-default").on("mouseenter", function () {
251                    MainBannerCarouselDefault.autoplay.stop();
252                }).on("mouseleave", function () {
253                    MainBannerCarouselDefault.autoplay.start();
254                });
255            }
256
257            var MainBannerCarousel = new Swiper('.banner-carousel-slider', {
258                direction: 'horizontal',
259                loop: true,
260                 autoplay: {
261delay: 6000,
262},
263                slidesPerView: 2,
264                
265                spaceBetween: 20,
266                navigation: {
267                    nextEl: '.swiper-button-next',
268                    prevEl: '.swiper-button-prev'
269                },
270                breakpoints: {
271                    1024: {
272                        slidesPerView: 2,
273                    },
274                    768: {
275                        slidesPerView: 2,
276                    },
277                    480: {
278                        slidesPerView: 1,
279                    }
280                }
281            });
282
283            if (jQuery('.banner-carousel-slider').length > 0) {
284                $(".banner-carousel-slider").on("mouseenter", function () {
285                    MainBannerCarousel.autoplay.stop();
286                }).on("mouseleave", function () {
287                    MainBannerCarousel.autoplay.start();
288                });
289            }
290
291            var MainBannerSliderSingle = new Swiper('.banner-main-slider', {
292                direction: 'horizontal',
293                loop: true,
294                 autoplay: {
295delay: 6000,
296},
297                slidesPerView: 1,
298                
299                spaceBetween: 20,
300                navigation: {
301                    nextEl: '.swiper-button-next',
302                    prevEl: '.swiper-button-prev'
303                }
304            });
305
306            if (jQuery('.banner-main-slider').length > 0) {
307                $(".banner-main-slider").on("mouseenter", function () {
308                    MainBannerSliderSingle.autoplay.stop();
309                }).on("mouseleave", function () {
310                    MainBannerSliderSingle.autoplay.start();
311                });
312            }
313
314            var MainBannerCarouselSingle = new Swiper('.banner-single-slider', {
315                direction: 'horizontal',
316                
317                loop: true,
318                 autoplay: {
319delay: 6000,
320},
321                slidesPerView: 1,
322                spaceBetween: 20,
323                navigation: {
324                    nextEl: '.swiper-button-next',
325                    prevEl: '.swiper-button-prev'
326                }
327            });
328
329            if (jQuery('.banner-single-slider').length > 0) {
330                $(".banner-single-slider").on("mouseenter", function () {
331                    MainBannerCarouselSingle.autoplay.stop();
332                }).on("mouseleave", function () {
333                    MainBannerCarouselSingle.autoplay.start();
334                });
335            }
336
337
338            var WidgetContentCarousel = new Swiper('.posts-carousel', {
339                direction: 'horizontal',
340                loop: true,
341                
342                 autoplay: {
343delay: 6000,
344},
345                slidesPerView: 3,
346                spaceBetween: 20,
347                navigation: {
348                    nextEl: '.swiper-button-next',
349                    prevEl: '.swiper-button-prev'
350                },
351                breakpoints: {
352                    1024: {
353                        slidesPerView: 3,
354                    },
355                    768: {
356                        slidesPerView: 2,
357                    },
358                    480: {
359                        slidesPerView: 1,
360                    }
361                }
362            });
363
364            if (jQuery('.posts-carousel').length > 0) {
365                $(".posts-carousel").on("mouseenter", function () {
366                    WidgetContentCarousel.autoplay.stop();
367                }).on("mouseleave", function () {
368                    WidgetContentCarousel.autoplay.start();
369                });
370            }
371
372            var WidgetSidebarCarousel = new Swiper('#secondary .posts-carousel', {
373                direction: 'horizontal',
374                loop: true,
375                 autoplay: {
376delay: 6000,
377},
378                
379                slidesPerView: 1,
380                spaceBetween: 20,
381                navigation: {
382                    nextEl: '.swiper-button-next',
383                    prevEl: '.swiper-button-prev'
384                }
385            });
386            if (jQuery('#secondary .posts-carousel').length > 0) {
387                $("#secondary .posts-carousel").on("mouseenter", function () {
388                    WidgetSidebarCarousel.autoplay.stop();
389                }).on("mouseleave", function () {
390                    WidgetSidebarCarousel.autoplay.start();
391                });
392            }
393
394
395            var WidgetFooterCarousel = new Swiper('.site-footer .posts-carousel', {
396                direction: 'horizontal',
397                loop: true,
398                 autoplay: {
399delay: 6000,
400},
401                slidesPerView: 1,
402                
403                spaceBetween: 20,
404                navigation: {
405                    nextEl: '.swiper-button-next',
406                    prevEl: '.swiper-button-prev'
407                }
408            });
409
410            if (jQuery('.site-footer .posts-carousel').length > 0) {
411                $(".site-footer .posts-carousel").on("mouseenter", function () {
412                    WidgetFooterCarousel.autoplay.stop();
413                }).on("mouseleave", function () {
414                    WidgetFooterCarousel.autoplay.start();
415                });
416            }
417
418            var WidgetSidrCarousel = new Swiper('#sidr .posts-carousel', {
419                direction: 'horizontal',
420                loop: true,
421                 autoplay: {
422delay: 6000,
423},
424                slidesPerView: 1,
425                
426                spaceBetween: 20,
427                navigation: {
428                    nextEl: '.swiper-button-next',
429                    prevEl: '.swiper-button-prev'
430                }
431            });
432
433            if (jQuery('#sidr .posts-carousel').length > 0) {
434                $("#sidr .posts-carousel").hover(function () {
435                    WidgetSidrCarousel.autoplay.stop();
436                }, function () {
437                    WidgetSidrCarousel.autoplay.start();
438                });
439            }
440
441            var InstaCarousel = new Swiper('.instagram-carousel', {
442                direction: 'horizontal',
443                loop: true,
444                 autoplay: {
445delay: 6000,
446},
447                slidesPerView: 6,
448                
449                spaceBetween: 0,
450                navigation: {
451                    nextEl: '.swiper-button-next',
452                    prevEl: '.swiper-button-prev',
453                },
454                breakpoints: {
455                    1024: {
456                        slidesPerView: 4,
457                    },
458                    768: {
459                        slidesPerView: 3,
460                    },
461                    480: {
462                        slidesPerView: 1,
463                    }
464                }
465            });
466
467            if (jQuery('.instagram-carousel').length > 0) {
468                $(".instagram-carousel").on("mouseenter", function () {
469                    InstaCarousel.autoplay.stop();
470                }).on("mouseleave", function () {
471                    InstaCarousel.autoplay.start();
472                });
473            }
474
475            var WidgetSlider = new Swiper('.posts-slider', {
476                direction: 'horizontal',
477                loop: true,
478                 autoplay: {
479delay: 6000,
480},
481                slidesPerView: 1,                
482                spaceBetween: 0,
483                navigation: {
484                    nextEl: '.swiper-button-next',
485                    prevEl: '.swiper-button-prev',
486                }
487            });
488            if (jQuery('.posts-slider').length > 0) {
489                $(".posts-slider").on("mouseenter", function () {
490                    WidgetSlider.autoplay.stop();
491                }).on("mouseleave", function () {
492                    WidgetSlider.autoplay.start();
493                });
494            }
495
496
497            var VerticalSlider = new Swiper('.vertical-slider', {
498                direction: 'vertical',
499                loop: true,
500                slidesPerView: 5,
501                
502                spaceBetween: 10,
503                 autoplay: {
504delay: 6000,
505},
506                breakpoints: {
507                    // when window width is <= 320px
508                    768: {
509                        allowTouchMove: 0,
510
511                    },
512                }
513            });
514
515            if (jQuery('.vertical-slider').length > 0) {
516                $(".vertical-slider").on("mouseenter", function () {
517                    VerticalSlider.autoplay.stop();
518                }).on("mouseleave", function () {
519                    VerticalSlider.autoplay.start();
520                });
521            }
522
523            var VerticalPostsSlider = new Swiper('.trending-posts-vert
523ical', {
524                direction: 'vertical',
525                loop: true,
526                slidesPerView: 5,
527                spaceBetween: 10,
528                 autoplay: {
529delay: 6000,
530},
531                breakpoints: {
532                    // when window width is <= 320px
533                    768: {
534                        allowTouchMove: 0,
535
536                    },
537                }
538            });
539
540            if (jQuery('.trending-posts-vertical').length > 0) {
541                $(".trending-posts-vertical").on("mouseenter", function () {
542                    VerticalPostsSlider.autoplay.stop();
543                }).on("mouseleave", function () {
544                    VerticalPostsSlider.autoplay.start();
545                });
546            }
547
548
549            // Video slider part starts
550
551            var part1 = '<div class=swiper-pagination></div>';
552            $('#swiper-press').append(part1);
553
554
555            /* change active class when click */
556            $(".swiper-container-videos .swiper-wrapper .swiper-slide a").on('click', function () {
557                $(this).closest(".swiper-slide").addClass("selected").siblings().removeClass("selected");
558                YoutubeVideoSlider.slideTo(YoutubeVideoSlider.clickedIndex);
559            });
560
561            $(".swiper-container-videos .swiper-slide").first().addClass("selected");
562
563            var YoutubeVideoSlider = new Swiper(".swiper-container-videos", {
564                // If loop true set photoswipe - counterEl: false
565                loop: false,
566                slidesPerView: 4,
567                spaceBetween: 10,
568                
569                centeredSlides: false,
570                // If we need pagination
571                navigation: {
572                    nextEl: '.swiper-custom-next.swiper-button-next',
573                    prevEl: '.swiper-custom-prev.swiper-button-prev'
574                },
575                keyboard: {
576                    enabled: true,
577                    onlyInViewport: true
578                },
579                breakpoints: {
580                    1024: {
581                        slidesPerView: 4,
582                    },
583                    768: {
584                        slidesPerView: 3,
585                    },
586                    480: {
587                        slidesPerView: 2,
588                    }
589                }
590            });
591
592        },
593        n.MasonryBlog = function () {
594            if (e('.aft-masonry-archive-posts').length > 0) {
595                jQuery('.aft-masonry-archive-posts').masonry();
596            }
597        },
598
599        e(function () {
600            n.mobileMenu.init(), n.DataBackground(), n.setInstaHeight(), n.em_sticky(), n.MagnificPopup(), n.jQueryMarquee(), n.setHeaderHeight(), n.Offcanvas(), n.SwiperSlider(), n.scroll_up();
601        }), e(window).on('scroll', function () {
602        n.show_hide_scroll_top();
603    }), e(window).on('resize', function () {
604        n.mobileMenu.menuMobile();
605    }), e(window).on('load', function () {
606        n.MasonryBlog();
607        e('#loader-wrapper').fadeOut();
608        e('#af-preloader').delay(500).fadeOut('slow');
609        e(".af-search-click").on('click', function () {
610            e("#af-search-wrap").toggleClass("af-search-toggle");
611        });
612        jQuery('.search-overlay .search-icon').on('click', function () {
613            jQuery(this).parent().toggleClass('reveal-search');
614            return false;
615        });
616
617
618    })
619})(jQuery);
620

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.