{"version":3,"file":"BackgroundColor.DXpsTFpt.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/v3KOasHGAaohvFoW77ao/ZSN3zBvIA9L43e2e3VIN/BackgroundColor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ColorTransitionBackground(props){const{colors=[\"#8435C2\",\"#00A2E7\",\"#00BFBC\",\"#FF62A3\",\"#005BB0\"],transitionDuration=5,style}=props;const[currentColorIndex,setCurrentColorIndex]=useState(0);useEffect(()=>{// Skip animation if we only have one color\nif(colors.length<=1)return;const interval=setInterval(()=>{setCurrentColorIndex(prevIndex=>prevIndex===colors.length-1?0:prevIndex+1);},transitionDuration*1e3);return()=>clearInterval(interval);},[colors,transitionDuration]);// Use the first color if the array is empty\nconst currentColor=colors.length>0?colors[currentColorIndex]:\"#ffffff\";return /*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",backgroundColor:colors[0]||\"#8435C2\",...style},animate:{backgroundColor:currentColor},transition:{duration:transitionDuration,ease:\"easeInOut\"}});}addPropertyControls(ColorTransitionBackground,{colors:{type:ControlType.Array,title:\"Colors\",control:{type:ControlType.Color},defaultValue:[\"#8435C2\",\"#00A2E7\",\"#00BFBC\",\"#FF62A3\",\"#005BB0\"],description:\"The colors to transition between\"},transitionDuration:{type:ControlType.Number,title:\"Duration\",defaultValue:5,min:.5,max:20,step:.5,unit:\"s\",description:\"Time in seconds for each color transition\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ColorTransitionBackground\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackgroundColor.map"],"mappings":"kOAAuK,SAAwB,EAA0B,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,UAAU,UAAU,UAAU,UAAU,SAAS,EAAE,qBAAmB,EAAE,SAAO,EAAW,CAAC,EAAkB,GAAsBA,EAAS,CAAC,EAAE,MAAc,CAC3Y,GAAG,EAAO,QAAQ,EAAE,OAAO,IAAM,EAAS,gBAAgB,CAAC,EAAqB,GAAW,IAAY,EAAO,OAAO,EAAE,EAAE,EAAU,CAAC,CAAE,EAAE,EAAmB,GAAG,EAAE,UAAU,cAAc,CAAQ,CAAE,EAAE,CAAC,EAAO,CAAkB,CAAC,EAC/N,IAAM,EAAa,EAAO,OAAO,EAAE,EAAO,GAAmB,UAAU,OAAoB,EAAK,EAAO,IAAI,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,WAAW,SAAS,SAAS,gBAAgB,EAAO,IAAI,UAAU,GAAG,CAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAY,EAAE,WAAW,CAAC,SAAS,EAAmB,KAAK,WAAW,CAAC,CAAC,CAAE,iBAF5R,IAAkC,IAAsC,IAAoD,EAEiK,EAAoB,EAA0B,CAAC,OAAO,CAAC,KAAK,EAAY,MAAM,MAAM,SAAS,QAAQ,CAAC,KAAK,EAAY,KAAK,EAAE,aAAa,CAAC,UAAU,UAAU,UAAU,UAAU,SAAS,EAAE,YAAY,kCAAkC,EAAE,mBAAmB,CAAC,KAAK,EAAY,OAAO,MAAM,WAAW,aAAa,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,IAAI,YAAY,2CAA2C,CAAC,CAAC"}