1(function ($) { 2 "use strict"; 3 $(window).on('elementor/frontend/init', function () { 4 5 elementorFrontend.hooks.addAction('frontend/element_ready/column', function ($scope) { 6 if ($scope.hasClass('animated-slide-column')) { 7 new Waypoint({ 8 element: $scope, offset: '50%', handler: function () { 9 $scope.addClass('col-loaded'); 10 } 11 }); 12 } 13 14 if ($scope.hasClass('animated-bg-parallax')) { 15 var $wrap = $scope.find('>[class*="elementor-column-"]'); 16 var linkImage = $wrap.css('backgroundImage').replace('url(', '').replace(')', '').replace(/\"/gi, ""); 17 if (linkImage === 'none') { 18 return; 19 } 20 $wrap.prepend('<img src="' + linkImage + '" class="img-banner-parallax" alt="banner-parallax"/>') 21 22 $wrap.find('>.img-banner-parallax').panr({ 23 moveTarget: $wrap, 24 sensitivity: 20, 25 scale: false, 26 scaleOnHover: true, 27 scaleTo: 1.1, 28 scaleDuration: .25, 29 panY: true, 30 panX: true, 31 panDuration: 1.25, 32 resetPanOnMouseLeave: true 33 }); 34 } 35 }); 36 elementorFrontend.hooks.addAction('frontend/element_ready/section', function ($scope) { 37 $(window).load(function () { 38 if ($scope.hasClass('animated-bg-parallax')) { 39 var linkImage = $scope.css('backgroundImage').replace('url(', '').replace(')', '').replace(/\"/gi, ""); 40 if (linkImage === 'none') { 41 return; 42 } 43 $scope.prepend('<img src="' + linkImage + '" class="img-banner-parallax" alt="banner-parallax" />') 44 $scope.find('>.img-banner-parallax').panr({ 45 moveTarget: $scope, 46 sensitivity: 20, 47 scale: false, 48 scaleOnHover: true, 49 scaleTo: 1.1, 50 scaleDuration: .25, 51 panY: true, 52 panX: true, 53 panDuration: 1.25, 54 resetPanOnMouseLeave: false 55 }); 56 } 57 58 59 }) 60 }) 61 elementorFrontend.hooks.addAction('frontend/element_ready/container', function ($scope) { 62 if ($scope.hasClass('mostion_image')) { 63 $('.mostion_image').each(function() { 64 $(this).mousemove(function(e){ 65 var imageBox = $(this).find('.elementor-widget-image .elementor-widget-container img'); 66 imageBox.each(function(index) { 67 var mouseX = (e.pageX / 50), 68 mouseY = (e.pageY / 50); 69 70 var arrow = (index % 2 == 0) ? '-' : ''; 71 72 $(this).css({ 73 'transform' : 'translateX(var(--translateX)) translateY(var(--translateY))', 74 '--translateX' : arrow + mouseX + 'px', 75 '--translateY' : arrow + mouseY + 'px', 76 }); 77 }); 78 }); 79 }) 80 } 81 82 if($('.effects-background-deco-yes').length > 0) { 83 $('.effects-background-deco-yes .elementor-icon').each(function() { 84 var icon = $(this); 85 icon.mousemove(function(e){ 86 var heightBox = $(this).outerHeight(), 87 widthBox = $(this).outerWidth() 88 89 var offsetBox = $(this).offset(), 90 offsetTop = offsetBox.top, 91 offsetLeft = offsetBox.left; 92 93 var mouseX = (e.pageX), 94 mouseY = (e.pageY); 95 96 var beforeTop = mouseY - offsetTop, 97 beforeLeft = mouseX - offsetLeft; 98 99 var typeY = '', 100 typeX = ''; 101 102 if(beforeTop < (heightBox / 2)) { 103 var typeY = '-'; 104 } 105 if(beforeLeft < (widthBox / 2)) { 106 var typeX = '-'; 107 } 108 109 icon.css({
110 '--top-before' : typeY + '5%', 111 '--left-before' : typeX + '5%', 112 }); 113 }); 114 }) 115 } 116 }) 117 118 }) 119 120})(jQuery) 121 122 123class priotechSwiperBase extends elementorModules.frontend.handlers.SwiperBase { 124 125 getDefaultSettings() { 126 return { 127 selectors: { 128 carousel: '.priotech-swiper', slideContent: '.swiper-slide' 129 } 130 }; 131 } 132 133 getDefaultElements() { 134 const selectors = this.getSettings('selectors'); 135 const elements = { 136 $swiperContainer: this.$element.find(selectors.carousel) 137 }; 138 elements.$slides = elements.$swiperContainer.find(selectors.slideContent); 139 return elements; 140 } 141 142 getSwiperSettings() { 143 144 const elementSettings = this.getElementSettings(), slidesToShow = +elementSettings.column || 3, 145 isSingleSlide = 1 === slidesToShow, 146 elementorBreakpoints = elementorFrontend.config.responsive.activeBreakpoints, defaultSlidesToShowMap = { 147 mobile: 1, tablet: isSingleSlide ? 1 : 2 148 }; 149 150 // console.log(this.elements.$slides.length); 151 const swiperOptions = { 152 slidesPerView: slidesToShow, 153 loop: 'yes' === elementSettings.infinite, 154 speed: elementSettings.speed, 155 handleElementorBreakpoints: true, 156 watchSlidesProgress: true, 157 watchSlidesVisibility: true, 158 loopedSlides: this.elements.$swiperContainer.data('count'), 159 }; 160 161 if ('true' === this.elements.$swiperContainer.data('center')) { 162 swiperOptions.centeredSlides = true; 163 } 164 165 swiperOptions.breakpoints = {}; 166 let lastBreakpointSlidesToShowValue = slidesToShow; 167 Object.keys(elementorBreakpoints).reverse().forEach(breakpointName => { 168 // Tablet has a specific default `column`. 169 const defaultSlidesToShow = defaultSlidesToShowMap[breakpointName] ? defaultSlidesToShowMap[breakpointName] : lastBreakpointSlidesToShowValue; 170 swiperOptions.breakpoints[elementorBreakpoints[breakpointName].value] = { 171 slidesPerView: +elementSettings['column_' + breakpointName] || defaultSlidesToShow, 172 slidesPerGroup: +elementSettings['column_' + breakpointName] || 1 173 }; 174 lastBreakpointSlidesToShowValue = +elementSettings['column_' + breakpointName] || defaultSlidesToShow; 175 }); 176 177 if ('yes' === elementSettings.autoplay) { 178 swiperOptions.autoplay = { 179 delay: elementSettings.autoplay_speed, 180 disableOnInteraction: 'yes' === elementSettings.pause_on_interaction 181 }; 182 } 183 184 if (isSingleSlide) { 185 swiperOptions.effect = elementSettings.effect; 186 187 if ('fade' === elementSettings.effect) { 188 swiperOptions.fadeEffect = { 189 crossFade: true 190 }; 191 } 192 } else { 193 swiperOptions.slidesPerGroup = +elementSettings.slides_to_scroll || 1; 194 } 195 196 if (elementSettings.column_spacing_swiper) { 197 swiperOptions.spaceBetween = elementSettings.column_spacing_swiper.size; 198 } 199 200 const showArrows = 'arrows' === elementSettings.navigation || 'both' === elementSettings.navigation, 201 showDots = 'dots' === elementSettings.navigation || 'both' === elementSettings.navigation; 202 203 if (showArrows) { 204 if ('yes' === elementSettings.custom_navigation) { 205 swiperOptions.navigation = { 206 prevEl: elementSettings.custom_navigation_previous, nextEl: elementSettings.custom_navigation_next, 207 }; 208 } else { 209 swiperOptions.navigation = { 210 prevEl: '.elementor-swiper-button-prev-' + this.$element.data('id'), 211 nextEl: '.elementor-swiper-button-next-' + this.$element.data('id') 212 }; 213 } 214 } 215 216 if (showDots) { 217 swiperOptions.pagination = { 218 el: '.swiper-pagination-' + this.$element.data('id'), type: 'bullets', clickable: true 219 }; 220 } 221 222 if ('yes' === elementSettings.lazyload) { 223 swiperOptions.lazy = { 224 loadPrevNext: true, loadPrevNextAmount: 1 225 }; 226 } 227 228 return swiperOptions; 229 } 230 231 async onInit() { 232 super.onInit(...arguments); 233 234 if (!this.elements.$swiperContainer.length || 2 > this.elements.$slides.length) { 235 return; 236 } 237 238 239 240 const Swiper = elementorFrontend.utils.swiper; 241 this.swiper = await new Swiper(this.elements.$swiperContainer, this.get
241SwiperSettings()); // Expose the swiper instance in the frontend 242 243 this.elements.$swiperContainer.trigger("swiperInit", [this.swiper]); 244 245 this.elements.$swiperContainer.data('swiper', this.swiper); 246 const elementSettings = this.getElementSettings(); 247 248 if ('yes' === elementSettings.pause_on_hover) { 249 this.togglePauseOnHover(true); 250 } 251 } 252 253 updateSwiperOption(propertyName) { 254 const elementSettings = this.getElementSettings(), newSettingValue = elementSettings[propertyName], 255 params = this.swiper.params; // Handle special cases where the value to update is not the value that the Swiper library accepts. 256 257 switch (propertyName) { 258 case 'column_spacing_swiper': 259 params.spaceBetween = newSettingValue.size || 30; 260 break; 261 262 case 'autoplay_speed': 263 params.autoplay.delay = newSettingValue; 264 break; 265 266 case 'speed': 267 params.speed = newSettingValue; 268 break; 269 } 270 271 this.swiper.update(); 272 } 273 274 getChangeableProperties() { 275 return { 276 pause_on_hover: 'pauseOnHover', 277 autoplay_speed: 'delay', 278 speed: 'speed', 279 column_spacing_swiper: 'spaceBetween' 280 }; 281 } 282 283 onElementChange(propertyName) { 284 const changeableProperties = this.getChangeableProperties(); 285 286 if (changeableProperties[propertyName]) { 287 // 'pause_on_hover' is implemented by the handler with event listeners, not the Swiper library. 288 if ('pause_on_hover' === propertyName) { 289 const newSettingValue = this.getElementSettings('pause_on_hover'); 290 this.togglePauseOnHover('yes' === newSettingValue); 291 } else { 292 this.updateSwiperOption(propertyName); 293 } 294 } 295 } 296 297 onEditSettingsChange(propertyName) { 298 if ('activeItemIndex' === propertyName) { 299 this.swiper.slideToLoop(this.getEditSettings('activeItemIndex') - 1); 300 } 301 } 302}
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.