1// jQuery(window).on('elementor/frontend/init', function () { 2// elementorFrontend.hooks.addAction( 'frontend/element_ready/section', function( $scope ) { 3// if( !jQuery('body').hasClass('elementor-editor-active') ) { 4// if(!$scope.children('.elementor-container').children('.elementor-row').length) { 5// $scope.children('.elementor-container').wrapInner('<div class="elementor-row"></div>'); 6// } 7// } else { 8// if(!$scope.children('.elementor-container').children('.elementor-row').length) { 9// $scope.children('.elementor-container').wrapInner('<div class="elementor-row ui-sortable"></div>'); 10// } 11// } 12// }); 13// elementorFrontend.hooks.addAction('frontend/element_ready/icon.default', function ($scope) { 14// if($scope.hasClass('neuros-icon-decoration-on')) { 15// $scope.find('.elementor-icon-wrapper').wrapInner('<div class="elementor-icon-inner"></div>'); 16// } 17// }); 18// if(typeof elementor !== 'undefined') { 19// elementor.hooks.addAction('panel/open_editor/column', function( panel, model, view ) { 20// var column = view.$el; 21// if(column.parent().hasClass('elementor-container')) { 22// column.siblings('.elementor-row').children().unwrap(); 23// column.parent('.elementor-container').wrapInner('<div class="elementor-row ui-sortable"></div>'); 24// } 25// }); 26// } 27// }); 28 29// Flowmap deformation effect 30function flowmap_deformation() { 31 jQuery('.flowmap-deformation-wrapper').each(function(){ 32 let box = jQuery(this); 33 34 setTimeout(function() {box.addClass('active');}, 300); 35 36 const imgSize = [box.data('bg-width'), box.data('bg-height')]; 37 38 const vertex = ` 39 attribute vec2 uv; 40 attribute vec2 position; 41 varying vec2 vUv; 42 void main() { 43 vUv = uv; 44 gl_Position = vec4(position, 0, 1); 45 } 46 `; 47 const fragment = ` 48 precision highp float; 49 precision highp int; 50 uniform sampler2D tWater; 51 uniform sampler2D tFlow; 52 uniform float uTime; 53 varying vec2 vUv; 54 uniform vec4 res; 55 56 void main() { 57 58 // R and G values are velocity in the x and y direction 59 // B value is the velocity length 60 vec3 flow = texture2D(tFlow, vUv).rgb; 61 62 vec2 uv = .5 * gl_FragCoord.xy / res.xy ; 63 vec2 myUV = (uv - vec2(0.5))*res.zw + vec2(0.5); 64 myUV -= flow.xy * (0.15 * 0.7); 65 66 vec3 tex = texture2D(tWater, myUV).rgb; 67 68 gl_FragColor = vec4(tex.r, tex.g, tex.b, 1.0); 69 } 70 `; 71 { 72 const renderer = new ogl.Renderer({ dpr: 2 }); 73 const gl = renderer.gl; 74 box.append(gl.canvas); 75 76 // Variable inputs to control flowmap 77 let aspect = 1; 78 const mouse = new ogl.Vec2(-1); 79 const velocity = new ogl.Vec2(); 80 function resize() { 81 let a1, a2; 82 var imageAspect = imgSize[1] / imgSize[0]; 83 if (box.outerHeight() / box.outerWidth() < imageAspect) { 84 a1 = 1; 85 a2 = box.outerHeight() / box.outerWidth() / imageAspect; 86 } else { 87 a1 = (box.outerWidth() / box.outerHeight()) * imageAspect; 88 a2 = 1; 89 } 90 mesh.program.uniforms.res.value = new ogl.Vec4( 91 box.outerWidth(), 92 box.outerHeight(), 93 a1, 94 a2 95 ); 96 97 renderer.setSize(box.outerWidth(), box.outerHeight()); 98 aspect = box.outerWidth() / box.outerHeight(); 99 } 100 const flowmap = new ogl.Flowmap(gl, { 101 falloff: 0.6 102 }); 103 // Triangle that includes -1 to 1 range for 'position', and 0 to 1 range for 'uv'. 104 const geometry = new ogl.Geometry(gl, { 105 position: { 106 size: 2, 107 data: new Float32Array([-1, -1, 3, -1, -1, 3]) 108 }, 109 uv: { size: 2, data: new Float32Array([0, 0, 2, 0, 0, 2]) } 110 }); 111 const texture = new ogl.Texture(gl, { 112 minFilter: gl.LINEAR, 113 magFilter: gl.LINEAR 114 }); 115 const img = new Image(); 116 img.onload = () => (texture.image = img); 117 img.crossOrigin = "Anonymous"; 118 img.src = box.data('bg'); 119 120 let a1, a2; 121 var imageAspect = imgSize[1] / imgSize[0]; //0.5573 122 if (box.outerHeight() / box.outerWidth() < imageAspect) { // 0.4146 < 0.5573 123 a1 = 1; 124 a2 = box.outerHeight() / box.outerWidth() / imageAspect; // 0.7439 125 } else { 126 a1 = (box.outerWidth() / box.outerHeight()) * imageAspect; 127 a2 = 1; 128 } 129 130 const program = new ogl.Program(gl, { 131 vertex, 132 fragment, 133 uniforms: { 134 uTime: { value: 0 }, 135 tWater: { value: texture }, 136 res: { 137 value: new ogl.Vec4(box.outerWidth(), box.outerHeight(), a1, a2) 138 }, 139 img: { value: new ogl.Vec2(imgSize[0], imgSize[1]) }, 140 // Note that the uniform is applied without using an object and value property 141 // This is because the class alternates this texture between two render targets 142 // and updates the value property after each render.
143 tFlow: flowmap.uniform 144 } 145 }); 146 const mesh = new ogl.Mesh(gl, { geometry, program }); 147 148 window.addEventListener("resize", resize, false); 149 resize(); 150 151 // Create handlers to get mouse position and velocity 152 const isTouchCapable = "ontouchstart" in window; 153 const section = box.closest('section')[0]; 154 if (isTouchCapable) { 155 section.addEventListener("touchstart", updateMouse, false); 156 section.addEventListener("touchmove", updateMouse, { passive: false }); 157 } else { 158 section.addEventListener("mousemove", updateMouse, false); 159 } 160 let lastTime; 161 const lastMouse = new ogl.Vec2(); 162 function updateMouse(e) { 163 // e.preventDefault(); 164 if (e.changedTouches && e.changedTouches.length) { 165 e.x = e.changedTouches[0].pageX; 166 e.y = e.changedTouches[0].pageY; 167 } 168 if (e.x === undefined) { 169 e.x = e.pageX; 170 e.y = e.pageY; 171 } 172 // Get mouse value in 0 to 1 range, with y flipped 173 mouse.set(e.x / gl.renderer.width, 1.0 - e.y / gl.renderer.height); 174 // Calculate velocity 175 if (!lastTime) { 176 // First frame 177 lastTime = performance.now(); 178 lastMouse.set(e.x, e.y); 179 } 180 181 const deltaX = e.x - lastMouse.x; 182 const deltaY = e.y - lastMouse.y; 183 184 lastMouse.set(e.x, e.y); 185 186 let time = performance.now(); 187 188 // Avoid dividing by 0 189 let delta = Math.max(10.4, time - lastTime); 190 lastTime = time; 191 velocity.x = deltaX / delta; 192 velocity.y = deltaY / delta; 193 // Flag update to prevent hanging velocity values when not moving 194 velocity.needsUpdate = true; 195 } 196 requestAnimationFrame(update); 197 function update(t) { 198 requestAnimationFrame(update); 199 // Reset velocity when mouse not moving 200 if (!velocity.needsUpdate) { 201 mouse.set(-1); 202 velocity.set(0); 203 } 204 velocity.needsUpdate = false; 205 // Update flowmap inputs 206 flowmap.aspect = aspect; 207 flowmap.mouse.copy(mouse); 208 // Ease velocity input, slower when fading out 209 flowmap.velocity.lerp(velocity, velocity.len ? 0.15 : 0.1); 210 flowmap.update(); 211 program.uniforms.uTime.value = t * 0.01; 212 renderer.render({ scene: mesh }); 213 } 214 } 215 }); 216} 217 218jQuery(window).on('elementor/frontend/init', function () { 219 elementorFrontend.hooks.addAction('frontend/element_ready/icon.default', function ($scope) { 220 if( $scope.hasClass('neuros-icon-decoration-on') ) { 221 $scope.find('.elementor-icon-wrapper').wrapInner('<div class="elementor-icon-inner"></div>'); 222 } 223 if( $scope.find('.elementor-icon').hasClass('elementor-animation-slide-horizontal') ) { 224 $scope.find('.elementor-icon i, .elementor-icon svg').clone().appendTo($scope.find('.elementor-icon')); 225 } 226 }); 227 elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $scope ) { 228 if( jQuery('body').hasClass('elementor-editor-active') ) { 229 if($scope.hasClass('elementor-section') && !$scope.children('.elementor-container').children('.elementor-row').length) { 230 $scope.children('.elementor-container').wrapInner('<div class="elementor-row ui-sortable"></div>'); 231 } else if($scope.hasClass('elementor-column') && !$scope.parent('.elementor-row').length) { 232 $scope.siblings('.elementor-row').children().unwrap(); 233 $scope.parent('.elementor-container').wrapInner('<div class="elementor-row ui-sortable"></div>'); 234 } 235 } 236 } ); 237 elementorFrontend.hooks.addAction( 'frontend/element_ready/section', function( $scope ) { 238 if( !jQuery('body').hasClass('elementor-editor-active') ) { 239 if(!$scope.children('.elementor-container').children('.elementor-row').length) { 240 $scope.children('.elementor-container').wrapInner('<div class="elementor-row"></div>'); 241 if($scope.data('parallax') == 'scroll') { 242 background_image_parallax($scope, 0.7); 243 } 244 } else { 245 if($scope.data('parallax') == 'scroll') { 246 background_image_parallax($scope, 0.7); 247 } 248 } 249 if ( $scope.hasClass('elementor-section-scroll-animation-on') ) { 250 jQuery('.body-container').css('overflow', 'clip'); 251 $scope.css({ 252 position: 'sticky', 253 top: jQuery('.sticky-header').length > 0 ? '140px' : '0px' 254 }); 255 $scope.closest('.elementor-widget-wrap').height(1.2 * $scope.height()); 256 jQuery(window).on('resize', function() { 257 $scope.closest('.elementor-widget-wrap').height(1.2 * $scope.height()); 258 }); 259 const { ScrollObserver, valueAtPercentage } = aat; 260 $scope.each(function(index) { 261 ScrollObserver.Element(jQuery(this)[0], { 262 offsetTop: jQuery('.sticky-header').length > 0 ? 140 : 0, 263 offsetBottom: 0 264 }).onScroll(({ percentageY }) => { 265 const clipPath = `inset(${valueAtPercentage({ 266 from: 350, 267 to: 0, 268 percentage: percentageY 269 })}px round ${jQuery(this).css('border-radius')})`; 270 jQuery(this).css('will-change', 'clip-path'); 271 jQuery(this).css('clip-path', clipPath); 272 }); 273 }); 274 } 275 } 276 if ( !jQuery('body').hasClass('elementor-editor-active') && $scope.hasClass('sticky-container-on')) { 277 var $sticky_container = $scope.clone(true, true).insertAfter($scope); 278 $sticky_container.find('.elementor-container').each(function() { 279 if(!jQuery(this).children('.elementor-row').length) { 280 jQuery(this).wrapInner('<div class="elementor-row"></div>'); 281 } 282 }); 283 $sticky_container.removeClass('sticky-container-on').addClass('sticky-container'); 284 jQuery('.slide-sidebar-wrapper', $sticky_container).remove(); 285 jQuery('.site-search', $sticky_container).remove(); 286 jQuery('.mobile-header-menu-container', $sticky_container).remove();
287 jQuery('.alter-menu-wrapper', $sticky_container).remove(); 288 sticky_container_active(true); 289 menu_text_animate($sticky_container); 290 } 291 if ( $scope.data('flowmap') === 'on' && $scope.data('flowmap-url') !== '') { 292 $scope.prepend('<div class="flowmap-deformation-wrapper"></div>'); 293 $scope.find('.flowmap-deformation-wrapper').attr({ 294 'data-bg': $scope.data('flowmap-url'), 295 'data-bg-width': $scope.data('flowmap-width'), 296 'data-bg-height': $scope.data('flowmap-height') 297 }); 298 $scope.find('.flowmap-deformation-wrapper').css('background-image', 'url(' + $scope.data('flowmap-url') + ')'); 299 // Flowmap Effect 300 $scope.one('mouseover', flowmap_deformation); 301 } 302 }); 303});
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.