{"version":3,"file":"Spiral.CPBZ95Qi.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/VpkXrHDg8V7zkqNIQBoY/GtbwxUyEM00ot0IvE5vR/Spiral.js"],"sourcesContent":["// Spiral dot animation component with configurable properties\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Spiral(props){const{totalDots=600,dotRadius=2,duration=3,dotColor=\"#FFFFFF\",backgroundColor=\"#000000\",margin=2,minOpacity=.3,maxOpacity=1,minScale=.5,maxScale=1.5,useMultipleColors=false,colors=[{color:\"#FF0000\"},{color:\"#00FF00\"},{color:\"#0000FF\"}]}=props;const svgRef=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(!svgRef.current)return;const svg=svgRef.current;const SIZE=400;const GOLDEN_ANGLE=Math.PI*(3-Math.sqrt(5));const CENTER=SIZE/2;const MAX_RADIUS=CENTER-margin-dotRadius;// Clear existing content\nsvg.innerHTML=\"\";// Generate dots\nfor(let i=0;i<totalDots;i++){const idx=i+.5;const frac=idx/totalDots;const r=Math.sqrt(frac)*MAX_RADIUS;const theta=idx*GOLDEN_ANGLE;const x=CENTER+r*Math.cos(theta);const y=CENTER+r*Math.sin(theta);// Determine dot color\nlet currentColor=dotColor;if(useMultipleColors&&colors.length>0){const colorIndex=Math.floor(frac*colors.length);currentColor=colors[Math.min(colorIndex,colors.length-1)].color;}// Create circle\nconst circle=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");circle.setAttribute(\"cx\",x.toString());circle.setAttribute(\"cy\",y.toString());circle.setAttribute(\"r\",dotRadius.toString());circle.setAttribute(\"fill\",currentColor);circle.setAttribute(\"opacity\",isStatic?\"0.7\":\"0\");if(!isStatic){// Color animation for multiple colors\nif(useMultipleColors&&colors.length>1){const colorValues=colors.map(c=>c.color).join(\";\");const animColor=document.createElementNS(\"http://www.w3.org/2000/svg\",\"animate\");animColor.setAttribute(\"attributeName\",\"fill\");animColor.setAttribute(\"values\",colorValues);animColor.setAttribute(\"dur\",`${duration}s`);animColor.setAttribute(\"begin\",`${frac*duration}s`);animColor.setAttribute(\"repeatCount\",\"indefinite\");animColor.setAttribute(\"calcMode\",\"linear\");circle.appendChild(animColor);}// Radius animation\nconst animR=document.createElementNS(\"http://www.w3.org/2000/svg\",\"animate\");animR.setAttribute(\"attributeName\",\"r\");animR.setAttribute(\"values\",`${dotRadius*minScale};${dotRadius*maxScale};${dotRadius*minScale}`);animR.setAttribute(\"dur\",`${duration}s`);animR.setAttribute(\"begin\",`${frac*duration}s`);animR.setAttribute(\"repeatCount\",\"indefinite\");animR.setAttribute(\"calcMode\",\"spline\");animR.setAttribute(\"keySplines\",\"0.4 0 0.6 1;0.4 0 0.6 1\");circle.appendChild(animR);// Opacity animation\nconst animO=document.createElementNS(\"http://www.w3.org/2000/svg\",\"animate\");animO.setAttribute(\"attributeName\",\"opacity\");animO.setAttribute(\"values\",`${minOpacity};${maxOpacity};${minOpacity}`);animO.setAttribute(\"dur\",`${duration}s`);animO.setAttribute(\"begin\",`${frac*duration}s`);animO.setAttribute(\"repeatCount\",\"indefinite\");animO.setAttribute(\"calcMode\",\"spline\");animO.setAttribute(\"keySplines\",\"0.4 0 0.6 1;0.4 0 0.6 1\");circle.appendChild(animO);}svg.appendChild(circle);}},[totalDots,dotRadius,duration,dotColor,backgroundColor,margin,minOpacity,maxOpacity,minScale,maxScale,isStatic,useMultipleColors,colors]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",...props.style},children:/*#__PURE__*/_jsx(\"svg\",{ref:svgRef,width:\"400\",height:\"400\",viewBox:\"0 0 400 400\",style:{maxWidth:\"100%\",maxHeight:\"100%\",width:\"auto\",height:\"auto\"}})});}Spiral.displayName=\"Spiral\";addPropertyControls(Spiral,{totalDots:{type:ControlType.Number,title:\"Total Dots\",defaultValue:600,min:50,max:1e3,step:10},dotRadius:{type:ControlType.Number,title:\"Dot Radius\",defaultValue:2,min:.5,max:10,step:.1,unit:\"px\"},duration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:3,min:.5,max:10,step:.1,unit:\"s\"},useMultipleColors:{type:ControlType.Boolean,title:\"Multiple Colors\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},colors:{type:ControlType.Array,title:\"Colors\",control:{type:ControlType.Object,controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"}}},defaultValue:[{color:\"#FF0000\"},{color:\"#00FF00\"},{color:\"#0000FF\"}],maxCount:10,hidden:({useMultipleColors})=>!useMultipleColors},dotColor:{type:ControlType.Color,title:\"Dot Color\",defaultValue:\"#FFFFFF\",hidden:({useMultipleColors})=>useMultipleColors},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#000000\"},margin:{type:ControlType.Number,title:\"Margin\",defaultValue:2,min:0,max:20,step:1,unit:\"px\"},minOpacity:{type:ControlType.Number,title:\"Min Opacity\",defaultValue:.3,min:0,max:1,step:.1},maxOpacity:{type:ControlType.Number,title:\"Max Opacity\",defaultValue:1,min:0,max:1,step:.1},minScale:{type:ControlType.Number,title:\"Min Scale\",defaultValue:.5,min:.1,max:2,step:.1},maxScale:{type:ControlType.Number,title:\"Max Scale\",defaultValue:1.5,min:.1,max:3,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Spiral\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Spiral.map"],"mappings":"0LAIG,SAAwB,EAAO,EAAM,CAAC,GAAK,CAAC,YAAU,IAAI,YAAU,EAAE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