{"version":3,"file":"Dots.AFa91uTP.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/euJyqok3j59rSaCbYY7j/ImuP6DbbDF13b25thiHW/Dots.js"],"sourcesContent":["/**\n * IMPORTANT NOTICE\n *\n * This code is provided by Stylokit INC for use exclusively in your own projects.\n * Redistribution of this code as a standalone product or for a fee is strictly prohibited.\n * You may only profit from your own projects that incorporate this code, and you may not disassemble,\n * modify, and sell the code in isolation from your project.\n *\n * By using this code, you agree to abide by these terms and conditions.\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect}from\"react\";import{Frame,addPropertyControls,ControlType}from\"framer\";/**\n * Made by Stylokit\n *\n * @framerDisableUnlink\n */export function BackgroundDotsPattern(props){const canvasRef=useRef(null);const tileCanvasRef=useRef(null);const dotSize=1// Fixed dot size\n;const{gapSize}=props;const drawTile=()=>{const tileCanvas=tileCanvasRef.current;const context=tileCanvas.getContext(\"2d\");const tileSize=dotSize+gapSize;// Set tile canvas size\ntileCanvas.width=tileSize;tileCanvas.height=tileSize;// Draw a single dot in the tile\ncontext.clearRect(0,0,tileSize,tileSize);context.fillStyle=props.color;context.beginPath();context.arc(dotSize/2,dotSize/2,dotSize/2,0,Math.PI*2);context.fill();};const applyPattern=()=>{const canvas=canvasRef.current;const context=canvas.getContext(\"2d\");const tileCanvas=tileCanvasRef.current;// Set main canvas dimensions\nconst width=canvas.offsetWidth;const height=canvas.offsetHeight;canvas.width=width;canvas.height=height;// Create a pattern using the tile\nconst pattern=context.createPattern(tileCanvas,\"repeat\");// Fill the main canvas with the pattern\ncontext.clearRect(0,0,width,height);context.fillStyle=pattern;context.fillRect(0,0,width,height);};useEffect(()=>{const canvas=canvasRef.current;const resizeObserver=new ResizeObserver(()=>{applyPattern()// Redraw pattern when canvas size changes\n;});resizeObserver.observe(canvas);// Initial draw\ndrawTile();applyPattern();return()=>resizeObserver.disconnect();},[gapSize,props.color]);return /*#__PURE__*/_jsxs(Frame,{size:\"100%\",background:\"transparent\",overflow:\"hidden\",style:{pointerEvents:\"auto\"},children:[/*#__PURE__*/_jsx(\"canvas\",{ref:tileCanvasRef,style:{display:\"none\"}}),/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{width:\"100%\",height:\"100%\",display:\"block\"}})]});}addPropertyControls(BackgroundDotsPattern,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:16,min:4}});\nexport const __FramerMetadata__ = {\"exports\":{\"BackgroundDotsPattern\":{\"type\":\"reactComponent\",\"name\":\"BackgroundDotsPattern\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Dots.map"],"mappings":"+LAaG,SAAgB,EAAsB,EAAM,CAAC,IAAM,EAAUA,EAAO,KAAK,CAAO,EAAcA,EAAO,KAAK,CACvG,CAAC,WAAS,EAAY,MAAa,CAAC,IAAM,EAAW,EAAc,QAAc,EAAQ,EAAW,WAAW,KAAK,CAAO,EAAS,EAAQ,EAClJ,EAAW,MAAM,EAAS,EAAW,OAAO,EAC5C,EAAQ,UAAU,EAAE,EAAE,EAAS,EAAS,CAAC,EAAQ,UAAU,EAAM,MAAM,EAAQ,WAAW,CAAC,EAAQ,IAAI,EAAQ,EAAE,EAAQ,EAAE,EAAQ,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,EAAQ,MAAM,EAAS,MAAiB,CAAC,IAAM,EAAO,EAAU,QAAc,EAAQ,EAAO,WAAW,KAAK,CAAO,EAAW,EAAc,QACzR,EAAM,EAAO,YAAkB,EAAO,EAAO,aAAa,EAAO,MAAM,EAAM,EAAO,OAAO,EACjG,IAAM,EAAQ,EAAQ,cAAc,EAAW,SAAS,CACxD,EAAQ,UAAU,EAAE,EAAE,EAAM,EAAO,CAAC,EAAQ,UAAU,EAAQ,EAAQ,SAAS,EAA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