first commit
This commit is contained in:
@@ -0,0 +1,261 @@
|
||||
// Flowmap deformation effect
|
||||
function flowmap_deformation() {
|
||||
jQuery('.flowmap-deformation-wrapper').each(function(){
|
||||
let box = jQuery(this);
|
||||
|
||||
setTimeout(function() {box.addClass('active');}, 300);
|
||||
|
||||
const imgSize = [box.data('bg-width'), box.data('bg-height')];
|
||||
|
||||
const vertex = `
|
||||
attribute vec2 uv;
|
||||
attribute vec2 position;
|
||||
varying vec2 vUv;
|
||||
void main() {
|
||||
vUv = uv;
|
||||
gl_Position = vec4(position, 0, 1);
|
||||
}
|
||||
`;
|
||||
const fragment = `
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
uniform sampler2D tWater;
|
||||
uniform sampler2D tFlow;
|
||||
uniform float uTime;
|
||||
varying vec2 vUv;
|
||||
uniform vec4 res;
|
||||
|
||||
void main() {
|
||||
|
||||
// R and G values are velocity in the x and y direction
|
||||
// B value is the velocity length
|
||||
vec3 flow = texture2D(tFlow, vUv).rgb;
|
||||
|
||||
vec2 uv = .5 * gl_FragCoord.xy / res.xy ;
|
||||
vec2 myUV = (uv - vec2(0.5))*res.zw + vec2(0.5);
|
||||
myUV -= flow.xy * (0.15 * 0.7);
|
||||
|
||||
vec3 tex = texture2D(tWater, myUV).rgb;
|
||||
|
||||
gl_FragColor = vec4(tex.r, tex.g, tex.b, 1.0);
|
||||
}
|
||||
`;
|
||||
{
|
||||
const renderer = new ogl.Renderer({ dpr: 2 });
|
||||
const gl = renderer.gl;
|
||||
box.append(gl.canvas);
|
||||
|
||||
// Variable inputs to control flowmap
|
||||
let aspect = 1;
|
||||
const mouse = new ogl.Vec2(-1);
|
||||
const velocity = new ogl.Vec2();
|
||||
function resize() {
|
||||
let a1, a2;
|
||||
var imageAspect = imgSize[1] / imgSize[0];
|
||||
if (box.outerHeight() / box.outerWidth() < imageAspect) {
|
||||
a1 = 1;
|
||||
a2 = box.outerHeight() / box.outerWidth() / imageAspect;
|
||||
} else {
|
||||
a1 = (box.outerWidth() / box.outerHeight()) * imageAspect;
|
||||
a2 = 1;
|
||||
}
|
||||
mesh.program.uniforms.res.value = new ogl.Vec4(
|
||||
box.outerWidth(),
|
||||
box.outerHeight(),
|
||||
a1,
|
||||
a2
|
||||
);
|
||||
|
||||
renderer.setSize(box.outerWidth(), box.outerHeight());
|
||||
aspect = box.outerWidth() / box.outerHeight();
|
||||
}
|
||||
const flowmap = new ogl.Flowmap(gl, {
|
||||
falloff: 0.6
|
||||
});
|
||||
// Triangle that includes -1 to 1 range for 'position', and 0 to 1 range for 'uv'.
|
||||
const geometry = new ogl.Geometry(gl, {
|
||||
position: {
|
||||
size: 2,
|
||||
data: new Float32Array([-1, -1, 3, -1, -1, 3])
|
||||
},
|
||||
uv: { size: 2, data: new Float32Array([0, 0, 2, 0, 0, 2]) }
|
||||
});
|
||||
const texture = new ogl.Texture(gl, {
|
||||
minFilter: gl.LINEAR,
|
||||
magFilter: gl.LINEAR
|
||||
});
|
||||
const img = new Image();
|
||||
img.onload = () => (texture.image = img);
|
||||
img.crossOrigin = "Anonymous";
|
||||
img.src = box.data('bg');
|
||||
|
||||
let a1, a2;
|
||||
var imageAspect = imgSize[1] / imgSize[0]; //0.5573
|
||||
if (box.outerHeight() / box.outerWidth() < imageAspect) { // 0.4146 < 0.5573
|
||||
a1 = 1;
|
||||
a2 = box.outerHeight() / box.outerWidth() / imageAspect; // 0.7439
|
||||
} else {
|
||||
a1 = (box.outerWidth() / box.outerHeight()) * imageAspect;
|
||||
a2 = 1;
|
||||
}
|
||||
|
||||
const program = new ogl.Program(gl, {
|
||||
vertex,
|
||||
fragment,
|
||||
uniforms: {
|
||||
uTime: { value: 0 },
|
||||
tWater: { value: texture },
|
||||
res: {
|
||||
value: new ogl.Vec4(box.outerWidth(), box.outerHeight(), a1, a2)
|
||||
},
|
||||
img: { value: new ogl.Vec2(imgSize[0], imgSize[1]) },
|
||||
// Note that the uniform is applied without using an object and value property
|
||||
// This is because the class alternates this texture between two render targets
|
||||
// and updates the value property after each render.
|
||||
tFlow: flowmap.uniform
|
||||
}
|
||||
});
|
||||
const mesh = new ogl.Mesh(gl, { geometry, program });
|
||||
|
||||
window.addEventListener("resize", resize, false);
|
||||
resize();
|
||||
|
||||
// Create handlers to get mouse position and velocity
|
||||
const isTouchCapable = "ontouchstart" in window;
|
||||
const section = box.closest('section')[0];
|
||||
if (isTouchCapable) {
|
||||
section.addEventListener("touchstart", updateMouse, false);
|
||||
section.addEventListener("touchmove", updateMouse, { passive: false });
|
||||
} else {
|
||||
section.addEventListener("mousemove", updateMouse, false);
|
||||
}
|
||||
let lastTime;
|
||||
const lastMouse = new ogl.Vec2();
|
||||
function updateMouse(e) {
|
||||
// e.preventDefault();
|
||||
if (e.changedTouches && e.changedTouches.length) {
|
||||
e.x = e.changedTouches[0].pageX;
|
||||
e.y = e.changedTouches[0].pageY;
|
||||
}
|
||||
if (e.x === undefined) {
|
||||
e.x = e.pageX;
|
||||
e.y = e.pageY;
|
||||
}
|
||||
// Get mouse value in 0 to 1 range, with y flipped
|
||||
mouse.set(e.x / gl.renderer.width, 1.0 - e.y / gl.renderer.height);
|
||||
// Calculate velocity
|
||||
if (!lastTime) {
|
||||
// First frame
|
||||
lastTime = performance.now();
|
||||
lastMouse.set(e.x, e.y);
|
||||
}
|
||||
|
||||
const deltaX = e.x - lastMouse.x;
|
||||
const deltaY = e.y - lastMouse.y;
|
||||
|
||||
lastMouse.set(e.x, e.y);
|
||||
|
||||
let time = performance.now();
|
||||
|
||||
// Avoid dividing by 0
|
||||
let delta = Math.max(10.4, time - lastTime);
|
||||
lastTime = time;
|
||||
velocity.x = deltaX / delta;
|
||||
velocity.y = deltaY / delta;
|
||||
// Flag update to prevent hanging velocity values when not moving
|
||||
velocity.needsUpdate = true;
|
||||
}
|
||||
requestAnimationFrame(update);
|
||||
function update(t) {
|
||||
requestAnimationFrame(update);
|
||||
// Reset velocity when mouse not moving
|
||||
if (!velocity.needsUpdate) {
|
||||
mouse.set(-1);
|
||||
velocity.set(0);
|
||||
}
|
||||
velocity.needsUpdate = false;
|
||||
// Update flowmap inputs
|
||||
flowmap.aspect = aspect;
|
||||
flowmap.mouse.copy(mouse);
|
||||
// Ease velocity input, slower when fading out
|
||||
flowmap.velocity.lerp(velocity, velocity.len ? 0.15 : 0.1);
|
||||
flowmap.update();
|
||||
program.uniforms.uTime.value = t * 0.01;
|
||||
renderer.render({ scene: mesh });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(window).on('elementor/frontend/init', function () {
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/icon.default', function ($scope) {
|
||||
if( $scope.hasClass('aiero-icon-decoration-on') ) {
|
||||
$scope.find('.elementor-icon-wrapper').wrapInner('<div class="elementor-icon-inner"></div>');
|
||||
}
|
||||
if( $scope.find('.elementor-icon').hasClass('elementor-animation-slide-aslant') ) {
|
||||
$scope.find('.elementor-icon i, .elementor-icon svg').clone().appendTo($scope.find('.elementor-icon'));
|
||||
$scope.find('.elementor-animation-slide-aslant').wrapInner('<span class="elementor-icon-slide-aslant-inner"></span>');
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $scope ) {
|
||||
if( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
if($scope.hasClass('elementor-section') && !$scope.children('.elementor-container').children('.elementor-row').length) {
|
||||
$scope.children('.elementor-container').wrapInner('<div class="elementor-row ui-sortable"></div>');
|
||||
} else if($scope.hasClass('elementor-column') && !$scope.parent('.elementor-row').length) {
|
||||
$scope.siblings('.elementor-row').children().unwrap();
|
||||
$scope.parent('.elementor-container').wrapInner('<div class="elementor-row ui-sortable"></div>');
|
||||
}
|
||||
}
|
||||
} );
|
||||
elementorFrontend.hooks.addAction( 'frontend/element_ready/section', function( $scope ) {
|
||||
if( !jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
if(!$scope.children('.elementor-container').children('.elementor-row').length) {
|
||||
$scope.children('.elementor-container').wrapInner('<div class="elementor-row"></div>');
|
||||
if($scope.data('parallax') == 'scroll') {
|
||||
background_image_parallax($scope, 0.7);
|
||||
}
|
||||
} else {
|
||||
if($scope.data('parallax') == 'scroll') {
|
||||
background_image_parallax($scope, 0.7);
|
||||
}
|
||||
}
|
||||
if ( $scope.hasClass('elementor-section-scroll-animation-on') ) {
|
||||
jQuery('.body-container').css('overflow', 'visible');
|
||||
$scope.css({
|
||||
position: 'sticky',
|
||||
top: jQuery('.sticky-header').length > 0 ? '140px' : '0px'
|
||||
});
|
||||
$scope.closest('.elementor-widget-wrap').height(1.2 * $scope.height());
|
||||
jQuery(window).on('resize', function() {
|
||||
$scope.closest('.elementor-widget-wrap').height(1.2 * $scope.height());
|
||||
});
|
||||
const { ScrollObserver, valueAtPercentage } = aat;
|
||||
$scope.each(function(index) {
|
||||
ScrollObserver.Element(jQuery(this)[0], {
|
||||
offsetTop: jQuery('.sticky-header').length > 0 ? 140 : 0,
|
||||
offsetBottom: 0
|
||||
}).onScroll(({ percentageY }) => {
|
||||
const clipPath = `inset(${valueAtPercentage({
|
||||
from: 350,
|
||||
to: 0,
|
||||
percentage: percentageY
|
||||
})}px round ${jQuery(this).css('border-radius')})`;
|
||||
jQuery(this).css('will-change', 'clip-path');
|
||||
jQuery(this).css('clip-path', clipPath);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if ( $scope.data('flowmap') === 'on' && $scope.data('flowmap-url') !== '') {
|
||||
$scope.prepend('<div class="flowmap-deformation-wrapper"></div>');
|
||||
$scope.find('.flowmap-deformation-wrapper').attr({
|
||||
'data-bg': $scope.data('flowmap-url'),
|
||||
'data-bg-width': $scope.data('flowmap-width'),
|
||||
'data-bg-height': $scope.data('flowmap-height')
|
||||
});
|
||||
$scope.find('.flowmap-deformation-wrapper').css('background-image', 'url(' + $scope.data('flowmap-url') + ')');
|
||||
// Flowmap Effect
|
||||
$scope.one('mouseover', flowmap_deformation);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,589 @@
|
||||
'use strict';
|
||||
|
||||
function animateHeading($scope) {
|
||||
if( $scope.data('settings') && $scope.data('settings')._animation && $scope.data('settings')._animation == 'aiero_heading_animation') {
|
||||
$scope.find('.aiero-heading-content').html($scope.find('.aiero-heading-content').html().replace(/(^|<\/?[^>]+>|\s+)([^\s<]+)/g, '$1<span class="word">$2</span>'));
|
||||
// $scope.find('.aiero-heading-content').contents().each(function() {
|
||||
// if(this.nodeType === 3) {
|
||||
// jQuery(this).wrap('<span></span>');
|
||||
// }
|
||||
// });
|
||||
$scope.find('.aiero-heading-content .word').contents().each(function() {
|
||||
if(this.nodeType === 3) {
|
||||
jQuery(this).parent().html(jQuery(this).text().replace(/\S/g, '<span class="letter">$&</span>'));
|
||||
}
|
||||
});
|
||||
$scope.find('.aiero-heading-content .letter').each(function(index) {
|
||||
jQuery(this).css('animation-delay', index / 50 + 's');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initModernProjects($el) {
|
||||
$el.find('.project-modern-listing .project-item-wrapper').first().addClass('active');
|
||||
$el.find('.project-modern-listing .project-item-modern-header').on('click', function() {
|
||||
var $projectItem = jQuery(this).closest('.project-item-wrapper');
|
||||
$projectItem.addClass('active');
|
||||
$projectItem.find('.project-item-modern-content').slideDown(400);
|
||||
$projectItem.siblings().removeClass('active');
|
||||
$projectItem.siblings().find('.project-item-modern-content').slideUp(400);
|
||||
});
|
||||
}
|
||||
|
||||
function playProjectsSliderAudio($el) {
|
||||
$el.find('.project-listing-wrapper.project-slider-listing.content-type-audio').on('click', '.play-audio', function() {
|
||||
jQuery(this).closest('.owl-item').siblings().find('.project-audio-wrapper audio').each(function() {
|
||||
jQuery(this)[0].pause();
|
||||
jQuery(this)[0].currentTime = 0;
|
||||
jQuery(this).siblings('.play-audio').removeClass('active');
|
||||
});
|
||||
var audioElement = jQuery(this).siblings('audio')[0];
|
||||
if(audioElement.paused) {
|
||||
jQuery(this).addClass('active');
|
||||
audioElement.play();
|
||||
} else {
|
||||
audioElement.pause();
|
||||
audioElement.currentTime = 0;
|
||||
jQuery(this).removeClass('active');
|
||||
}
|
||||
var $this = jQuery(this);
|
||||
audioElement.addEventListener('ended', function() {
|
||||
$this.removeClass('active');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function playListingAudio($el) {
|
||||
$el.find('.aiero-audio-listing').on('click', '.audio-item', function() {
|
||||
jQuery(this).closest('.audio-item-wrapper').siblings().find('.audio-item').each(function() {
|
||||
jQuery(this).removeClass('active');
|
||||
jQuery(this).find('audio')[0].pause();
|
||||
jQuery(this).find('audio')[0].currentTime = 0;
|
||||
});
|
||||
var audioElement = jQuery(this).find('audio')[0];
|
||||
if(audioElement.paused) {
|
||||
jQuery(this).addClass('active');
|
||||
audioElement.play();
|
||||
} else {
|
||||
audioElement.pause();
|
||||
audioElement.currentTime = 0;
|
||||
jQuery(this).removeClass('active');
|
||||
}
|
||||
var $this = jQuery(this);
|
||||
audioElement.addEventListener('ended', function() {
|
||||
$this.removeClass('active');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function handleProjectsExcerptHeight() {
|
||||
jQuery('.project-listing-wrapper.project-slider-listing:not(.content-type-audio) .project-item').each(function() {
|
||||
const item = jQuery(this);
|
||||
const excerpt = jQuery(this).find('.post-excerpt-wrapper');
|
||||
excerpt.hide();
|
||||
item.on('mouseenter', function() {
|
||||
excerpt.delay(300).slideDown(300);
|
||||
});
|
||||
item.on('mouseleave', function() {
|
||||
excerpt.slideUp(300);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function handleProjectsGridExcerptHeight($scope) {
|
||||
if(!$scope.find('.project-grid-listing').hasClass('text-position-inside')) {
|
||||
return;
|
||||
}
|
||||
$scope.find('.project-item').each(function() {
|
||||
const item = jQuery(this);
|
||||
const excerpt = jQuery(this).find('.project-item-content');
|
||||
excerpt.hide();
|
||||
item.on('mouseenter', function() {
|
||||
excerpt.delay(100).slideDown(300);
|
||||
});
|
||||
item.on('mouseleave', function() {
|
||||
excerpt.slideUp(300);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initCardsProjects($scope) {
|
||||
jQuery('.body-container').css({
|
||||
overflow: 'visible'
|
||||
});
|
||||
const { ScrollObserver, valueAtPercentage } = aat;
|
||||
const cardsContainer = $scope.find('.project-cards-listing');
|
||||
const cards = $scope.find('.project-cards-listing .project-item-wrapper');
|
||||
cards.each(function(index) {
|
||||
if (index === cards.length - 1) {
|
||||
return;
|
||||
}
|
||||
const card = jQuery(this);
|
||||
const toScale = 1 - (cards.length - 1 - index) * 0.05;
|
||||
const nextCard = cards[index + 1];
|
||||
const cardInner = card.find('.project-item');
|
||||
ScrollObserver.Element(nextCard, {
|
||||
offsetTop: 0,
|
||||
offsetBottom: window.innerHeight - card.height()
|
||||
}).onScroll(({ percentageY }) => {
|
||||
const scale = valueAtPercentage({
|
||||
from: 1,
|
||||
to: toScale,
|
||||
percentage: percentageY
|
||||
});
|
||||
cardInner.css('scale', scale);
|
||||
const filter = `brightness(${valueAtPercentage({
|
||||
from: 1,
|
||||
to: 0.6,
|
||||
percentage: percentageY
|
||||
})})`;
|
||||
cardInner.css('filter', filter);
|
||||
// jQuery(nextCard).css('padding-top', ((index + 1) * 20) + 'px');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initMovingList($scope) {
|
||||
gsap.defaults({overwrite: "auto"});
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
gsap.config({nullTargetWarn: false});
|
||||
$scope.find('.aiero-moving-list-widget').each(function(index) {
|
||||
const movingList = jQuery(this).find('.moving-list');
|
||||
// Calculate the x and xEnd values and divide them by 2
|
||||
const [x, xEnd] = (index % 2) ?
|
||||
[(jQuery(this)[0].offsetWidth - movingList[0].scrollWidth) / 3, 5 / 2] :
|
||||
[5 / 2, (jQuery(this)[0].offsetWidth - movingList[0].scrollWidth) / 3];
|
||||
gsap.fromTo(movingList[0], { x }, {
|
||||
x: xEnd,
|
||||
scrollTrigger: {
|
||||
trigger: jQuery(this)[0],
|
||||
scrub: 0.5, // Adjust this value to control the speed
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initServicesButton($scope) {
|
||||
const items = $scope.find('.service-item');
|
||||
items.each(function() {
|
||||
const item = jQuery(this);
|
||||
item.on('mouseenter', function() {
|
||||
item.find('.button-container').slideDown(300);
|
||||
});
|
||||
item.on('mouseleave', function() {
|
||||
item.find('.button-container').slideUp(300);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initParallaxButton($scope) {
|
||||
let adv_button_wrapper = $scope.find('.aiero_adv_button_wrapper');
|
||||
|
||||
adv_button_wrapper.mouseleave(function(e){
|
||||
TweenMax.to(this, 0.6, {scale: 1});
|
||||
TweenMax.to(adv_button_wrapper.find('.aiero_adv_button'), 0.6,{scale:1, x: 0, y: 0});
|
||||
TweenMax.to(adv_button_wrapper.find('.aiero_adv_button_circle'), 0.6,{scale:1, x: 0, y: 0, delay: 0.1});
|
||||
TweenMax.to(adv_button_wrapper.find('.aiero_adv_button_text'), 0.6,{scale:1, x: 0, y: 0});
|
||||
});
|
||||
|
||||
adv_button_wrapper.mouseenter(function(e){
|
||||
TweenMax.to(this, 0.6, {transformOrigin: '0 0', scale: 1});
|
||||
TweenMax.to(adv_button_wrapper.find('.aiero_adv_button'), 0.6,{scale: 1});
|
||||
TweenMax.to(adv_button_wrapper.find('.aiero_adv_button_circle'), 0.6,{scale: 1});
|
||||
TweenMax.to(adv_button_wrapper.find('.aiero_adv_button_text'), 0.6,{scale: 1});
|
||||
});
|
||||
|
||||
adv_button_wrapper.mousemove(function(e){
|
||||
callParallax(e);
|
||||
});
|
||||
|
||||
function callParallax(e){
|
||||
parallaxIt(e, '.aiero_adv_button', 40);
|
||||
parallaxIt2(e, '.aiero_adv_button_circle', 40);
|
||||
parallaxIt(e, '.aiero_adv_button_text', 10);
|
||||
}
|
||||
|
||||
function parallaxIt(e, target, movement){
|
||||
var boundingRect = adv_button_wrapper[0].getBoundingClientRect();
|
||||
var relX = e.pageX - boundingRect.left;
|
||||
var relY = e.pageY - boundingRect.top;
|
||||
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
var targetEl = adv_button_wrapper.find(target);
|
||||
|
||||
TweenMax.to(targetEl, 0.5, {
|
||||
x: (relX - boundingRect.width/2) / boundingRect.width * movement,
|
||||
y: (relY - boundingRect.height/2 - scrollTop) / boundingRect.width * movement,
|
||||
ease: Power3.easeOut
|
||||
});
|
||||
}
|
||||
|
||||
function parallaxIt2(e, target, movement){
|
||||
var boundingRect = adv_button_wrapper[0].getBoundingClientRect();
|
||||
var relX = e.pageX - boundingRect.left;
|
||||
var relY = e.pageY - boundingRect.top;
|
||||
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
var targetEl = adv_button_wrapper.find(target);
|
||||
|
||||
TweenMax.to(targetEl, 0.5, {
|
||||
x: (relX - boundingRect.width/2) / boundingRect.width * movement,
|
||||
y: (relY - boundingRect.height/2 - scrollTop) / boundingRect.width * movement,
|
||||
ease: Power3.easeOut,
|
||||
delay: 0.1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(window).on('elementor/frontend/init', function () {
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_button.default', function ($scope) {
|
||||
if( $scope.find('.button-widget').hasClass('aiero-button-type-parallax') ) {
|
||||
initParallaxButton($scope);
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_audio_listing.default', function ($scope) {
|
||||
playListingAudio($scope);
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_blog_listing.default', function ($scope) {
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
setTimeout(fix_responsive_iframe, 600);
|
||||
setTimeout(custom_video_play_button, 800);
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_gallery.default', function ($scope) {
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
setTimeout(isotope_init, 2500);
|
||||
}
|
||||
if(jQuery('.cursor_drag', $scope).length > 0 && jQuery(window).width() >= 992) {
|
||||
const $slider = $scope.find('.gallery-wrapper');
|
||||
const cursor = jQuery('.cursor_drag', $scope);
|
||||
function showCustomCursor(event) {
|
||||
cursor.css('left', event.clientX-5).css('top', event.clientY-5);
|
||||
}
|
||||
$slider.mousemove(showCustomCursor);
|
||||
|
||||
$slider.mouseleave(function(e) {
|
||||
if(!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('.owl-stage', $scope).css({cursor: 'auto'});
|
||||
jQuery('.gallery-item-link', $scope).css({cursor: 'auto'});
|
||||
cursor.removeClass('active');
|
||||
setTimeout(function() {
|
||||
if(!cursor.hasClass('active')) {
|
||||
cursor.hide();
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
|
||||
$slider.mouseenter(function(e) {
|
||||
if(!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('.owl-stage', $scope).css({cursor: 'none'});
|
||||
jQuery('.gallery-item-link', $scope).css({cursor: 'none'});
|
||||
cursor.show();
|
||||
setTimeout(function() {
|
||||
cursor.addClass('active');
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_projects_listing.default', function ($scope) {
|
||||
animateHeading($scope);
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
setTimeout(isotope_init, 2500);
|
||||
}
|
||||
setTimeout(handleProjectsExcerptHeight, 500);
|
||||
if( $scope.find('.project-grid-listing').length > 0 ) {
|
||||
setTimeout(function() {
|
||||
handleProjectsGridExcerptHeight($scope);
|
||||
}, 500);
|
||||
}
|
||||
if ( $scope.find('.project-modern-listing').length > 0 ) {
|
||||
var scopeID = $scope.attr('data-id');
|
||||
initModernProjects($scope);
|
||||
jQuery('body').on('genre_get_posts_success', function(e, classes, id) {
|
||||
if(classes.indexOf('project-modern-listing') !== -1 && id === scopeID) {
|
||||
initModernProjects($scope);
|
||||
}
|
||||
});
|
||||
}
|
||||
if ( $scope.find('.content-type-audio').length > 0 ) {
|
||||
playProjectsSliderAudio($scope);
|
||||
}
|
||||
if( $scope.find('.project-cards-listing').length > 0 ) {
|
||||
initCardsProjects($scope);
|
||||
var scopeID = $scope.attr('data-id');
|
||||
jQuery('body').on('genre_get_posts_success', function(e, classes, id) {
|
||||
if(classes.indexOf('project-cards-listing') !== -1 && id === scopeID) {
|
||||
initCardsProjects($scope);
|
||||
}
|
||||
});
|
||||
}
|
||||
if( $scope.find('.project-grid-listing').length > 0 ) {
|
||||
var scopeID = $scope.attr('data-id');
|
||||
jQuery('body').on('genre_get_posts_success', function(e, classes, id) {
|
||||
if(classes.indexOf('project-grid-listing') !== -1 && id === scopeID) {
|
||||
handleProjectsGridExcerptHeight($scope);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_services_listing.default', function ($scope) {
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
animateHeading($scope);
|
||||
initServicesButton($scope);
|
||||
var scopeID = $scope.attr('data-id');
|
||||
jQuery('body').on('genre_get_posts_success', function(e, classes, id) {
|
||||
if(classes.indexOf('service-grid-listing') !== -1 && id === scopeID) {
|
||||
initServicesButton($scope);
|
||||
}
|
||||
});
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_testimonial_carousel.default', function ($scope) {
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
if(jQuery('.cursor_drag', $scope).length > 0 && jQuery(window).width() >= 992) {
|
||||
const $slider = $scope.find('.testimonials-slider-container');
|
||||
const cursor = jQuery('.cursor_drag', $scope);
|
||||
function showCustomCursor(event) {
|
||||
cursor.css('left', event.clientX-5).css('top', event.clientY-5);
|
||||
}
|
||||
$slider.mousemove(showCustomCursor);
|
||||
|
||||
$slider.mouseleave(function(e) {
|
||||
if(!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('.owl-stage', $scope).css({cursor: 'auto'});
|
||||
cursor.removeClass('active');
|
||||
setTimeout(function() {
|
||||
if(!cursor.hasClass('active')) {
|
||||
cursor.hide();
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
|
||||
$slider.mouseenter(function(e) {
|
||||
if(!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('.owl-stage', $scope).css({cursor: 'none'});
|
||||
cursor.show();
|
||||
setTimeout(function() {
|
||||
cursor.addClass('active');
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_image_carousel.default', function ($scope) {
|
||||
animateHeading($scope);
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
if(jQuery('.cursor_drag', $scope).length > 0 && jQuery(window).width() >= 992) {
|
||||
const $slider = $scope.find('.slider-wrapper');
|
||||
const cursor = jQuery('.cursor_drag', $scope);
|
||||
function showCustomCursor(event) {
|
||||
cursor.css('left', event.clientX-5).css('top', event.clientY-5);
|
||||
}
|
||||
$slider.mousemove(showCustomCursor);
|
||||
|
||||
$slider.mouseleave(function(e) {
|
||||
if(!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('.owl-stage', $scope).css({cursor: 'auto'});
|
||||
cursor.removeClass('active');
|
||||
setTimeout(function() {
|
||||
if(!cursor.hasClass('active')) {
|
||||
cursor.hide();
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
|
||||
$slider.mouseenter(function(e) {
|
||||
if(!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('.owl-stage', $scope).css({cursor: 'none'});
|
||||
cursor.show();
|
||||
setTimeout(function() {
|
||||
cursor.addClass('active');
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_content_slider.default', function ($scope) {
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_wpforms.default', function () {
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
initFloatPlaceholderInput();
|
||||
initWPFormsSubmitButton();
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_mailchimp.default', function () {
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
initFloatPlaceholderInput();
|
||||
initWPFormsSubmitButton();
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/section.default', function () {
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
background_image_parallax(jQuery('[data-parallax="scroll"]'), 0.7);
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_heading.default', function ($scope) {
|
||||
animateHeading($scope);
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_step_carousel.default', function ($scope) {
|
||||
animateHeading($scope);
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
});
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/image.default', function ($scope) {
|
||||
if ( jQuery(window).width() >= 1025 ) {
|
||||
const cursor = jQuery('.hovered-text', $scope);
|
||||
|
||||
function showCustomCursor(event) {
|
||||
cursor.css('left', event.clientX).css('top', event.clientY);
|
||||
}
|
||||
if ( cursor.length > 0 ) {
|
||||
$scope.find('img').mousemove(showCustomCursor);
|
||||
|
||||
$scope.find('img').mouseleave(function (e) {
|
||||
if (!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('a', $scope).css({cursor: 'auto'});
|
||||
$scope.css({cursor: 'auto'});
|
||||
cursor.removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
$scope.find('img').mouseenter(function (e) {
|
||||
if (!jQuery('body').hasClass('elementor-editor-active')) {
|
||||
jQuery('a', $scope).css({cursor: 'none'});
|
||||
$scope.css({cursor: 'none'});
|
||||
cursor.addClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if ( $scope.hasClass('elementor-image-scroll-animation-on') ) {
|
||||
const { ScrollObserver, valueAtPercentage } = aat;
|
||||
const image = $scope.find('img');
|
||||
image.each(function(index) {
|
||||
ScrollObserver.Element(jQuery(this)[0], {
|
||||
offsetTop: 250,
|
||||
offsetBottom: 0
|
||||
}).onScroll(({ percentageY }) => {
|
||||
const transform = `perspective(1200px) rotateX(${valueAtPercentage({
|
||||
from: 15,
|
||||
to: 0,
|
||||
percentage: percentageY
|
||||
})}deg)`;
|
||||
jQuery(this).css('transform', transform);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction("frontend/element_ready/tabs.default", function ($scope) {
|
||||
var image_ids = $scope.data('image-ids');
|
||||
if( image_ids && image_ids.length ) {
|
||||
image_ids.forEach(function(e) {
|
||||
jQuery('#' + e).addClass('hidden');
|
||||
});
|
||||
jQuery('#' + image_ids[0]).removeClass('hidden');
|
||||
jQuery('.elementor-tab-title.elementor-tab-desktop-title', $scope).each(function(index, el) {
|
||||
jQuery(this).on('click', function(e) {
|
||||
if(image_ids[index]) {
|
||||
image_ids.forEach(function(e) {
|
||||
jQuery('#' + e).addClass('hidden');
|
||||
});
|
||||
jQuery('#' + image_ids[index]).removeClass('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
jQuery('.elementor-tab-title.elementor-tab-mobile-title', $scope).each(function(index, el) {
|
||||
jQuery(this).on('click', function(e) {
|
||||
if(image_ids[index]) {
|
||||
image_ids.forEach(function(e) {
|
||||
jQuery('#' + e).addClass('hidden');
|
||||
});
|
||||
jQuery('#' + image_ids[index]).removeClass('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
elementorFrontend.hooks.addAction("frontend/element_ready/aiero_tabs.default", function (e) {
|
||||
let d = e.find(".aiero_tabs_titles_container"),
|
||||
s = e.find(".aiero_tabs_content_container");
|
||||
jQuery(d).find(".aiero_tab_title_item").first().addClass("active");
|
||||
if( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
return;
|
||||
}
|
||||
var tab_content_first_class = jQuery(d).find(".aiero_tab_title_item").first().attr("data-id");
|
||||
jQuery(d).find(".aiero_tab_title_item").each(function() {
|
||||
let e = jQuery(this).attr("data-id");
|
||||
if(e) {
|
||||
jQuery('.elementor #' + e).removeClass("active").addClass("hidden");
|
||||
}
|
||||
});
|
||||
if(tab_content_first_class) {
|
||||
jQuery('.elementor #' + tab_content_first_class).addClass("active").removeClass("hidden");
|
||||
}
|
||||
jQuery(s).find(".aiero_tab_content_item").first().addClass("active");
|
||||
e.find(".aiero_tab_title_item a").on("click", function () {
|
||||
let e = jQuery(this).parent().attr("data-id");
|
||||
if(!jQuery(this).parent().is(".active")) {
|
||||
d.find(".active").removeClass("active");
|
||||
s.find(".active").removeClass("active");
|
||||
if(e) {
|
||||
var all_ids = [];
|
||||
jQuery(d).find(".aiero_tab_title_item").each(function() {
|
||||
let e = jQuery(this).attr("data-id");
|
||||
if(e) {
|
||||
all_ids.push('.elementor #' + e);
|
||||
var swiper = jQuery('.elementor #' + e).find('.swiper-container');
|
||||
if(swiper.length) {
|
||||
setTimeout(function(){
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
});
|
||||
var all_ids_str = all_ids.join();
|
||||
jQuery(all_ids_str).removeClass("active").addClass("hidden");
|
||||
}
|
||||
jQuery(this).parent().addClass("active");
|
||||
if(e) {
|
||||
jQuery('.elementor #' + e).addClass("active").removeClass("hidden");
|
||||
s.find("#" + e).addClass("active");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
elementorFrontend.hooks.addAction("frontend/element_ready/aiero_moving_list.default", function (e) {
|
||||
initMovingList(e);
|
||||
});
|
||||
|
||||
elementorFrontend.hooks.addAction('frontend/element_ready/aiero_case_study_listing.default', function () {
|
||||
setTimeout(function() {
|
||||
elements_slider_init(jQuery('.owl-carousel', $scope));
|
||||
}, 300);
|
||||
if ( jQuery('body').hasClass('elementor-editor-active') ) {
|
||||
setTimeout(isotope_init, 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,123 @@
|
||||
(function(o, i) {
|
||||
typeof exports == "object" && typeof module < "u" ? i(exports) : typeof define == "function" && define.amd ? define(["exports"], i) : (o = typeof globalThis < "u" ? globalThis : o || self,
|
||||
i(o.aat = {}))
|
||||
}
|
||||
)(this, function(o) {
|
||||
"use strict";
|
||||
function i(s, e, t) {
|
||||
return Math.min(Math.max(s, e), t)
|
||||
}
|
||||
function l({from: s, to: e, percentage: t, unit: n}) {
|
||||
return s + (e - s) * t + (n || "")
|
||||
}
|
||||
const a = {
|
||||
offsetBottom: 0,
|
||||
offsetTop: 0,
|
||||
offsetRight: 0,
|
||||
offsetLeft: 0,
|
||||
addWrapper: !1,
|
||||
wrapperClass: "",
|
||||
container: document.documentElement
|
||||
};
|
||||
class c {
|
||||
static Container(e=document.documentElement) {
|
||||
return new h(e)
|
||||
}
|
||||
static Element(e, t) {
|
||||
return new d(e,{
|
||||
...a,
|
||||
...t
|
||||
})
|
||||
}
|
||||
onScroll(e) {
|
||||
this._handler = e,
|
||||
this._onScroll()
|
||||
}
|
||||
}
|
||||
class h extends c {
|
||||
constructor(e) {
|
||||
super(),
|
||||
this._container = e,
|
||||
(e === document.documentElement ? window : e).addEventListener("scroll", this._onScroll.bind(this))
|
||||
}
|
||||
_onScroll() {
|
||||
const e = this._container.scrollTop
|
||||
, t = this._container.scrollHeight - this._container.clientHeight
|
||||
, n = i(e / t, 0, 1) || 0
|
||||
, r = this._container.scrollLeft
|
||||
, p = this._container.scrollWidth - this._container.clientWidth
|
||||
, _ = i(r / p, 0, 1) || 0;
|
||||
this._handler && typeof this._handler == "function" && requestAnimationFrame(()=>this._handler({
|
||||
percentageY: n,
|
||||
percentageX: _
|
||||
}))
|
||||
}
|
||||
}
|
||||
class d extends c {
|
||||
constructor(e, t) {
|
||||
super(),
|
||||
this._element = e,
|
||||
this._options = t,
|
||||
this._lastPercentageY = null,
|
||||
this._lastPercentageX = null,
|
||||
this._options.addWrapper && this._addWrapper(),
|
||||
(this._options.container === document.documentElement ? window : this._options.container).addEventListener("scroll", this._onScroll.bind(this)),
|
||||
requestAnimationFrame(()=>this._onScroll())
|
||||
}
|
||||
_addWrapper() {
|
||||
this._wrapper = document.createElement("div"),
|
||||
this._options.wrapperClass && this._wrapper.classList.add(this._options.wrapperClass),
|
||||
this._element.parentNode.insertBefore(this._wrapper, this._element),
|
||||
this._wrapper.appendChild(this._element)
|
||||
}
|
||||
get _containerClientHeight() {
|
||||
return this._options.container === window ? window.innerHeight : this._options.container.clientHeight
|
||||
}
|
||||
get _containerClientWidth() {
|
||||
return this._options.container === window ? window.innerWidth : this._options.container.clientWidth
|
||||
}
|
||||
get _elRectRelativeToContainer() {
|
||||
const t = (this._options.addWrapper ? this._wrapper : this._element).getBoundingClientRect();
|
||||
if (this._options.container === document.documentElement)
|
||||
return t;
|
||||
const n = this._options.container.getBoundingClientRect();
|
||||
return {
|
||||
width: t.width,
|
||||
height: t.width,
|
||||
left: t.left - n.left,
|
||||
top: t.top - n.top,
|
||||
right: t.right - n.right,
|
||||
bottom: t.bottom - n.bottom
|
||||
}
|
||||
}
|
||||
_calculatePercentageY() {
|
||||
const e = this._elRectRelativeToContainer
|
||||
, t = this._containerClientHeight - this._options.offsetBottom
|
||||
, n = this._options.offsetTop
|
||||
, r = t - n;
|
||||
return i((t - e.top) / r, 0, 1)
|
||||
}
|
||||
_calculatePercentageX() {
|
||||
const e = this._elRectRelativeToContainer
|
||||
, t = this._containerClientWidth - this._options.offsetRight
|
||||
, n = this._options.offsetLeft
|
||||
, r = t - n;
|
||||
return i((t - e.left) / r, 0, 1)
|
||||
}
|
||||
_onScroll() {
|
||||
const e = this._calculatePercentageY()
|
||||
, t = this._calculatePercentageX();
|
||||
this._handler && typeof this._handler == "function" && (this._lastPercentageY !== e || this._lastPercentageX !== t) && requestAnimationFrame(()=>this._handler({
|
||||
percentageY: e,
|
||||
percentageX: t
|
||||
})),
|
||||
this._lastPercentageY = e,
|
||||
this._lastPercentageX = t
|
||||
}
|
||||
}
|
||||
o.ScrollObserver = c,
|
||||
o.valueAtPercentage = l,
|
||||
Object.defineProperty(o, Symbol.toStringTag, {
|
||||
value: "Module"
|
||||
})
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
18
demo.artureanec.com/themes/aiero/wp-content/plugins/aiero-plugin/js/lib/slick.min6c2d.js
vendored
Normal file
18
demo.artureanec.com/themes/aiero/wp-content/plugins/aiero-plugin/js/lib/slick.min6c2d.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user