{"version":3,"file":"Card3D.Duwe9Wpb.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/nX2RwllH0GYcUm02OVi9/89WIp4C3zhAuP4zv36pN/Card3D.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useState,useEffect}from\"react\";import{useMotionValue}from\"framer-motion\";export function withHover(Component){return props=>{const x=useMotionValue(0);const y=useMotionValue(0);const[scale,setScale]=useState(1);const cardRef=useRef(null);const handleMouseMove=e=>{if(cardRef.current){const rect=cardRef.current.getBoundingClientRect();const xPos=e.clientX-rect.left-rect.width/2;const yPos=e.clientY-rect.top-rect.height/2;x.set(xPos/20);y.set(-yPos/20);}};const handleMouseEnter=()=>{setScale(1.05);};const handleMouseLeave=()=>{x.set(0);y.set(0);setScale(1);};useEffect(()=>{const elem=cardRef.current;const applyTransform=()=>{if(elem){elem.style.transform=`perspective(1000px) rotateX(${y.get()}deg) rotateY(${x.get()}deg) scale(${scale})`;}};applyTransform();const unsubX=x.onChange(applyTransform);const unsubY=y.onChange(applyTransform);return()=>{unsubX();unsubY();};},[x,y,scale]);return /*#__PURE__*/ _jsx(Component,{...props,ref:cardRef,onMouseMove:handleMouseMove,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:{transition:\"transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1)\",...props.style}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Card3D.map"],"mappings":"iLAAkI,SAAgB,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAE,EAAe,EAAE,CAAO,EAAE,EAAe,EAAE,CAAM,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAO,EAAQC,EAAO,KAAK,CAAO,EAAgB,GAAG,CAAC,GAAG,EAAQ,QAAQ,CAAC,IAAM,EAAK,EAAQ,QAAQ,uBAAuB,CAAO,EAAK,EAAE,QAAQ,EAAK,KAAK,EAAK,MAAM,EAAQ,EAAK,EAAE,QAAQ,EAAK,IAAI,EAAK,OAAO,EAAE,EAAE,IAAI,EAAK,GAAG,CAAC,EAAE,IAAI,CAAC,EAAK,GAAG,GAAU,MAAqB,CAAC,EAAS,KAAK,EAAS,MAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAS,EAAE,EAA2U,OAAxU,MAAc,CAAC,IAAM,EAAK,EAAQ,QAAc,MAAmB,CAAI,IAAM,EAAK,MAAM,UAAU,+BAA+B,EAAE,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,aAAa,EAAM,KAAM,GAAgB,CAAC,IAAM,EAAO,EAAE,SAAS,EAAe,CAAO,EAAO,EAAE,SAAS,EAAe,CAAC,UAAU,CAAC,GAAQ,CAAC,GAAQ,GAAK,CAAC,EAAE,EAAE,EAAM,CAAC,CAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,IAAI,EAAQ,YAAY,EAAgB,aAAa,EAAiB,aAAa,EAAiB,MAAM,CAAC,WAAW,gDAAgD,GAAG,EAAM,MAAM,CAAC,CAAC,mBAA7mC,IAA6C,IAA0C"}