// source --> https://3axis-design.de/wp-content/uploads/hm_custom_css_js/custom.js?ver=1760388108 
(function(){if(window.innerWidth<1201)return;const translateFactor=0.1;const scaleFactor=0.1;const stiffness=0.08;const damping=0.80;const epsilon=0.01;function getAll(){return Array.from(document.getElementsByClassName("3d-mouse"))}
function measure(el){return el.getBoundingClientRect()}
function clamp(v,min,max){return v<min?min:v>max?max:v}
const items=[];function setupElement(el){const rect=measure(el);if(!el.style.width)el.style.width=rect.width+"px";if(!el.style.height)el.style.height=rect.height+"px";el.style.transformOrigin="50% 50%";el.style.willChange="transform";const state={el,scale:1+scaleFactor,targetX:0,targetY:0,curX:0,curY:0,vx:0,vy:0,visible:!1};el.style.transform=`translate(0px, 0px) scale(${state.scale})`;return state}
function init(){const els=getAll();els.forEach((el)=>items.push(setupElement(el)));const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{const st=items.find((i)=>i.el===entry.target);if(!st)return;st.visible=entry.isIntersecting&&entry.intersectionRatio>0;if(!st.visible){st.targetX=0;st.targetY=0}})},{root:null,threshold:[0,0.01,0.25,0.5,0.75,1]});items.forEach((st)=>observer.observe(st.el));document.addEventListener("mousemove",(e)=>{const mx=e.clientX;const my=e.clientY;for(const st of items){if(!st.visible)continue;const r=measure(st.el);const width=r.width;const height=r.height;const centerX=r.left+width/2;const centerY=r.top+height/2;const dx=mx-centerX;const dy=my-centerY;let percentX=(dx/(width/2))*100;let percentY=(dy/(height/2))*100;percentX=clamp(percentX,-100,100);percentY=clamp(percentY,-100,100);percentX=-percentX;percentY=-percentY;st.targetX=percentX*translateFactor;st.targetY=percentY*translateFactor}},{passive:!0});function animate(){for(const st of items){const tx=st.visible?st.targetX:0;const ty=st.visible?st.targetY:0;const ax=(tx-st.curX)*stiffness;const ay=(ty-st.curY)*stiffness;st.vx=(st.vx+ax)*damping;st.vy=(st.vy+ay)*damping;st.curX+=st.vx;st.curY+=st.vy;if(!st.visible){if(Math.abs(st.curX)<epsilon&&Math.abs(st.vx)<epsilon){st.curX=0;st.vx=0}
if(Math.abs(st.curY)<epsilon&&Math.abs(st.vy)<epsilon){st.curY=0;st.vy=0}}
st.el.style.transform=`translate(${st.curX}px, ${st.curY}px) scale(${st.scale})`}
requestAnimationFrame(animate)}
requestAnimationFrame(animate)}
if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",init,{once:!0})}else{init()}})();document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll('a[href="#"]').forEach(function(link){link.addEventListener("click",function(e){e.preventDefault()})})});