{"version":3,"file":"CrossfadeSlideshow.JSofpm5J.mjs","names":["React.useState","__esmMin","init_npm_react_18_3_1","_e","c","init_jsx_runtime","ce","init_framer_DKWANagr","addPropertyControls","useIsStaticRenderer","ControlType","CrossfadeSlideshow","active","setActive","isStatic","images","timer","i","interval","fade","style","image","fit","init_CrossfadeSlideshow"],"sources":["https:/framerusercontent.com/modules/6uLVTVaoi5iHYuRX6duB/mXYB2vvqm0SqynJ62vBk/CrossfadeSlideshow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/** @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any */export default function CrossfadeSlideshow({images=[],interval=2,fade=.5,fit=\"fill\",style}){const[active,setActive]=React.useState(0);const isStatic=useIsStaticRenderer();React.useEffect(()=>{setActive(0);},[images.length]);React.useEffect(()=>{if(isStatic||images.length<2)return;const timer=setInterval(()=>setActive(i=>(i+1)%images.length),Math.max(interval,fade+.1)*1e3);return()=>clearInterval(timer);},[images.length,interval,fade,isStatic]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",aspectRatio:\"4 / 3\",...style,position:\"relative\",overflow:\"hidden\"},children:images.map((image,i)=>/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt||\"\",\"aria-hidden\":i!==active,style:{display:\"block\",position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:fit,opacity:i===active?1:0,transition:isStatic?\"none\":`opacity ${fade}s ease-in-out`}},i))});}addPropertyControls(CrossfadeSlideshow,{fit:{type:ControlType.Enum,options:[\"fill\",\"cover\",\"contain\"],defaultValue:\"fill\",title:\"Image Fit\"},images:{type:ControlType.Array,control:{type:ControlType.ResponsiveImage},title:\"Images\"},interval:{type:ControlType.Number,defaultValue:2,min:.2,step:.05,unit:\"s\",title:\"Interval\"},fade:{type:ControlType.Number,defaultValue:.5,min:0,max:3,step:.05,unit:\"s\",title:\"Fade\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CrossfadeSlideshow\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CrossfadeSlideshow.map"],"mappings":"A,yLACsC,SAAwBW,EAAmB,CAAC,SAAO,CAAC,EAAE,WAAS,EAAE,OAAK,GAAG,MAAI,OAAO,SAAO,CAAC,GAAK,CAACC,EAAOC,GAAWb,EAAe,CAAC,EAAQc,EAASL,EAAoB,EAAuR,OAArRH,MAAoB,CAACO,EAAU,CAAC,CAAE,EAAE,CAACE,EAAO,MAAM,CAAC,EAAET,MAAoB,CAAC,GAAGQ,GAAUC,EAAO,OAAO,EAAE,OAAO,IAAMC,EAAM,gBAAgBH,EAAU,IAAII,EAAE,GAAGF,EAAO,MAAM,EAAE,KAAK,IAAIG,EAASC,EAAK,EAAE,EAAE,GAAG,EAAE,UAAU,cAAcH,CAAK,CAAE,EAAE,CAACD,EAAO,OAAOG,EAASC,EAAKL,CAAQ,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,YAAY,QAAQ,GAAGM,EAAM,SAAS,WAAW,SAAS,QAAQ,EAAE,SAASL,EAAO,KAAK,EAAM,IAAiB,gBAAK,MAAM,CAAC,IAAIM,EAAM,IAAI,IAAIA,EAAM,KAAK,GAAG,cAAcJ,IAAIL,EAAO,MAAM,CAAC,QAAQ,QAAQ,SAAS,WAAW,MAAM,EAAE,MAAM,OAAO,OAAO,OAAO,UAAUU,EAAI,QAAQ,MAAIV,GAAW,WAAWE,EAAS,OAAO,WAAWK,EAAK,cAAc,CAAC,EAAEF,CAAC,CAAC,CAAC,CAAC,CAAE,C,0CAACT,EAAoBG,EAAmB,CAAC,IAAI,CAAC,KAAKD,EAAY,KAAK,QAAQ,CAAC,OAAO,QA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