{"version":3,"file":"MeshGradientBrian.Do1Td00o.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/qmP1pebFQXumgdyh3Iam/glNsfvPskCfarJsQCsrn/MeshGradientBrian.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";let probeElement=null;// Resolves any CSS color string to its rgba channels so a transparent version\n// of it can be built for the outer gradient stop. Goes through a real DOM\n// element (not the canvas) because canvas `fillStyle` cannot resolve CSS\n// variables, which is what Framer's color-variable picker produces.\nfunction resolveColorChannels(color){if(typeof document===\"undefined\")return[255,255,255,1];if(!probeElement){probeElement=document.createElement(\"div\");probeElement.style.position=\"absolute\";probeElement.style.visibility=\"hidden\";probeElement.style.pointerEvents=\"none\";probeElement.style.top=\"-9999px\";probeElement.style.left=\"-9999px\";document.body.appendChild(probeElement);}probeElement.style.color=color;const computed=getComputedStyle(probeElement).color;const match=computed.match(/rgba?\\(([^)]+)\\)/i);if(!match)return[255,255,255,1];const[r,g,b,a=1]=match[1].split(\",\").map(Number);return[r,g,b,Number.isFinite(a)?a:1];}const defaultColors=[{color:\"#5318EB\",useGradient:false,gradientColor:\"#C6A5FF\",x:25,y:30,radius:440,squash:0,rotation:0},{color:\"#280F62\",useGradient:false,gradientColor:\"#5318EB\",x:78,y:20,radius:400,squash:.3,rotation:20},{color:\"#C6A5FF\",useGradient:false,gradientColor:\"#280F62\",x:70,y:75,radius:480,squash:.2,rotation:-15},{color:\"#C4EE87\",useGradient:false,gradientColor:\"#5318EB\",x:20,y:80,radius:360,squash:0,rotation:0}];/**\n * Mesh Gradient Brian\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function MeshGradientBrian(props){const{baseColor=\"#0C021C\",colors=defaultColors,blur=60,style}=props;const containerRef=useRef(null);const canvasRef=useRef(null);const isStatic=useIsStaticRenderer();const draw=useCallback(()=>{const container=containerRef.current;const canvas=canvasRef.current;if(!container||!canvas)return;const{width,height}=container.getBoundingClientRect();if(width===0||height===0)return;const dpr=typeof window!==\"undefined\"?window.devicePixelRatio||1:1;canvas.width=width*dpr;canvas.height=height*dpr;const ctx=canvas.getContext(\"2d\");if(!ctx)return;ctx.setTransform(dpr,0,0,dpr,0,0);ctx.clearRect(0,0,width,height);const[baseR,baseG,baseB,baseA]=resolveColorChannels(baseColor);ctx.fillStyle=`rgba(${baseR}, ${baseG}, ${baseB}, ${baseA})`;ctx.fillRect(0,0,width,height);for(const stop of colors){const cx=stop.x/100*width;const cy=stop.y/100*height;const radius=Math.max(stop.radius,1);const squash=1+Math.max(stop.squash??0,0);const rotation=(stop.rotation??0)*Math.PI/180;const[r,g,b,a]=resolveColorChannels(stop.color);ctx.save();ctx.translate(cx,cy);ctx.rotate(rotation);ctx.scale(1,squash);const gradient=ctx.createRadialGradient(0,0,0,0,0,radius);gradient.addColorStop(0,`rgba(${r}, ${g}, ${b}, ${a})`);if(stop.useGradient){const[r2,g2,b2,a2]=resolveColorChannels(stop.gradientColor);gradient.addColorStop(.6,`rgba(${r2}, ${g2}, ${b2}, ${a2})`);gradient.addColorStop(1,`rgba(${r2}, ${g2}, ${b2}, 0)`);}else{gradient.addColorStop(1,`rgba(${r}, ${g}, ${b}, 0)`);}ctx.fillStyle=gradient;ctx.beginPath();ctx.arc(0,0,radius,0,Math.PI*2);ctx.fill();ctx.restore();}},[baseColor,colors]);useEffect(()=>{draw();if(isStatic||typeof ResizeObserver===\"undefined\"||!containerRef.current)return;const observer=new ResizeObserver(()=>draw());observer.observe(containerRef.current);return()=>observer.disconnect();},[draw,isStatic]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",display:\"block\",// Applied as a CSS filter on the element instead of\n// ctx.filter inside the canvas: WebKit (Safari/Edge on\n// iPadOS) has spotty support for Canvas2D's `filter`\n// property, but element-level CSS `filter` is solid\n// across engines.\nfilter:blur>0?`blur(${blur}px)`:\"none\"}})});}MeshGradientBrian.displayName=\"Mesh Gradient Brian\";addPropertyControls(MeshGradientBrian,{baseColor:{type:ControlType.Color,title:\"Base Color\",defaultValue:\"#0C021C\"},blur:{type:ControlType.Number,title:\"Blur\",description:\"Softens how the colors blend into each other and into the base color.\",defaultValue:60,min:0,max:200,step:1,unit:\"px\"},colors:{type:ControlType.Array,title:\"Colors\",control:{type:ControlType.Object,title:\"Color\",controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#5318EB\"},useGradient:{type:ControlType.Boolean,title:\"Gradient\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},gradientColor:{type:ControlType.Color,title:\"Gradient Color\",defaultValue:\"#C6A5FF\",hidden:stopProps=>!stopProps.useGradient},x:{type:ControlType.Number,title:\"X Position\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},y:{type:ControlType.Number,title:\"Y Position\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},radius:{type:ControlType.Number,title:\"Radius\",description:\"Fixed pixel size — stays constant as the component is resized.\",defaultValue:200,min:1,max:600,step:5,unit:\"px\"},squash:{type:ControlType.Number,title:\"Squash\",description:\"0 keeps it circular, higher values stretch it taller.\",defaultValue:0,min:0,max:2,step:.05},rotation:{type:ControlType.Number,title:\"Rotation\",defaultValue:0,min:-180,max:180,step:1,unit:\"deg\"}}},defaultValue:defaultColors,maxCount:12}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MeshGradientBrian\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"600\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayo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