{"version":3,"file":"withCursor.B19YYomf.mjs","names":[],"sources":["https:/framerusercontent.com/modules/hAoFJrpj8nnwoZxxrxu8/12Q4Dj0a6XDiOv1w0Hrw/Grid.js","https:/framerusercontent.com/modules/paJbPld65doKN203otda/sRfv28PZtRWJnAlvDwcc/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,MAAoB,GAAK,EAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAE,CAAC,EAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAE,CAAC,EAAC,MAAM,CAAC,GAAG,EAAM,MAAM,gBAAgB,cAAc,iBAAiB,yBAAyB,EAAM,WAAW,wBAAwB,kBAAkB,KAAK,MAAM,IAAI,EAAM,QAAQ,CAAC,MAAM,WAAW,OAAO,QAAQ,EAAM,OAAQ,CAAC,EAAC,AAAE,cAAA,AAN3X,GAA2C,IAAkC,IAAoD,CAM0P,EAAoB,EAAK,CAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAe,CAAK,EAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,aAAa,IAAI,IAAI,EAAE,IAAI,CAAE,EAAC,WAAW,CAAC,KAAK,EAAY,MAAM,aAAa,wBAAyB,CAAC,EAAC,GCN3e,SAAgB,EAAgB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,IAAM,EAAU,EAA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