@limetech/lime-elements
Version:
1 lines • 795 B
JavaScript
const e=e=>{let o;return{handleMouseEnter:()=>{const t=e.getBoundingClientRect();o=((e,o)=>t=>{const n=t.clientX-e.x-e.width/2,l=t.clientY-e.y-e.height/2,d=Math.sqrt(n**2+l**2),a=Math.sqrt(Math.min(e.width,e.height)/50),h=`\n ${l/(100*a)},\n ${-n/(100*a)},\n 0,\n ${1.6*Math.log(d)/a}deg\n `;o.style.setProperty("--limel-3d-hover-effect-rotate3d",h),o.style.setProperty("--limel-3d-hover-effect-glow-position",`\n ${2*n+e.width/2}px\n ${2*l+e.height/2}px\n `)})(t,e),document.addEventListener("mousemove",o)},handleMouseLeave:()=>{document.removeEventListener("mousemove",o),e.style.removeProperty("--limel-3d-hover-effect-rotate3d"),e.style.removeProperty("--limel-3d-hover-effect-glow-position")}}};export{e as g}