{"version":3,"file":"PhotoSlideshow.CsG-WCEF.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/WVGzN9uoy1lWVNss558L/QHExAUPHVf26u5YImtCJ/PhotoSlideshow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useCallback}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Full-screen photo slideshow with fade transitions\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function PhotoSlideshow(props){const{images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Photo 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Photo 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Photo 3\"}],slideDuration=3,fadeDuration=1,backgroundColor=\"#000000\",objectFit=\"cover\"}=props;const[currentIndex,setCurrentIndex]=useState(0);const[opacity,setOpacity]=useState(1);const isStatic=useIsStaticRenderer();const transitionToNext=useCallback(()=>{// Fade out\nsetOpacity(0);// Change image and fade in after fade duration\nsetTimeout(()=>{setCurrentIndex(prev=>(prev+1)%images.length);setOpacity(1);},fadeDuration*1e3);},[images.length,fadeDuration]);useEffect(()=>{if(isStatic||images.length<=1)return;const interval=setInterval(transitionToNext,slideDuration*1e3+fadeDuration*1e3);return()=>clearInterval(interval);},[isStatic,images.length,slideDuration,fadeDuration,transitionToNext]);if(images.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#666\",fontSize:\"16px\"},children:\"Add images to start slideshow\"});}const currentImage=images[currentIndex];return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"img\",{src:currentImage?.src,alt:currentImage?.alt||\"Slideshow image\",style:{width:\"100%\",height:\"100%\",objectFit,opacity,transition:`opacity ${fadeDuration}s ease-in-out`}})});}addPropertyControls(PhotoSlideshow,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Photo 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Photo 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Photo 3\"}],maxCount:50},slideDuration:{type:ControlType.Number,title:\"Slide Duration\",defaultValue:3,min:.5,max:30,step:.5,unit:\"s\"},fadeDuration:{type:ControlType.Number,title:\"Fade Duration\",defaultValue:1,min:.1,max:5,step:.1,unit:\"s\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},objectFit:{type:ControlType.Enum,title:\"Image Fit\",defaultValue:\"cover\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale Down\"],displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PhotoSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"600\",\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PhotoSlideshow.map"],"mappings":"2LAQG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,UA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