{"version":3,"file":"AnimatedGradientBackground.LDPFAv7F.mjs","names":["useRef","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/bTu1yXSG5zVcQZAw6w5C/2lr2irXA1iRKx303rJk7/AnimatedGradientBackground.js"],"sourcesContent":["// Moving gradient background that matches the attached image, with slow color animation and fades to white at the bottom and left\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useMemo,useCallback}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";/**\n * AnimatedGradientBackground\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */function AnimatedGradientBackground(props){const{color1,color2,color3,animationDuration,style,noiseIntensity}=props;const c1=color1,c2=color2,c3=color3;const isStatic=useIsStaticRenderer();const ref=useRef(null);const isInView=useInView(ref,{margin:\"100px\"});// Memoize noise texture generation with better performance\nconst noiseDataUrl=useMemo(()=>{if(typeof window===\"undefined\")return\"\";// Responsive noise canvas size\nconst base=32;let canvasSize=base;if(typeof window!==\"undefined\"){const dpr=window.devicePixelRatio||1;canvasSize=Math.round(base*dpr);}const canvas=document.createElement(\"canvas\");canvas.width=canvasSize;canvas.height=canvasSize;const ctx=canvas.getContext(\"2d\");const imageData=ctx.createImageData(canvasSize,canvasSize);for(let i=0;i<imageData.data.length;i+=4){const noise=Math.random()*255;imageData.data[i]=noise// R\n;imageData.data[i+1]=noise// G\n;imageData.data[i+2]=noise// B\n;imageData.data[i+3]=noiseIntensity*255// A\n;}ctx.putImageData(imageData,0,0);return canvas.toDataURL();},[noiseIntensity]);// Optimized animation with better performance\nconst animateGradient=useCallback(()=>{if(!ref.current||isStatic||!isInView)return;let frameId;let lastTime=0;const targetFPS=24// Lower FPS for less CPU/GPU usage\n;const frameInterval=1e3/targetFPS;function animate(currentTime){if(currentTime-lastTime>=frameInterval){const elapsed=currentTime/1e3;const t=elapsed/animationDuration;// Responsive amplitude based on container size\nlet width=1,height=1;if(ref.current){width=ref.current.offsetWidth||1;height=ref.current.offsetHeight||1;}const aspect=width/height;const angle=110+120*Math.sin(t*Math.PI*2)*(aspect>1?1:aspect);const x=60+60*Math.sin(t*Math.PI*1.5)*(aspect<1?1:1/aspect);const y=40+60*Math.cos(t*Math.PI*1.2)*(aspect>1?1:aspect);if(ref.current){ref.current.style.background=`linear-gradient(${angle}deg, ${c1} 0%, ${c2} ${x}%, ${c3} ${y}%, #fff 100%)`;}lastTime=currentTime;}if(isInView&&!isStatic){frameId=requestAnimationFrame(animate);}}frameId=requestAnimationFrame(animate);return()=>{if(frameId)cancelAnimationFrame(frameId);};},[c1,c2,c3,animationDuration,isStatic,isInView]);// Start/stop animation based on visibility\nuseEffect(()=>{if(isStatic)return;if(isInView){return animateGradient();}},[animateGradient,isInView,isStatic]);// Improved static gradient fallback\nconst staticGradient=useMemo(()=>{// Responsive static gradient for different aspect ratios\nlet width=1,height=1;if(ref.current){width=ref.current.offsetWidth||1;height=ref.current.offsetHeight||1;}const aspect=width/height;const angle=110+60*(aspect>1?1:aspect);const x=60+30*(aspect<1?1:1/aspect);const y=40+30*(aspect>1?1:aspect);return`linear-gradient(${angle}deg, ${c1} 0%, ${c2} ${x}%, ${c3} ${y}%, #fff 100%)`;},[c1,c2,c3]);return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",background:staticGradient,overflow:\"hidden\",filter:\"blur(160px)\",zIndex:1,willChange:isInView&&!isStatic?\"background\":\"auto\"},children:[noiseDataUrl&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,backgroundImage:`url(${noiseDataUrl})`,backgroundRepeat:\"repeat\",backgroundSize:\"calc(16px + 2vw) calc(16px + 2vh)\",mixBlendMode:\"overlay\",pointerEvents:\"none\",zIndex:5}}),/*#__PURE__*/_jsx(\"div\",{style:{pointerEvents:\"none\",position:\"absolute\",left:0,right:0,bottom:0,height:\"40%\",background:\"linear-gradient(0deg, #fff 0%, transparent 100%)\",zIndex:10}}),/*#__PURE__*/_jsx(\"div\",{style:{pointerEvents:\"none\",position:\"absolute\",top:0,left:0,bottom:0,width:\"30%\",background:\"linear-gradient(90deg, #fff 0%, transparent 100%)\",zIndex:10}})]});}addPropertyControls(AnimatedGradientBackground,{color1:{type:ControlType.Color,title:\"Top Left\",defaultValue:\"#eaf7d2\"},color2:{type:ControlType.Color,title:\"Top Center\",defaultValue:\"#e3f7e2\"},color3:{type:ControlType.Color,title:\"Top Right\",defaultValue:\"#d6f2f7\"},animationDuration:{type:ControlType.Number,title:\"Speed\",defaultValue:16,min:4,max:40,step:1,unit:\"s\"},noiseIntensity:{type:ControlType.Number,title:\"Noise Intensity\",defaultValue:.15,min:0,max:1,step:.05}});export default AnimatedGradientBackground;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedGradientBackground\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedGradientBackground.map"],"mappings":"qbAMG,SAAS,EAA2B,EAAM,CAAC,GAAK,CAAC,SAAO,SAAO,SAAO,oBAAkB,QAAM,kBAAgB,EAAY,EAAG,EAAO,EAAG,EAAO,EAAG,EAAa,EAAS,GAAqB,CAAO,EAAIA,EAAO,KAAK,CAAO,EAAS,EAAU,EAAI,CAAC,OAAO,QAAQ,CAAC,CAC/P,EAAaC,MAAY,CAAC,GAAU,IAAS,OAAY,MAAM,GACrE,IAAkB,EAAW,GAAK,GAAU,IAAS,OAAY,CAAC,IAAM,EAAI,EAAO,kBAAkB,EAAE,EAAW,KAAK,MAAM,GAAK,EAAI,CAAE,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,MAAM,EAAW,EAAO,OAA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