{"version":3,"file":"withCursor.B3dvpCEO.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/glQXJplbysYHr6N3o8ht/o0pwcroK54weuj52X5cj/Grid.js","https:/framerusercontent.com/modules/NwCnX0E2ZjcyYM3uVUll/svi5HN2mE2kDcndZJIpD/withCursor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/docs/guides/auto-sizing\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Grid(props){return /*#__PURE__*/_jsx(motion.div,{animate:{scaleY:[0,1]},transition:{duration:2,ease:[.075,.82,.165,1]},style:{...props.style,transformOrigin:\"bottom left\",backgroundImage:`linear-gradient(90deg, ${props.background} 1px, transparent 1px)`,backgroundSize:`${Math.round(100/props.columns)}.01%`,marginLeft:\"-1px\",opacity:props.opacity}});}addPropertyControls(Grid,{columns:{type:ControlType.Number,defaultValue:4,min:0,max:8,step:1,displayStepper:true},opacity:{type:ControlType.Number,defaultValue:.15,min:0,max:1},background:{type:ControlType.Color,defaultValue:\"rgba(255, 255, 255, 1)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Grid\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Grid.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{useMotionValue,useSpring}from\"framer-motion\";export function withFollowMouse(Component){return props=>{const cursorRef=useRef(null);const[size,setSize]=useState({top:0,left:0,width:0,height:0});const[mouseData,enabled,interactive,pressed]=useMousePosition();const springValue={damping:60,mass:1,stiffness:500};// const x = useSpring(mouseData.x, springValue)\n// const y = useSpring(mouseData.y, springValue)\nconst scale=useSpring(mouseData.scale,springValue);useEffect(()=>{setSize({top:window.innerHeight/2,left:window.innerWidth/2,width:cursorRef.current.offsetWidth,height:cursorRef.current.offsetHeight});},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:cursorRef,animate:{opacity:enabled?1:0},style:{...props.style,position:\"fixed\",top:-size.height/2,left:-size.width/2,x:mouseData.x,y:mouseData.y,scale,pointerEvents:\"none\"}});};}function useMousePosition(){const x=useMotionValue(0);const y=useMotionValue(0);const scale=useMotionValue(1);const[enabled,setEnabled]=useState(false);const[pressed,setPressed]=useState(false);const[interactive,setInteractive]=useState(false);let moveTimer;useEffect(()=>{if(!window.matchMedia(\"(pointer: fine)\").matches){return;}const onMouseMove=e=>{var _e_target_parentNode,_e_target_parentNode1,_e_target_dataset;x.set(e.clientX);y.set(e.clientY);const velX=x.getVelocity();const velY=y.getVelocity();const s=getScale(velX,velY);const defaultScale=1-s;if(e.target.nodeName===\"BUTTON\"||e.target.nodeName===\"A\"||((_e_target_parentNode=e.target.parentNode)===null||_e_target_parentNode===void 0?void 0:_e_target_parentNode.nodeName)===\"A\"||((_e_target_parentNode1=e.target.parentNode)===null||_e_target_parentNode1===void 0?void 0:_e_target_parentNode1.nodeName)===\"BUTTON\"){setInteractive(true);scale.set(1.4);}else{setInteractive(false);scale.set(defaultScale);moveTimer=setTimeout(()=>{scale.set(1);},10);}if((_e_target_dataset=e.target.dataset)===null||_e_target_dataset===void 0?void 0:_e_target_dataset.noCursor){setEnabled(false);}else{setEnabled(true);}if(moveTimer){clearTimeout(moveTimer);}};const onMouseLeave=()=>{setEnabled(false);};const onMouseDown=()=>{setPressed(true);scale.set(.8);};const onMouseUp=()=>{setPressed(false);scale.set(1);};document.addEventListener(\"mouseout\",onMouseLeave);document.addEventListener(\"mousemove\",onMouseMove);document.addEventListener(\"mousedown\",onMouseDown);document.addEventListener(\"mouseup\",onMouseUp);const style=document.createElement(\"style\");style.textContent=`\n            html,\n            a,\n            button:not(:disabled),\n            video {\n                cursor: none !important;\n            }\n        `;document.head.appendChild(style);return()=>{document.removeEventListener(\"mouseout\",onMouseLeave);document.removeEventListener(\"mousemove\",onMouseMove);document.removeEventListener(\"mousedown\",onMouseDown);document.removeEventListener(\"mouseup\",onMouseUp);document.head.removeChild(style);};},[]);return[{x,y,scale},enabled,interactive,pressed];}// Function for Mouse Move Scale Change\nfunction getScale(diffX,diffY){const distance=Math.sqrt(Math.pow(diffX,2)+Math.pow(diffY,2));return Math.min(distance/4e3,.8);}\nexport const __FramerMetadata__ = {\"exports\":{\"withFollowMouse\":{\"type\":\"reactHoc\",\"name\":\"withFollowMouse\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./withCursor.map"],"mappings":"qQAMG,SAAwB,EAAK,EAAM,CAAC,OAAoB,EAAK,EAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,EAAM,MAAM,gBAAgB,cAAc,gBAAgB,0BAA0B,EAAM,WAAW,wBAAwB,eAAe,GAAG,KAAK,MAAM,IAAI,EAAM,OAAO,EAAE,MAAM,WAAW,OAAO,QAAQ,EAAM,OAAO,CAAC,CAAC,CAAE,iBANhV,IAAkC,IAAoD,EAM2P,EAAoB,EAAK,CAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAI,EAAE,QAAQ,CAAC,KAAK,EAAY,OAAO,aAAa,IAAI,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,KAAK,EAAY,MAAM,aAAa,wBAAwB,CAAC,CAAC,KCN1e,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAUA,EAAO,IAAI,E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