function fillBody() { var x = null; var y = null; document.addEventListener('mousemove', onMouseUpdate, false); document.addEventListener('mouseenter', onMouseUpdate, false); function onMouseUpdate(e) { x = e.pageX; y = e.pageY; } window.requestAnimationFrame(function animate() { for(let i = 0; i < squares.length; i++) { squares[i].style.backgroundPosition = (x/100) + 'px ' + (y/50) + 'px'; } window.requestAnimationFrame(animate); }); } } document.addEventListener('DOMContentLoaded', function() { jQuery(function($){ $('img').click(function(){ setTimeout(function(){ let currentImage = document.querySelector('.elementor-lightbox-item.swiper-slide-active img'); if (currentImage) currentImage.style.objectPosition = `50% 50%`; $('.elementor-lightbox').mousemove(function(e){ let posX = e.clientX / $(window).width() * 100; let posY = e.clientY / $(window).height() * 100; let objPos = `${posX}% ${posY}%`; let currentImage = document.querySelector('.elementor-lightbox-item.swiper-slide-active img'); let poseX, poseY;setTimeout(function(){ poseX = e.clientX / $(window).width() * 100; poseY = e.clientY / $(window).height() * 100 ; let prevObjPos = `${poseX}% ${poseY}%`; if (currentImage){ currentImage.animate([ { objectPosition: objPos}, {objectPosition: prevObjPos}], { duration: 3300 , easing: 'cubic-bezier(0,1,0,1)' } ); }; }, 300); }); $('.elementor-lightbox *').removeClass('elementor-lightbox-prevent-close'); $('.elementor-lightbox .swiper-container').removeAttr('style'); }, 300); }); }); }); function b() { (t = requestAnimFrame(b)), (function () { if (((l.xCurr += 0.05 * (l.xDest - l.xCurr)), (l.yCurr += 0.05 * (l.yDest - l.yCurr)), !0 === u)) { if (((f += l.xCurr - f), l.xCurr !== n)) { var t = parseFloat(e(f, d.w)); (t = p.x * t), (r.style.webkitTransform = "translate(" + t + "px, 0px)"), (r.style.MozTransform = "translate(" + t + "px, 0px)"), (r.style.msTransform = "translate(" + t + "px, 0px)"), (n = l.xCurr); } } else if (!1 === u && ((f += l.yCurr - f), l.yCurr !== n)) { var t = parseFloat (e(f, d.h)); (t = p.y * t), (r.style.webkitTransform = "translate( 0px, " + t + "px)"), (r.style.MozTransform = "translate( 0px, " + t + "px)"), (r.style.msTransform = "translate( 0px, " + t + "px)"), (n = l.yCurr); } function e(t, e) { return c ? (e - t) / e : t / e; } })(); }