1( function( $ ) { 2 3 $( window ).on( 'elementor/frontend/init', function() { 4 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_post_carousel.default', function( $scope ) { 5 pxl_swiper_handler($scope); 6 } ); 7 8 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_testimonial_carousel.default', function( $scope ) { 9 pxl_swiper_handler($scope); 10 } ); 11 12 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_team_carousel.default', function( $scope ) { 13 pxl_swiper_handler($scope); 14 } ); 15 16 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_partner_carousel.default', function( $scope ) { 17 pxl_swiper_handler($scope); 18 } ); 19 20 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_image_box_carousel.default', function( $scope ) { 21 pxl_swiper_handler($scope); 22 } ); 23 24 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_service_box.default', function( $scope ) { 25 pxl_swiper_handler($scope); 26 } ); 27 28 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_service_carousel.default', function( $scope ) { 29 pxl_swiper_handler($scope); 30 } ); 31 32 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_icon_box_carousel.default', function( $scope ) { 33 pxl_swiper_handler($scope); 34 } ); 35 36 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_news_carousel.default', function( $scope ) { 37 pxl_swiper_handler($scope); 38 } ); 39 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_service_grid.default', function( $scope ) { 40 pxl_swiper_handler($scope); 41 } ); 42 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_portfolio_carousel.default', function( $scope ) { 43 pxl_swiper_handler($scope); 44 } ); 45 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_slider1.default', function( $scope ) { 46 pxl_swiper_handler($scope); 47 }); 48 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_slider2.default', function( $scope ) { 49 pxl_swiper_handler($scope); 50 }); 51 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_slider3.default', function( $scope ) { 52 pxl_swiper_handler($scope); 53 }); 54 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_slider4.default', function( $scope ) { 55 pxl_swiper_handler($scope); 56 }); 57 } ); 58 59 60 let addClassActiveHover = (element) => { 61 if (element.hasClass('pxl-portfolio-carousel2')) { 62 let slides = element.find('.pxl-swiper-slide'); 63 let slideVisible = element.find('.swiper-slide-visible'); 64 let countSlidesVisible = slideVisible.length; 65 let indexActive = (countSlidesVisible > 1) ? Math.ceil(countSlidesVisible/2) : countSlidesVisible; 66 slides.removeClass('pxl-active-hover') 67 slideVisible.each(function(index) { 68 if((index + 1) === indexActive) { 69 $(this).addClass('pxl-active-hover'); 70 } 71 }) 72 } 73 } 74 75 let swiperFilterChange = (swiper, $this, carousel_settings) => { 76 let filterItems = $this.find('.pxl-swiper-filter .filter-item'); 77 if(filterItems.length <= 0) return; 78
79 let swiperContainer = $this.find(".pxl-swiper-container")[0]; 80 let swiperWrapper = $this.find(".pxl-swiper-wrapper")[0]; 81 let slides = $this.find('.pxl-swiper-slide'); 82 filterItems.each(function (index, item) { 83 $(item).on('click', function () { 84 filterItems.removeClass('active'); 85 $(item).addClass('active'); 86 let target = $(item).attr('data-filter').replace('.',''); 87 $(swiperWrapper).empty(); 88 slides.each(function (index, slide) { 89 if ($(slide).hasClass(target) || target === '*') { 90 let newSlide = $(slide).clone(); 91 $(swiperWrapper).append(newSlide); 92 } 93 }); 94 swiper.destroy(); 95 swiper = new Swiper(swiperContainer, carousel_settings); 96 }) 97 }) 98 } 99 100 101 function pxl_swiper_handler($scope){ 102 if($scope.find('.pxl-swiper-slider.pxl-slider').length) { 103 $scope.find('.pxl-slider').each(function(index, element) { 104 let _this = $(element);
105 let settings = _this.find(".pxl-swiper-container").data().settings; 106 107 let autoPlay = settings['opt_auto_play'] === true ? { delay: settings['delay'], disableOnInteraction: settings['disable_on_interaction'] } : null; 108 let swiperOptions = { 109 loop: settings['opt_loop'], 110 wrapperClass : 'pxl-swiper-wrapper', 111 slideClass: 'pxl-swiper-slide', 112 centeredSlides: true, 113 observer: true, 114 observeParents: true, 115 watchSlidesProgress: true, 116 watchSlidesVisibility: true, 117 grabCursor: true, 118 effect: settings['opt_effect'] ?? 'fade', 119 allowTouchMove: settings['opt_allow_touch_move'], 120 fadeEffect: { 121 crossFade: true, 122 }, 123 speed: settings['opt_speed'], 124 autoplay: autoPlay ? autoPlay : undefined, 125 pagination: { 126 type: 'bullets', 127 el: _this.find('.pxl-swiper-dots')[0] || null, 128 modifierClass: 'pxl-swiper-pagination-', 129 bulletClass : 'pxl-swiper-pagination-bullet', 130 clickable: true, 131 }, 132 navigation: { 133 nextEl: _this.find('.pxl-swiper-arrow-next')[0] || null, 134 prevEl: _this.find('.pxl-swiper-arrow-prev')[0] || null, 135 }, 136 on: { 137 init: function (swiper) { 138 let activeIndex = this.params.loop ? this.activeIndex : this.activeIndex + 1; 139 let paginationDOM = _this.find('.pxl-swiper-dots'); 140 let numberFirst = activeIndex < 10 ? '0' + activeIndex : activeIndex ; 141 let numberTotal = this.params.loop ? (this.slides.length-2) : this.slides.length; 142 numberTotal = numberTotal < 10 ? '0' + numberTotal : numberTotal; 143 if(paginationDOM.length ) { 144 paginationDOM.before(`<div class="pxl-swiper-fraction pxl-swiper-fraction-first">${numberFirst}</div>`) 145 paginationDOM.after(`<div class="pxl-swiper-fraction pxl-swiper-fraction-total">${numberTotal}</div>`) 146 }; 147 }, 148 slideChange: function(swiper) { 149 let activeIndex = this.realIndex + 1; 150 let pagination = _this.find('.pxl-item--index'); 151 if (pagination.length) { 152 pagination.removeClass('active'); 153 pagination.each(function() { 154 const active = $(this).attr('data-index'); 155 if (active == activeIndex) { 156 $(this).addClass('active'); 157 } 158 }); 159 } 160 } 161 } 162 };
163 let swiper = new Swiper(_this.find(".pxl-swiper-container")[0], swiperOptions); 164 }); 165 } 166 if($scope.find('.pxl-swiper-slider:not(.pxl-slider)').length) { 167 $scope.find('.pxl-swiper-slider').each(function(index, element) { 168 var $this = $(this); 169 const thisClass = $this.attr('class') 170 var settings = $this.find(".pxl-swiper-container").data().settings; 171 var closestElementorSection = $this.closest('.elementor-section'); 172 let isSlider = thisClass.includes('pxl-slider') ? true : false; 173 let navButton = false; 174 if(settings['arrow'] == true) { 175 navButton = { 176 nextEl: $this.find('.pxl-swiper-arrow-next')[0], 177 prevEl: $this.find('.pxl-swiper-arrow-prev')[0], 178 }; 179 } 180 if (closestElementorSection.length > 0 && closestElementorSection.find('.pxl-navigation-carousel').length > 0) { 181 let navButtonCopy = closestElementorSection.find('.pxl-navigation-carousel')[0]; 182 navButton = { 183 nextEl: $(navButtonCopy).find('.pxl-arrow--next')[0], 184 prevEl: $(navButtonCopy).find('.pxl-arrow--prev')[0], 185 } 186 } 187 var carousel_settings = { 188 direction: settings['slide_direction'], 189 effect: settings['slide_mode'] ?? 'slide' , 190 wrapperClass : 'pxl-swiper-wrapper', 191 slideClass: 'pxl-swiper-slide', 192 slidesPerView: settings['slides_to_show'], 193 slidesPerGroup: settings['slides_to_scroll'], 194 slidesPerColumn: settings['slide_percolumn'], 195 spaceBetween: 0, 196 observer: true, 197 observeParents: true, 198 initialSlide: 1, 199 navigation: navButton , 200 pagination : { 201 type: settings['pagination_type'], 202 el: $this.find('.pxl-swiper-dots')[0], 203 clickable : true, 204 modifierClass: 'pxl-swiper-pagination-', 205 bulletClass : 'pxl-swiper-pagination-bullet', 206 renderCustom: function (swiper, element, current, total) { 207 return current + ' of ' + total; 208 } 209 }, 210 speed: settings['speed'], 211 watchSlidesProgress: true, 212 watchSlidesVisibility: true, 213 breakpoints: { 214 0 : { 215 slidesPerView: settings['slides_to_show_xs'], 216 slidesPerGroup: settings['slides_to_scroll'], 217 }, 218 576 : { 219 slidesPerView: settings['slides_to_show_sm'], 220 slidesPerGroup: settings['slides_to_scroll'], 221 }, 222 768 : { 223 slidesPerView: settings['slides_to_show_md'], 224 slidesPerGroup: settings['slides_to_scroll'], 225 }, 226 992 : { 227 slidesPerView: settings['slides_to_show_lg'], 228 slidesPerGroup: settings['slides_to_scroll'], 229 }, 230 1200 : { 231 slidesPerView: settings['slides_to_show'], 232 slidesPerGroup: settings['slides_to_scroll'], 233 }, 234 1400 : { 235 slidesPerView: settings['slides_to_show_xxl'], 236 slidesPerGroup: settings['slides_to_scroll'], 237 } 238 }, 239 on: { 240 init: function (swiper) { 241 addClassActiveHover($this) 242 }, 243 244 slideChangeTransitionStart : function (swiper){ 245 var activeIndex = this.activeIndex; 246 $(this.slides).each(function(index){ 247 if(index == activeIndex) 248 $(this).find('.wow').removeClass('pxl-invisible').addClass('animated'); 249 else 250 $(this).find('.wow').removeClass('animated').addClass('pxl-invisible'); 251 }); 252 }, 253 254 slideChange: function (swiper) { 255 addClassActiveHover($this) 256 }, 257 258 slideChangeTransitionEnd : function (swiper) { 259 }, 260 261 sliderMove: function (swiper) { 262 var activeIndex = this.activeIndex; 263 $(this.slides).each(function(index){ 264 if(index == activeIndex) 265 $(this).find('.wow').removeClass('pxl-invisible').addClass('animated'); 266 else 267 $(this).find('.wow').removeClass('animated').addClass('pxl-invisible'); 268 }); 269 270 }, 271 272 273 } 274 }; 275 if(isSlider) { 276 carousel_settings['allowTouchMove'] = settings['opt_allow_touch_move']; 277 } 278 if(settings['center_slide'] || settings['center_slide'] == 'true') 279 carousel_settings['centeredSlides'] = true; 280 281 if(settings['loop'] || settings['loop'] === 'true'){ 282 carousel_settings['loop'] = true; 283 } 284 285 if(settings['autoplay'] || settings['autoplay'] === 'true'){ 286 carousel_settings['autoplay'] = { 287 delay : settings['delay'], 288 disableOnInteraction : settings['pause_on_interaction'] 289 }; 290 } else { 291 carousel_settings['autoplay'] = false;
292 } 293 294 // Start Swiper Thumbnail 295 if($this.find('.pxl-swiper-thumbs').length > 0) { 296 var thumb_settings = $this.find('.pxl-swiper-thumbs').data().settings; 297 var thumb_carousel_settings = { 298 effect: thumb_settings['slide_mode'], 299 direction: thumb_settings['slide_direction'], 300 spaceBetween: 0, 301 slidesPerView: thumb_settings['slides_to_show'], 302 centeredSlides: false, 303 loop: thumb_settings['loop'], 304 watchSlidesProgress: true, 305 slideToClickedSlide: true, 306 }; 307 308 var slide_thumbs = new Swiper($this.find('.pxl-swiper-thumbs')[0], thumb_carousel_settings); 309 carousel_settings['thumbs'] = { swiper: slide_thumbs }; 310 } 311 // End Swiper Thumbnail 312 313 314 var swiper = new Swiper($this.find(".pxl-swi
314per-container")[0], carousel_settings); 315 316 swiperFilterChange(swiper, $this, carousel_settings); 317 318 if(settings['autoplay'] === 'true' && settings['pause_on_hover'] === 'true'){ 319 $( $this.find('.pxl-swiper-container') ).on({ 320 mouseenter: function mouseenter() { 321 this.swiper.autoplay.stop(); 322 }, 323 mouseleave: function mouseleave() { 324 this.swiper.autoplay.start(); 325 } 326 }); 327 } 328 329 }); 330 } 331 }; 332} )( 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.