{"version":3,"file":"Gradient.B-eTqmSA.mjs","names":["useRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/xwH9Ahmo5QjVu3aV4OTV/5RXEObulCGyntGFgpWWE/Gradient.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useMotionValue,useSpring,useTransform}from\"framer-motion\";import{useRef,useCallback,useState}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function GradientBackground(props){const{// Colors\ncolor1,color2,backgroundColor,// Blob sizes (as percentage of container)\nblob1Size,blob2Size,// Blur amount (base value, will scale with container)\nblurAmount,// Mouse interaction\nmouseInfluence,smoothing,// Ambient animation\nanimationSpeed,animationRange}=props;const containerRef=useRef(null);const[containerSize,setContainerSize]=useState(800);// Calculate scale factor based on container size\nconst scale=Math.max(.3,containerSize/800);const scaledBlur=blurAmount*scale;const scaledRange=animationRange*scale;const scaledMouseInfluence=mouseInfluence*scale;// Mouse position as motion values (0-1 range, centered at 0.5)\nconst mouseX=useMotionValue(.5);const mouseY=useMotionValue(.5);// Smooth spring animation for mouse following\nconst springConfig={stiffness:smoothing,damping:smoothing*.6};const smoothX=useSpring(mouseX,springConfig);const smoothY=useSpring(mouseY,springConfig);// Transform mouse position to blob offset\nconst cursorOffset1X=useTransform(smoothX,[0,1],[-scaledMouseInfluence,scaledMouseInfluence]);const cursorOffset1Y=useTransform(smoothY,[0,1],[-scaledMouseInfluence,scaledMouseInfluence]);// Blob 2 moves similarly but with slight variation for organic layered feel\nconst cursorOffset2X=useTransform(smoothX,[0,1],[-scaledMouseInfluence*.85,scaledMouseInfluence*.85]);const cursorOffset2Y=useTransform(smoothY,[0,1],[-scaledMouseInfluence*.9,scaledMouseInfluence*.9]);// Handle mouse move\nconst handleMouseMove=useCallback(event=>{if(!containerRef.current)return;const rect=containerRef.current.getBoundingClientRect();const x=(event.clientX-rect.left)/rect.width;const y=(event.clientY-rect.top)/rect.height;mouseX.set(x);mouseY.set(y);},[mouseX,mouseY]);// Reset to center when mouse leaves\nconst handleMouseLeave=useCallback(()=>{mouseX.set(.5);mouseY.set(.5);},[mouseX,mouseY]);// Handle container resize\nconst handleContainerRef=useCallback(node=>{containerRef.current=node;if(node){const rect=node.getBoundingClientRect();setContainerSize(Math.min(rect.width,rect.height));// Set up resize observer\nconst resizeObserver=new ResizeObserver(entries=>{for(const entry of entries){const{width,height}=entry.contentRect;setContainerSize(Math.min(width,height));}});resizeObserver.observe(node);return()=>resizeObserver.disconnect();}},[]);// Ambient animation - always running, combined with cursor\nconst ambientAnimation1={x:[0,scaledRange,-scaledRange*.5,0],y:[0,scaledRange*.8,-scaledRange*.7,0]};const ambientAnimation2={x:[0,-scaledRange*.9,scaledRange*.6,0],y:[0,scaledRange*.7,-scaledRange*.5,0]};const ambientTransition={duration:animationSpeed,repeat:Infinity,ease:[.42,0,.58,1]};return /*#__PURE__*/_jsxs(\"div\",{ref:handleContainerRef,onMouseMove:handleMouseMove,onMouseLeave:handleMouseLeave,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"visible\",backgroundColor:backgroundColor},children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",width:`${blob1Size}%`,height:`${blob1Size}%`,borderRadius:\"50%\",backgroundColor:color1,filter:`blur(${scaledBlur}px)`,top:\"20%\",left:\"10%\",x:cursorOffset1X,y:cursorOffset1Y,willChange:\"transform\"},animate:ambientAnimation1,transition:ambientTransition}),/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",width:`${blob2Size}%`,height:`${blob2Size}%`,borderRadius:\"50%\",backgroundColor:color2,filter:`blur(${scaledBlur}px)`,bottom:\"15%\",right:\"5%\",x:cursorOffset2X,y:cursorOffset2Y,willChange:\"transform\"},animate:ambientAnimation2,transition:{...ambientTransition,delay:animationSpeed*.3}})]});}addPropertyControls(GradientBackground,{// Color controls\ncolor1:{title:\"Blob 1 Color\",type:ControlType.Color,defaultValue:\"#A7F3D0\"},color2:{title:\"Blob 2 Color\",type:ControlType.Color,defaultValue:\"#BAE6FD\"},backgroundColor:{title:\"Background\",type:ControlType.Color,defaultValue:\"#FFFFFF\"},// Size controls\nblob1Size:{title:\"Blob 1 Size\",type:ControlType.Number,defaultValue:60,min:20,max:150,step:5,unit:\"%\"},blob2Size:{title:\"Blob 2 Size\",type:ControlType.Number,defaultValue:50,min:20,max:150,step:5,unit:\"%\"},// Blur (scales with container)\nblurAmount:{title:\"Blur Amount\",type:ControlType.Number,defaultValue:200,min:50,max:400,step:10,unit:\"px\",description:\"Base blur at 800px container, scales responsively\"},// Mouse interaction\nmouseInfluence:{title:\"Mouse Influence\",type:ControlType.Number,defaultValue:50,min:0,max:200,step:5,description:\"How much blobs follow cursor\"},smoothing:{title:\"Smoothing\",type:ControlType.Number,defaultValue:50,min:10,max:200,step:10,description:\"Higher = snappier cursor response\"},// Ambient animation (always on)\nanimationSpeed:{title:\"Ambient Speed\",type:ControlType.Number,defaultValue:20,min:5,max:60,step:1,unit:\"s\",description:\"Duration of one ambient cycle\"},animationRange:{title:\"Ambient Range\",type:ControlType.Number,defaultValue:30,min:10,max:100,step:5,unit:\"px\",description:\"How far blobs drift (scales with container)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientBackground\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Gradient.map"],"mappings":"sQAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAC1D,SAAO,SAAO,kBACd,YAAU,YACV,aACA,iBAAe,YACf,iBAAe,kBAAgB,EAAY,EAAaA,EAAO,KAAK,CAAM,CAAC,EAAc,GAAkBC,EAAS,IAAI,CAClH,EAAM,KAAK,IAAI,GAAG,EAAc,IAAI,CAAO,EAAW,EAAW,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