{"version":3,"file":"withCursor.B6PQfubg.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/dnPQAcHN2j8U6eFye3Yg/w2AiK6c6ppVDW5785gQR/Grid.js","https:/framerusercontent.com/modules/oRuaU5J6Oux5teToNVuV/X5yCtEOakFEN1N58axDR/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":"6aAMG,SAAwB,EAAK,EAAM,CAAC,OAAoB,EAAK,EAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,gBAAgB,cAAc,gBAAgB,0BAA0B,EAAM,WAAW,wBAAwB,eAAe,GAAG,KAAK,MAAM,IAAI,EAAM,SAAS,MAAM,WAAW,OAAO,QAAQ,EAAM,QAAQ,CAAC,CAAG,6BAAoB,EAAK,CAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAK,CAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,aAAa,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,KAAK,EAAY,MAAM,aAAa,yBAAyB,CAAC,KCN1e,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAUA,EAAO,MAAW,CAAC,EAAK,EAAQ,CAACC,EAAS,CAAC,IAAI,E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