{"version":3,"file":"WatchCursor.2MAMhlmv.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/2Jz8Jkl8mOgthCJMXktg/d8RQXFhyIWRCwxDEkTeO/WatchCursor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";import{AnimatePresence,motion,useMotionValue,useReducedMotion,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function WatchCursor(props){const{label=\"WATCH\",size=72,fill=\"#171717\",textColor=\"#FFFFFF\",style}=props;const isStatic=useIsStaticRenderer();const reducedMotion=useReducedMotion();const rootRef=useRef(null);const[visible,setVisible]=useState(false);const visibleRef=useRef(false);const rawX=useMotionValue(0);const rawY=useMotionValue(0);// Tight trail: settles fast, small amount of lag. (Tuned down from a 0.5s ease.)\nconst x=useSpring(rawX,{stiffness:520,damping:42,mass:.7});const y=useSpring(rawY,{stiffness:520,damping:42,mass:.7});useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;// Followers only make sense with a fine pointer (no touch devices)\nif(!window.matchMedia?.(\"(pointer: fine)\").matches)return;// The container is the named frame this layer is placed inside (e.g. the hero wrapper)\nconst getContainer=()=>{const layerEl=rootRef.current?.closest(\"[data-framer-name]\")??rootRef.current;return layerEl?.parentElement?.closest(\"[data-framer-name]\")??layerEl?.parentElement??null;};const inside=e=>{const container=getContainer();if(!container)return false;// elementFromPoint respects stacking: anything overlapping the container\n// (fixed nav, open lightbox) correctly reads as \"not inside\".\nconst top=document.elementFromPoint(e.clientX,e.clientY);return!!top&&container.contains(top);};// Element-level cursors (e.g. the wrapper's cursor: pointer) override body.style.cursor,\n// so hide the pointer with a class + !important rule instead.\nconst CURSOR_CLASS=\"__watch-cursor-active\";const ensureStyle=()=>{if(document.getElementById(\"watch-cursor-style\"))return;const styleEl=document.createElement(\"style\");styleEl.id=\"watch-cursor-style\";styleEl.textContent=`html.${CURSOR_CLASS}, html.${CURSOR_CLASS} * { cursor: none !important; }`;document.head.appendChild(styleEl);};const show=e=>{// Snap to the pointer before revealing so it grows from the cursor,\n// not from a stale resting position.\nrawX.jump(e.clientX);rawY.jump(e.clientY);visibleRef.current=true;setVisible(true);ensureStyle();document.documentElement.classList.add(CURSOR_CLASS);};const hide=()=>{visibleRef.current=false;setVisible(false);document.documentElement.classList.remove(CURSOR_CLASS);};const onMove=e=>{if(inside(e)){if(!visibleRef.current)show(e);if(reducedMotion){rawX.jump(e.clientX);rawY.jump(e.clientY);}else{rawX.set(e.clientX);rawY.set(e.clientY);}}else if(visibleRef.current){hide();}};const onLeaveDoc=()=>visibleRef.current&&hide();window.addEventListener(\"pointermove\",onMove,{passive:true});document.documentElement.addEventListener(\"mouseleave\",onLeaveDoc);return()=>{window.removeEventListener(\"pointermove\",onMove);document.documentElement.removeEventListener(\"mouseleave\",onLeaveDoc);document.documentElement.classList.remove(\"__watch-cursor-active\");};},[isStatic,reducedMotion,rawX,rawY]);const follower=typeof document===\"undefined\"?null:/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(AnimatePresence,{children:visible&&/*#__PURE__*/_jsx(motion.div,{initial:reducedMotion?{opacity:0}:{scale:0,opacity:0},animate:reducedMotion?{opacity:1,transition:{duration:.15}}:{scale:1,opacity:1,transition:{type:\"spring\",duration:.4,bounce:.3}},exit:reducedMotion?{opacity:0,transition:{duration:.15}}:{scale:0,opacity:0,transition:{duration:.25,ease:[.55,.055,.675,.19]}},style:{position:\"fixed\",left:0,top:0,x,y,translateX:\"-50%\",translateY:\"-50%\",width:size,height:size,borderRadius:\"50%\",backgroundColor:fill,color:textColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",pointerEvents:\"none\",zIndex:5,fontFamily:'\"Geist Mono\", ui-monospace, monospace',fontSize:12,fontWeight:600,letterSpacing:\"0.06em\",textTransform:\"uppercase\",lineHeight:1,userSelect:\"none\",willChange:\"transform\"},children:label})}),document.body);return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,style:{width:\"100%\",height:\"100%\",pointerEvents:\"none\",...style},children:!isStatic?follower:null});}addPropertyControls(WatchCursor,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"WATCH\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:72,min:40,max:160,step:4,unit:\"px\"},fill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#171717\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WatchCursor\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WatchCursor.map"],"mappings":"ySAGG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,QAAQ,OAAK,GAAG,OAAK,UAAU,YAAU,UAAU,SAAO,EAAY,EAAS,EAAoB,EAAQ,EAAc,EAAiB,EAAQ,EAAQA,EAAO,IAAI,EAAO,CAAC,EAAQ,GAAYC,EAAS,EAAK,EAAQ,EAAWD,EAAO,EAAK,EAAQ,EAAK,EAAe,CAAC,EAAQ,EAAK,EAAe,CAAC,EAC5V,EAAE,EAAU,EAAK,CAAC,UAAU,IAAI,QAAQ,GAAG,KAAK,EAAE,CAAC,EAAQ,EAAE,EAAU,EAAK,CAAC,UAAU,IAAI,QAAQ,GAAG,KAAK,EAAE,CAAC,EAAE,MAAc,CACpI,GADwI,GAA0B,IAAS,QACxK,CAAC,EAAO,aAAa,iBAAiB,CAAC,CAAC,QAAQ,OACnD,IAAM,MAAiB,CAAC,IAAM,EAAQ,EAAQ,SAAS,QAAQ,oBAAoB,GAAG,EAAQ,QAAQ,OAAO,GAAS,eAAe,QAAQ,oBAAoB,GAAG,GAAS,eAA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