{"version":3,"file":"HeroDotGrid.BMsFgDoN.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/PWohcvEHP3FjU1IDaexJ/7OUaz2YVRfSciJqJmNi9/HeroDotGrid.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useRef,useEffect}from\"react\";/**\n * Hero Dot Grid — a dotted-grid texture that fills its container. Optional\n * cursor spotlight (`hover`): dots near the pointer brighten within a soft\n * radius that follows the cursor (tracked window-wide, so it works even when the\n * grid sits behind other content).\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n * @framerDisableUnlink\n */export default function HeroDotGrid(props){const{color=\"rgba(255,255,255,0.05)\",spacing=22,hover=false,hoverColor=\"rgba(159,164,242,0.55)\",hoverRadius=200}=props;const isStatic=useIsStaticRenderer();const wrapRef=useRef(null);const spotRef=useRef(null);useEffect(()=>{if(!hover||isStatic)return;const wrap=wrapRef.current;const spot=spotRef.current;if(!wrap||!spot)return;let raf=0,cx=0,cy=0;const apply=()=>{raf=0;const r=wrap.getBoundingClientRect();const x=cx-r.left,y=cy-r.top;const inside=x>=-60&&y>=-60&&x<=r.width+60&&y<=r.height+60;spot.style.setProperty(\"--mx\",x+\"px\");spot.style.setProperty(\"--my\",y+\"px\");spot.style.opacity=inside?\"1\":\"0\";};const onMove=e=>{cx=e.clientX;cy=e.clientY;if(!raf)raf=requestAnimationFrame(apply);};window.addEventListener(\"mousemove\",onMove,{passive:true});return()=>{window.removeEventListener(\"mousemove\",onMove);if(raf)cancelAnimationFrame(raf);};},[hover,isStatic]);const dots=c=>({position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",backgroundImage:`radial-gradient(${c} 1px, transparent 1px)`,backgroundSize:`${spacing}px ${spacing}px`,backgroundPosition:\"-1px -1px\"});if(!hover){return /*#__PURE__*/_jsx(\"div\",{style:{...dots(color),position:\"relative\",...props.style}});}const mask=`radial-gradient(circle ${hoverRadius}px at var(--mx,-999px) var(--my,-999px), #000 0%, rgba(0,0,0,0.35) 48%, transparent 74%)`;return /*#__PURE__*/_jsxs(\"div\",{ref:wrapRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",...props.style},children:[/*#__PURE__*/_jsx(\"div\",{style:dots(color)}),/*#__PURE__*/_jsx(\"div\",{ref:spotRef,style:{...dots(hoverColor),opacity:0,transition:\"opacity .35s ease\",WebkitMaskImage:mask,maskImage:mask}})]});}addPropertyControls(HeroDotGrid,{color:{type:ControlType.Color,title:\"Dot color\",defaultValue:\"rgba(255,255,255,0.05)\"},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:22,min:10,max:60},hover:{type:ControlType.Boolean,title:\"Cursor glow\",defaultValue:false},hoverColor:{type:ControlType.Color,title:\"Glow dot color\",defaultValue:\"rgba(159,164,242,0.55)\"},hoverRadius:{type:ControlType.Number,title:\"Glow radius\",defaultValue:200,min:60,max:500}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HeroDotGrid\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"600\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeroDotGrid.map"],"mappings":"8MAUG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,yBAAyB,UAAQ,GAAG,QAAM,GAAM,aAAW,yBAAyB,cAAY,KAAK,EAAY,EAAS,EAAoB,EAAQ,EAAQA,EAAO,IAAI,EAAQ,EAAQA,EAAO,IAAI,EAAE,MAAc,CAAC,GAAG,CAAC,GAAO,EAAS,OAAO,IAAM,EAAK,EAAQ,QAAc,EAAK,EAAQ,QAAQ,GAAG,CAAC,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