{"version":3,"file":"ImageSlideshow.CtrfRG5a.mjs","names":["useState","useCallback","direction","_Fragment"],"sources":["https:/framerusercontent.com/modules/2tLC97X2QzNA5HIYvErx/t87yI3eRGO6I5C8rIRVN/ImageSlideshow.js"],"sourcesContent":["// Image slideshow component with navigation controls and auto-play functionality\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ImageSlideshow(props){const{slides=[],autoPlay,interval,showControls,showIndicators,transitionDuration,controlColor,indicatorColor,captionBackground,captionText,captionFont,imageFit}=props;const[currentIndex,setCurrentIndex]=useState(0);const[direction,setDirection]=useState(0);const nextSlide=useCallback(()=>{setDirection(1);startTransition(()=>{setCurrentIndex(prev=>(prev+1)%slides.length);});},[slides.length]);const prevSlide=useCallback(()=>{setDirection(-1);startTransition(()=>{setCurrentIndex(prev=>(prev-1+slides.length)%slides.length);});},[slides.length]);const goToSlide=useCallback(index=>{setDirection(index>currentIndex?1:-1);startTransition(()=>{setCurrentIndex(index);});},[currentIndex]);useEffect(()=>{if(!autoPlay||RenderTarget.current()===RenderTarget.thumbnail)return;const timer=setInterval(()=>{nextSlide();},interval*1e3);return()=>clearInterval(timer);},[autoPlay,interval,nextSlide]);const variants={enter:direction=>({x:direction>0?\"100%\":\"-100%\",opacity:0}),center:{x:0,opacity:1},exit:direction=>({x:direction>0?\"-100%\":\"100%\",opacity:0})};const currentSlide=slides[currentIndex];// Safety check for empty slides or missing image data\nif(!slides.length||!currentSlide||!currentSlide.image){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"#000\",color:\"#fff\",...captionFont},children:\"Add slides to get started\"});}return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor:\"#000\"},children:[/*#__PURE__*/_jsx(AnimatePresence,{initial:false,custom:direction,children:/*#__PURE__*/_jsxs(motion.div,{custom:direction,variants:variants,initial:\"enter\",animate:\"center\",exit:\"exit\",transition:{x:{type:\"tween\",duration:transitionDuration},opacity:{duration:transitionDuration}},style:{position:\"absolute\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"img\",{src:currentSlide.image.src,alt:currentSlide.image.alt||\"\",style:{width:\"100%\",height:\"100%\",objectFit:imageFit}}),currentSlide.caption&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:0,left:0,right:0,backgroundColor:captionBackground,color:captionText,padding:\"16px 20px\",...captionFont},children:currentSlide.caption})]},currentIndex)}),showControls&&slides.length>1&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{onClick:prevSlide,style:{position:\"absolute\",left:16,top:\"50%\",transform:\"translateY(-50%)\",backgroundColor:controlColor,border:\"none\",borderRadius:\"50%\",width:48,height:48,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,opacity:.9},\"aria-label\":\"Previous slide\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 18l-6-6 6-6\",stroke:\"#000\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),/*#__PURE__*/_jsx(\"button\",{onClick:nextSlide,style:{position:\"absolute\",right:16,top:\"50%\",transform:\"translateY(-50%)\",backgroundColor:controlColor,border:\"none\",borderRadius:\"50%\",width:48,height:48,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,opacity:.9},\"aria-label\":\"Next slide\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 18l6-6-6-6\",stroke:\"#000\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]}),showIndicators&&slides.length>1&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:16,left:\"50%\",transform:\"translateX(-50%)\",display:\"flex\",gap:8,zIndex:10},children:slides.map((_,index)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>goToSlide(index),style:{width:10,height:10,borderRadius:\"50%\",border:\"none\",backgroundColor:index===currentIndex?indicatorColor:\"rgba(255, 255, 255, 0.5)\",cursor:\"pointer\",padding:0,transition:\"background-color 0.3s\"},\"aria-label\":`Go to slide ${index+1}`},index))})]});}addPropertyControls(ImageSlideshow,{slides:{type:ControlType.Array,control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Image\"},caption:{type:ControlType.String,title:\"Caption\",defaultValue:\"\"}}},defaultValue:[{image:{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Gradient 5 - Green\"},caption:\"Beautiful landscape\"},{image:{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Gradient 4 - Yellow\"},caption:\"Stunning sunset\"},{image:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\"},caption:\"Mountain view\"}],maxCount:10},imageFit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:3,min:1,max:10,step:.5,unit:\"s\",hidden:({autoPlay})=>!autoPlay},transitionDuration:{type:ControlType.Number,title:\"Transition\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"},showControls:{type:ControlType.Boolean,title:\"Show Controls\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},controlColor:{type:ControlType.Color,title:\"Control Color\",defaultValue:\"#FFFFFF\",hidden:({showControls})=>!showControls},showIndicators:{type:ControlType.Boolean,title:\"Show Indicators\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},indicatorColor:{type:ControlType.Color,title:\"Indicator Color\",defaultValue:\"#FFFFFF\",hidden:({showIndicators})=>!showIndicators},captionBackground:{type:ControlType.Color,title:\"Caption Background\",defaultValue:\"rgba(0, 0, 0, 0.7)\"},captionText:{type:ControlType.Color,title:\"Caption Text\",defaultValue:\"#FFFFFF\"},captionFont:{type:ControlType.Font,title:\"Caption Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageSlideshow.map"],"mappings":"4QAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,SAAO,EAAE,CAAC,WAAS,WAAS,eAAa,iBAAe,qBAAmB,eAAa,iBAAe,oBAAkB,cAAY,cAAY,YAAU,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAE,CAAO,EAAUC,MAAgB,CAAC,EAAa,EAAE,CAAC,MAAoB,CAAC,EAAgB,IAAO,EAAK,GAAG,EAAO,OAAO,EAAG,EAAG,CAA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