{"version":3,"file":"ProximityGrid.Dpbx40HS.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/KSMFu7QtYDUZHdk4BY8v/jKiqInXFer5iIhMNXhId/ProximityGrid.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function PulseGrid(props){const{dotSize,gap,radius,baseColor,hoverColor,maxScale,disableOnMobile,disableOnTablet}=props;const containerRef=useRef(null);const[deviceType,setDeviceType]=useState(\"desktop\");// 1. Precise Device Detection\nuseEffect(()=>{const checkDevice=()=>{const width=window.innerWidth;if(width<810){setDeviceType(\"mobile\");}else if(width>=810&&width<1200){setDeviceType(\"tablet\");}else{setDeviceType(\"desktop\");}};checkDevice();window.addEventListener(\"resize\",checkDevice);return()=>window.removeEventListener(\"resize\",checkDevice);},[]);// 2. Mouse Tracking logic with Device Filtering\nuseEffect(()=>{const isDeviceDisabled=disableOnMobile&&deviceType===\"mobile\"||disableOnTablet&&deviceType===\"tablet\";if(isDeviceDisabled)return;const handleMove=e=>{if(!containerRef.current)return;const rect=containerRef.current.getBoundingClientRect();const x=e.clientX-rect.left;const y=e.clientY-rect.top;window.requestAnimationFrame(()=>{if(containerRef.current){containerRef.current.style.setProperty(\"--x\",`${x}px`);containerRef.current.style.setProperty(\"--y\",`${y}px`);}});};window.addEventListener(\"mousemove\",handleMove,{passive:true});return()=>window.removeEventListener(\"mousemove\",handleMove);},[deviceType,disableOnMobile,disableOnTablet]);// SVG Pattern generator\nconst svgPattern=(color,size)=>`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${gap}' height='${gap}'%3E%3Ccircle cx='${gap/2}' cy='${gap/2}' r='${size/2}' fill='${encodeURIComponent(color)}'/%3E%3C/svg%3E\")`;// Determine if we should render the hover layer\nconst showHoverLayer=!(disableOnMobile&&deviceType===\"mobile\"||disableOnTablet&&deviceType===\"tablet\");return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"absolute\",inset:0,zIndex:0,pointerEvents:\"none\",backgroundColor:\"transparent\",\"--x\":\"-1000px\",\"--y\":\"-1000px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundImage:svgPattern(baseColor,dotSize),backgroundRepeat:\"repeat\",backgroundPosition:\"center\",pointerEvents:\"none\"}}),showHoverLayer&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundImage:svgPattern(hoverColor,dotSize*maxScale),backgroundRepeat:\"repeat\",backgroundPosition:\"center\",pointerEvents:\"none\",WebkitMaskImage:`radial-gradient(circle ${radius}px at var(--x) var(--y), black 0%, transparent 100%)`,maskImage:`radial-gradient(circle ${radius}px at var(--x) var(--y), black 0%, transparent 100%)`}})]});}PulseGrid.defaultProps={dotSize:2,gap:24,radius:150,maxScale:2.5,baseColor:\"rgba(0,0,0,0.1)\",hoverColor:\"#005ef3\",disableOnMobile:true,disableOnTablet:false};addPropertyControls(PulseGrid,{baseColor:{type:ControlType.Color},hoverColor:{type:ControlType.Color},dotSize:{type:ControlType.Number,min:1,max:10},maxScale:{type:ControlType.Number,min:1,max:10,step:.1},gap:{type:ControlType.Number,min:10,max:100},radius:{type:ControlType.Number,min:50,max:500},disableOnMobile:{type:ControlType.Boolean,title:\"Disable on Mobile\"},disableOnTablet:{type:ControlType.Boolean,title:\"Disable on Tablet\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PulseGrid\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProximityGrid.map"],"mappings":"6MAA0J,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,UAAQ,MAAI,SAAO,YAAU,aAAW,WAAS,kBAAgB,mBAAiB,EAAY,EAAaA,EAAO,IAAI,EAAO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