{"version":3,"file":"ImageCarousel_1.D1fa6aYA.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/E2DFayRmL7Q75gBcsITR/702nmhygA3ZaQ7cLvEoO/ImageCarousel_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Auto Image Carousel\n * \n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ImageCarousel(props){const{images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Gradient 4 - Yellow\"}],transitionDuration=1,displayTime=3,fadeEffect=true,borderRadius=0,startDelay=0,border={borderWidth:0,borderStyle:\"solid\",borderColor:\"#000000\"},style}=props;const[currentIndex,setCurrentIndex]=useState(0);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic||images.length<=1)return;// Initial delay before starting the transitions\nconst initialTimeout=setTimeout(()=>{const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prevIndex=>(prevIndex+1)%images.length);});},displayTime*1e3);return()=>clearInterval(interval);},startDelay*1e3);return()=>clearTimeout(initialTimeout);},[images.length,displayTime,startDelay,isStatic]);if(images.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:\"#f0f0f0\",borderRadius,borderWidth:border.borderWidth,borderStyle:border.borderStyle,borderColor:border.borderColor},children:\"No images provided\"});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,borderWidth:border.borderWidth,borderStyle:border.borderStyle,borderColor:border.borderColor},children:images.map((image,index)=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",opacity:index===currentIndex?1:0,transition:fadeEffect?`opacity ${transitionDuration}s ease-in-out`:\"none\",zIndex:index===currentIndex?1:0,borderRadius},children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",borderRadius}})},index))});}addPropertyControls(ImageCarousel,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},maxCount:10,defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Gradient 4 - Yellow\"}]},displayTime:{type:ControlType.Number,title:\"Display Time\",defaultValue:3,min:.5,max:10,step:.5,unit:\"s\"},transitionDuration:{type:ControlType.Number,title:\"Transition\",defaultValue:1,min:0,max:3,step:.1,unit:\"s\"},startDelay:{type:ControlType.Number,title:\"Start Delay\",defaultValue:0,min:0,max:10,step:.5,unit:\"s\"},fadeEffect:{type:ControlType.Boolean,title:\"Fade Effect\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:0,borderStyle:\"solid\",borderColor:\"#000000\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageCarousel_1.map"],"mappings":"0SAKG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,oBAAoB,CAAC,CAAC,IAAI,oEAAoE,IAAI,sBAAsB,CAAC,CAAC,IAAI,uEAAuE,IAAI,sBAAsB,CAAC,CAAC,IAAI,oEAAoE,IAAI,sBAAsB,CAAC,CAAC,qBAAmB,EAAE,cAAY,EAAE,aAAW,GAAK,eAAa,EAAE,aAAW,EAAE,SAAO,CAAC,YAAY,EAAE,YAAY,QAAQ,YAAY,UAAU,CAAC,SAAO,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,EAAS,GAAqB,CACvD,OADwD,MAAc,CAAC,GAAG,GAAU,EAAO,QAAQ,EAAE,OACjvB,IAAM,EAAe,eAAe,CAAC,IAAM,EAAS,gBAAgB,CAAC,MAAoB,CAAC,EAAgB,IAAY,EAAU,GAAG,EAAO,OAAO,EAAG,EAAG,EAAY,IAAI,CAAC,UAAU,cAAc,EAAS,EAAG,EAAW,IAAI,CAAC,UAAU,aAAa,EAAe,EAAG,CAAC,EAAO,OAAO,EAAY,EAAW,EAAS,CAAC,CAAI,EAAO,SAAS,EAAuB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,gBAAgB,UAAU,eAAa,YAAY,EAAO,YAAY,YAAY,EAAO,YAAY,YAAY,EAAO,YAAY,CAAC,SAAS,qBAAqB,CAAC,CAAsB,EAAK,MAAM,CAAC,MAAM,C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