{"version":3,"file":"Custom_cursor.Cabfffd6.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/zwqEF1xW1okKurPuGWH5/CO1oERCDNZA0BNee1zgK/Custom_cursor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useState,useEffect}from\"react\";import{motion,useSpring}from\"framer-motion\";function hasButtonOrAnchorAncestor(element){if(!element){return false;}if(element.tagName===\"BUTTON\"||element.tagName===\"A\"){return true;}return hasButtonOrAnchorAncestor(element.parentElement);}export function withCursorFollow(Component){return props=>{if(typeof document===\"undefined\"){return null;}// Add a style tag to the head of the document to hide the system cursor for all elements\nconst style=document.createElement(\"style\");style.appendChild(document.createTextNode(\"* { cursor: none !important; }\"));document.head.appendChild(style);const cursorRef=useRef(null);const[isHovering,setIsHovering]=useState(false);const spring={type:\"spring\",stiffness:1e3,damping:70};const storedPosition=localStorage.getItem(\"cursorPosition\");const initialCursorPosition=useRef(storedPosition?JSON.parse(storedPosition):{x:window.innerWidth/2,y:window.innerHeight/2});const positionX=useSpring(initialCursorPosition.current.x,spring);const positionY=useSpring(initialCursorPosition.current.y,spring);useEffect(()=>{const handleMouseMove=e=>{if(!cursorRef.current)return;// Check if the cursor is hovering a button or \"A\" tag element\nconst isHovered=e.target instanceof HTMLElement&&(e.target.tagName===\"BUTTON\"||e.target.tagName===\"A\"||hasButtonOrAnchorAncestor(e.target.parentElement));setIsHovering(isHovered);// Update the position based on the cursor position\npositionX.set(e.clientX);positionY.set(e.clientY);localStorage.setItem(\"cursorPosition\",JSON.stringify({x:e.clientX,y:e.clientY}));};// Store the initial cursor position when the component is first rendered\ninitialCursorPosition.current.x=window.innerWidth/2;initialCursorPosition.current.y=window.innerHeight/2;window.addEventListener(\"mousemove\",handleMouseMove);return()=>{window.removeEventListener(\"mousemove\",handleMouseMove);};},[]);return /*#__PURE__*/_jsx(motion.div,{ref:cursorRef,style:{position:\"fixed\",left:positionX,top:positionY,pointerEvents:\"none\",transform:\"translate(-50%, -50%)\",transition:\"transform 0.2s ease, opacity 0.2s ease\",zIndex:9999,opacity:isHovering?1:1,scale:isHovering?1:1},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCursorFollow\":{\"type\":\"reactHoc\",\"name\":\"withCursorFollow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Custom_cursor.map"],"mappings":"kTAAoI,SAAS,EAA0B,EAAQ,CAA+F,OAA1F,EAA0B,EAAQ,UAAU,UAAU,EAAQ,UAAU,IAAY,GAAa,EAA0B,EAAQ,cAAc,CAAjI,GAAmI,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAG,OAAO,SAAW,IAAa,OAAO,KAC3a,IAAM,EAAM,SAAS,cAAc,QAAQ,CAAC,EAAM,YAAY,SAAS,eAAe,iCAAiC,CAAC,CAAC,SAAS,KAAK,YAAY,EAAM,CAAC,IAAM,EAAUA,EAAO,KAAK,CAAM,CAAC,EAAW,GAAeC,EAAS,GAAM,CAAO,EAAO,CAAC,KAAK,SAAS,UAAU,IAAI,QAAQ,GAAG,CAAO,EAAe,aAAa,QAAQ,iBAAiB,CAAO,EAAsBD,EAAO,EAAe,KAAK,MAAM,EAAe,CAAC,CAAC,EAAE,EAAO,WAAW,EAAE,EAAE,EAAO,YAAY,EAAE,CAAC,CAAO,EAAU,EAAU,EAAsB,QAAQ,EAAE,EAAO,CAAO,EAAU,EAAU,EAAsB,QAAQ,EAAE,EAAO,CAGhX,OAHiX,MAAc,CAAC,IAAM,EAAgB,GAAG,CAAC,GAAG,CAAC,EAAU,QAAQ,OACzpB,IAAM,EAAU,EAAE,kBAAkB,cAAc,EAAE,OAAO,UAAU,UAAU,EAAE,OAAO,UAAU,KAAK,EAA0B,EAAE,OAAO,cAAc,EAAE,EAAc,EAAU,CAClL,EAAU,IAAI,EAAE,QAAQ,CAAC,EAAU,IAAI,EA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