{"version":3,"file":"CursorCompass.CICR8jtL.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/6bwrxMXhLkp6d2WMS3tg/jKTrDi4EqbGd6gUT2A5I/CursorCompass.js"],"sourcesContent":["// OFF MAP — Cursor Compass\n// A vintage compass whose needle always points at the visitor's cursor (or wanders on touch).\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useMotionValue,useSpring,useTransform}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 320\n */export default function CursorCompass(props){const{ringColor=\"#101A15\",needleColor=\"#FF5A1F\",tailColor=\"#101A15\",textColor=\"#101A15\",showBearing=true,style}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const angle=useMotionValue(35);const smooth=useSpring(angle,{stiffness:60,damping:9,mass:.8});const rotate=useTransform(smooth,v=>`rotate(${v}deg)`);const[bearing,setBearing]=useState(35);useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;let last=35;let lastMove=0;const setA=deg=>{// unwrap so the needle takes the short way round\nlet d=deg-(last%360+360)%360;if(d>180)d-=360;if(d<-180)d+=360;last=last+d;angle.set(last);startTransition(()=>setBearing(Math.round((deg%360+360)%360)));};const onMove=e=>{const el=ref.current;if(!el)return;lastMove=performance.now();const r=el.getBoundingClientRect();const dx=e.clientX-(r.left+r.width/2);const dy=e.clientY-(r.top+r.height/2);setA(Math.atan2(dx,-dy)*180/Math.PI);};window.addEventListener(\"pointermove\",onMove,{passive:true});const id=window.setInterval(()=>{if(performance.now()-lastMove<3e3)return;setA(last+(Math.random()-.5)*120);},1800);return()=>{window.removeEventListener(\"pointermove\",onMove);window.clearInterval(id);};},[isStatic]);const ticks=Array.from({length:72},(_,i)=>i);const cardinals=[[\"N\",0],[\"E\",90],[\"S\",180],[\"W\",270]];return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{...style,position:\"relative\",width:\"100%\",height:\"100%\"},\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsxs(\"svg\",{viewBox:\"0 0 200 200\",width:\"100%\",height:\"100%\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"100\",cy:\"100\",r:\"96\",fill:\"none\",stroke:ringColor,strokeWidth:\"1.5\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"100\",cy:\"100\",r:\"80\",fill:\"none\",stroke:ringColor,strokeOpacity:\"0.25\",strokeWidth:\"1\"}),ticks.map(i=>/*#__PURE__*/_jsx(\"line\",{x1:\"100\",y1:i%9===0?6:8,x2:\"100\",y2:i%9===0?18:13,stroke:ringColor,strokeOpacity:i%9===0?1:.45,strokeWidth:i%9===0?1.5:.8,transform:`rotate(${i*5} 100 100)`},i)),cardinals.map(([l,a])=>/*#__PURE__*/_jsx(\"text\",{x:\"100\",y:\"34\",textAnchor:\"middle\",fontFamily:'\"Instrument Serif\", serif',fontSize:\"18\",fill:l===\"N\"?needleColor:textColor,transform:`rotate(${a} 100 100)`,children:l},l)),/*#__PURE__*/_jsxs(motion.g,{style:{transform:rotate,transformOrigin:\"100px 100px\"},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M100 38 L108 100 L100 108 L92 100 Z\",fill:needleColor}),/*#__PURE__*/_jsx(\"path\",{d:\"M100 162 L108 100 L100 92 L92 100 Z\",fill:tailColor})]}),/*#__PURE__*/_jsx(\"circle\",{cx:\"100\",cy:\"100\",r:\"5\",fill:ringColor}),/*#__PURE__*/_jsx(\"circle\",{cx:\"100\",cy:\"100\",r:\"2\",fill:needleColor})]}),showBearing&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:0,right:0,bottom:\"-2.2em\",textAlign:\"center\",fontFamily:'\"Geist Mono\", monospace',fontSize:12,letterSpacing:\"0.1em\",color:textColor},children:[\"BEARING \",String(bearing).padStart(3,\"0\"),\"\\xb0\"]})]});}addPropertyControls(CursorCompass,{ringColor:{type:ControlType.Color,title:\"Ring\",defaultValue:\"#101A15\"},needleColor:{type:ControlType.Color,title:\"Needle\",defaultValue:\"#FF5A1F\"},tailColor:{type:ControlType.Color,title:\"Tail\",defaultValue:\"#101A15\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#101A15\"},showBearing:{type:ControlType.Boolean,title:\"Bearing\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CursorCompass\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"320\",\"framerIntrinsicHeight\":\"320\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CursorCompass.map"],"mappings":"kSAOG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,YAAU,UAAU,cAAY,UAAU,YAAU,UAAU,YAAU,UAAU,cAAY,GAAK,SAAO,EAAY,EAAS,EAAoB,EAAQ,EAAIA,EAAO,IAAI,EAAQ,EAAM,EAAe,EAAE,EAAuE,EAAO,EAA/D,EAAU,EAAM,CAAC,UAAU,GAAG,QAAQ,EAAE,KAAK,EAAE,CAAkC,EAAE,GAAG,UAAU,EAAE,KAAK,EAAO,CAAC,EAAQ,GAAYC,EAAS,EAAE,EAAE,MAAc,CAAC,GAAG,GAAiB,IAAS,OAAY,OAAO,IAAI,EAAK,GAAO,EAAS,EAAQ,EAAK,GAAK,CACxgB,IAAI,EAAE,GAAK,EAAK,IAAI,KAAK,IAAO,EAAE,MAAI,GAAG,KAAO,EAAE,OAAK,GAAG,KAAI,GAAU,EAAE,EAAM,IAAI,CAAI,EAAE,MAAoB,EAAW,KAAK,OAAO,EAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAE,EAAQ,EAAO,GAAG,CAAC,IAAM,EAAG,EAAI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