{"version":3,"file":"MeshGradientBrian.qptUJsft.mjs","names":["useRef","useCallback","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","de","init_jsx_runtime","ne","ce","useIsStaticRenderer","addPropertyControls","init_framer_BL9pqxmF","ControlType","resolveColorChannels","probeElement","color","match","r","g","b","MeshGradientBrian","defaultColors","props","containerRef","canvasRef","isStatic","draw","container","canvas","width","height","dpr","ctx","baseR","baseG","baseB","baseA","baseColor","stop","colors","cx","cy","radius","squash","rotation","a","gradient","r2","g2","b2","a2","observer","style","blur","init_MeshGradientBrian","stopProps"],"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\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MeshGradientBrian.map"],"mappings":"A,yMAIA,SAASc,EAAqB,EAAM,CAAC,GAAG,OAAO,SAAW,IAAY,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,EAAMC,IAAc,EAAa,SAAS,cAAc,KAAK,EAAE,EAAa,MAAM,SAAS,WAAW,EAAa,MAAM,WAAW,SAAS,EAAa,MAAM,cAAc,OAAO,EAAa,MAAM,IAAI,UAAU,EAAa,MAAM,KAAK,UAAU,SAAS,KAAK,YAAYA,CAAY,GAAG,EAAa,MAAM,MAAMC,EAA0D,IAAMC,EAA3C,iBAAiBF,CAAY,CAAC,CAAC,MAA2B,MAAM,mBAAmB,EAAE,GAAG,CAACE,EAAM,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,GAAK,CAACC,EAAEC,EAAEC,EAAE,EAAE,GAAGH,EAAM,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,EAAE,MAAM,CAACC,EAAEC,EAAEC,EAAE,OAAO,SAAS,CAAC,EAAE,EAAE,CAAC,CAAE,CAQjnB,SAAwBC,EAAkB,EAAM,CAAC,GAAK,CAAC,YAAU,UAAU,SAAOC,EAAc,OAAK,GAAG,SAAOC,EAAYC,EAAaxB,EAAO,IAAI,EAAQyB,EAAUzB,EAAO,IAAI,EAAQ0B,EAAShB,EAAoB,EAAQiB,EAAK1B,MAAgB,CA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