https://fetedesjardins.com/wp-content/themes/exhibz/core/parallax/assets/js/widget-init.js?ver=2.5.1
1(function ($, elementor) { 2 "use strict"; 3 4 5 var ElementskitLite = { 6 init: function () { 7 elementor.hooks.addAction('frontend/element_ready/global', function($scope){ 8 new EkitStickyHandler({ $element: $scope }); 9 }); 10 } 11 }; 12 $(window).on('elementor/frontend/init', ElementskitLite.init); 13 14 var CompareVersion = function (v1, v2) { 15 if (typeof v1 !== 'string') return false; 16 if (typeof v2 !== 'string') return false; 17 v1 = v1.split('.'); 18 v2 = v2.split('.'); 19 const k = Math.min(v1.length, v2.length); 20 for (let i = 0; i < k; ++ i) { 21 v1[i] = parseInt(v1[i], 10); 22 v2[i] = parseInt(v2[i], 10); 23 if (v1[i] > v2[i]) return 1; 24 if (v1[i] < v2[i]) return -1; 25 } 26 return v1.length == v2.length ? 0: (v1.length < v2.length ? -1 : 1); 27 } 28 29 30 var ElementsKitModule = (typeof window.elementorFrontend.version !== 'undefined' && CompareVersion(window.elementorFrontend.version, '2.6.0' ) < 0) 31 ? elementorFrontend.Module 32 : elementorModules.frontend.handlers.Base; 33 34 var EkitStickyHandler = ElementsKitModule.extend({ 35 36 isTrue: function isTrue(key, val){ 37 if(this.getElementSettings(key) != false && this.getElementSettings(key) == val){ 38 return true; 39 } 40 return false; 41 }, 42 43 shouldRun: function shouldRun(val){ 44 var $should_run = false; 45 46 if(this.isTrue('ekit_we_effect_on', val)){ 47 $should_run = true; 48 } 49 50 if(Boolean(elementor.isEditMode()) && this.isTrue('ekit_we_on_test_mode', 'yes')){ 51 $should_run = false; 52 } 53 54 return $should_run; 55 }, 56 57 active: function active() { 58 if(this.shouldRun('tilt')){ 59 this.tilt(); 60 } 61 if(this.shouldRun('mousemove')){ 62 this.mousemove(); 63 } 64 if(this.shouldRun('onscroll')){ 65 this.onscroll(); 66 } 67 }, 68 69 deactivate: function deactivate(forceUnbind) { 70 if(forceUnbind || !this.getElementSettings('ekit_we_effect_on') || this.getElementSettings('ekit_we_effect_on') != 'tilt' || this.isTrue('ekit_we_on_test_mode', 'yes')){ 71 this.$element.find('.elementor-widget-container').tilt().tilt.destroy.call(this.$element.find('.elementor-widget-container')); 72 } 73 if(forceUnbind || !this.getElementSettings('ekit_we_effect_on') || this.getElementSettings('ekit_we_effect_on') != 'mousemove' || this.isTrue('ekit_we_on_test_mode', 'yes')){ 74 this.$element.parents('.elementor-section').first().off('mousemove.elementskitwidgethovereffect'); 75 } 76 if(forceUnbind || !this.getElementSettings('ekit_we_effect_on') || this.getElementSettings('ekit_we_effect_on') != 'onscroll' || this.isTrue('ekit_we_on_test_mode', 'yes')){ 77 $(window).off('scroll.magicianscrolleffect' + this.getID()); 78 } 79 }, 80 81 onElementChange: function onElementChange(settingKey) { 82 if(settingKey.includes('ekit_we_')){ 83 if(settingKey.includes('_on')){ 84 this.deactivate(false); 85 } 86 if(settingKey.includes('we_scroll_')){ 87 this.deactivate(true); 88 } 89 this.active(); 90 } 91 }, 92 93 onInit: function onInit() { 94 ElementsKitModule.prototype.onInit.apply(this, arguments); 95 this.active(); 96 }, 97 98 onDestroy: function onDestroy() { 99 ElementsKitModule.prototype.onDestroy.apply(this, arguments); 100 this.deactivate(true); 101 }, 102 103 104 // animation 105 tilt: function tilt(){ 106 var content = this.$element.find('.elementor-widget-container');; 107 content.tilt({ 108 disableAxis: this.getElementSettings('ekit_we_tilt_disableaxis'), 109 scale: this.getElementSettings('ekit_we_tilt_scale'), 110 speed: this.getElementSettings('ekit_we_tilt_parallax_speed'), 111 maxTilt: this.getElementSettings('ekit_we_tilt_maxtilt'), 112 glare: true, 113 maxGlare: .5 114 }); 115 }, 116 117 mousemove: function mousemove(){ 118 var content = this.$element.find('.elementor-widget-container'); 119 var container = this.$element.parents('.elementor-section').first(); 120 var speed = this.getElementSettings('ekit_we_mousemove_parallax_speed'); 121 container.on('mousemove.elementskitwidgethovereffect', function (e) { 122 var relX = e.pageX - container.offset().left; 123 var relY = e.pageY - container.offset().top; 124 125 TweenMax.to(content, 1, { 126 x: (relX - container.width() / 2) / container.width() * (speed), 127 y: (relY - container.height() / 2) / container.height() * (speed), 128 ease: Power2.ease 129 }); 130 }); 131 }, 132 133 onscroll: function onscroll(){ 134 var content = this.$element.find('.elementor-widget-container'); 135 136 content.magician({ 137 type: 'scroll', 138 uniqueKey: this.getID(), 139 offsetTop: parseInt(this.getElementSettings('ekit_we_scroll_offsettop')), 140 offsetBottom: parseInt(this.getElementSettings('ekit_we_scroll_offsetbottom')), 141 duration: parseInt(this.getElementSettings('ekit_we_scroll_smoothness')), 142 animation: { 143 [this.getElementSettings('ekit_we_scroll_animation')]: this.getElementSettings('ekit_we_scroll_animation_value') 144 } 145 }); 146 } 147 }); 148}(jQuery, window.elementorFrontend));
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.