{"version":3,"file":"hoverEffect.BRIw8qLP.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/bmRrbN9jKru5gyPLfe5P/ckqr6FM3ubic37sOeZH1/hoverEffect.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{useSpring}from\"framer-motion\";const ROTATE_VALUE=30;export function withHover(Component){return props=>{const ref=useRef(null);const springConfig={stiffness:1e3,damping:100};const rotateX=useSpring(0,springConfig);const rotateY=useSpring(0,springConfig);useEffect(()=>{const handleMouseMove=e=>{if(ref.current){const rect=ref.current.getBoundingClientRect();const isInsideComponent=e.clientX>=rect.left&&e.clientX<=rect.right&&e.clientY>=rect.top&&e.clientY<=rect.bottom;if(isInsideComponent){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;const deltaX=e.clientX-centerX;const deltaY=e.clientY-centerY;const rotateXValue=deltaY/rect.height*ROTATE_VALUE;const rotateYValue=deltaX/rect.width*ROTATE_VALUE;console.log(\"rotateXValue\",rotateXValue);console.log(\"rotateYValue\",-rotateYValue);rotateX.set(-rotateXValue);rotateY.set(rotateYValue);}else{rotateX.set(0);rotateY.set(0);}}};window.addEventListener(\"mousemove\",handleMouseMove);return()=>{window.removeEventListener(\"mousemove\",handleMouseMove);};},[rotateX,rotateY]);return /*#__PURE__*/_jsx(Component,{...props,style:{rotateX,rotateY},ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./hoverEffect.map"],"mappings":"yLAA0I,SAAgB,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAO,EAAa,CAAC,UAAU,IAAI,QAAQ,IAAI,CAAO,EAAQ,EAAU,EAAE,EAAa,CAAO,EAAQ,EAAU,EAAE,EAAa,CAA4xB,OAA3xB,MAAc,CAAC,IAAM,EAAgB,GAAG,CAAC,GAAG,EAAI,QAAQ,CAAC,IAAM,EAAK,EAAI,QAAQ,uBAAuB,CAAkH,GAAzF,EAAE,SAAS,EAAK,MAAM,EAAE,SAAS,EAAK,OAAO,EAAE,SAAS,EAAK,KAAK,EAAE,SAAS,EAAK,OAA4B,CAAC,IAAM,EAAQ,EAAK,KAAK,EAAK,MAAM,EAAQ,EAAQ,EAAK,IAAI,EAAK,OAAO,EAAQ,EAAO,EAAE,QAAQ,EAA6C,GAAxB,EAAE,QAAQ,GAAkC,EAAK,OAAO,EAAmB,EAAa,EAAO,EAAK,MAAM,EAAa,QAAQ,IAAI,eAAe,EAAa,CAAC,QAAQ,IAAI,eAAe,CAAC,EAAa,CAAC,EAAQ,IAAI,CAAC,EAAa,CAAC,EAAQ,IAAI,EAAa,MAAO,EAAQ,IAAI,EAAE,CAAC,EAAQ,IAAI,EAAE,GAA0D,OAArD,EAAO,iBAAiB,YAAY,EAAgB,KAAW,CAAC,EAAO,oBAAoB,YAAY,EAAgB,GAAK,CAAC,EAAQ,EAAQ,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,UAAQ,UAAQ,CAAK,MAAI,CAAC,yBAAlpC,IAAoC,IAAqC,CAAM,EAAa"}