{"version":3,"file":"ImageSlider.BOSFSK9v.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/b5LO22TK1HXWUyUdtl8t/JSEKacTa2fgVGHgu0fil/ImageSlider.js"],"sourcesContent":["// Responsive image slider with navigation arrows, dots indicator, and touch support for mobile\n// Auto-sliding carousel with preview of next slide\n// Click-based slider with preview on first slide only\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Auto-sliding Carousel with Preview\n * Click-based Slider with Preview on First Slide\n * \n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 300\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ImageSlider(props){const{images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Slide 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Slide 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Slide 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Slide 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Slide 5\"}],showDots=true,dotColor=\"#CCCCCC\",activeDotColor=\"#000000\",borderRadius=8,peekAmount=60,gap=16,overlapAmount=0,showArrows=true,arrowColor=\"#000000\",imageHeight=300,mobileVisibleCount=1,tabletVisibleCount=3,desktopVisibleCount=4}=props;// Ensure images array has at least one item\nconst validImages=images.length>0?images:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Slide 1\"}];// Detect viewport size\nconst[visibleCount,setVisibleCount]=useState(mobileVisibleCount);useEffect(()=>{const checkWidth=()=>{startTransition(()=>{const width=window.innerWidth;if(width>=1024){setVisibleCount(desktopVisibleCount);}else if(width>=768){setVisibleCount(tabletVisibleCount);}else{setVisibleCount(mobileVisibleCount);}});};checkWidth();window.addEventListener(\"resize\",checkWidth);return()=>window.removeEventListener(\"resize\",checkWidth);},[mobileVisibleCount,tabletVisibleCount,desktopVisibleCount]);const[currentIndex,setCurrentIndex]=useState(0);const[touchStart,setTouchStart]=useState(0);const[touchEnd,setTouchEnd]=useState(0);const sliderRef=useRef(null);const minSwipeDistance=50;const isDesktop=visibleCount===desktopVisibleCount&&window.innerWidth>=1024;// Calculate max index for navigation\nconst maxIndex=Math.max(0,validImages.length-visibleCount);const goToSlide=index=>{const clampedIndex=Math.max(0,Math.min(index,maxIndex));startTransition(()=>{setCurrentIndex(clampedIndex);});};const goToPrevious=()=>{if(currentIndex===0)return;goToSlide(currentIndex-1);};const goToNext=()=>{if(currentIndex>=maxIndex)return;goToSlide(currentIndex+1);};const onTouchStart=e=>{setTouchEnd(0);setTouchStart(e.targetTouches[0].clientX);};const onTouchMove=e=>{setTouchEnd(e.targetTouches[0].clientX);};const onTouchEnd=()=>{if(!touchStart||!touchEnd)return;const distance=touchStart-touchEnd;const isLeftSwipe=distance>minSwipeDistance;const isRightSwipe=distance<-minSwipeDistance;if(isLeftSwipe){goToNext();}else if(isRightSwipe){goToPrevious();}};// Ensure currentIndex is within bounds\nconst safeIndex=Math.min(currentIndex,maxIndex);// Only show peek on first slide and mobile\nconst isMobile=visibleCount===mobileVisibleCount;const currentPeekAmount=safeIndex===0&&isMobile?peekAmount:0;// Calculate slide width percentage\nconst slideWidth=100/visibleCount;// Calculate transform offset\nconst transformOffset=!isMobile?`-${safeIndex*slideWidth}%`:`calc(-${safeIndex*100}% - ${safeIndex*gap}px + ${safeIndex*overlapAmount}%)`;return /*#__PURE__*/_jsxs(\"div\",{ref:sliderRef,style:{position:\"relative\",width:\"100%\",height:imageHeight,overflow:\"visible\",borderRadius,userSelect:\"none\"},onTouchStart:onTouchStart,onTouchMove:onTouchMove,onTouchEnd:onTouchEnd,children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",gap:`${gap}px`,transform:`translateX(${transformOffset})`,transition:\"transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1)\",paddingRight:`${currentPeekAmount}px`},children:validImages.map((image,index)=>/*#__PURE__*/_jsx(\"div\",{style:{minWidth:isDesktop?`calc(${slideWidth}% - ${gap*(visibleCount-1)/visibleCount}px)`:\"100%\",height:imageHeight,backgroundImage:`url(${image.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",borderRadius,boxShadow:\"0 2px 8px rgba(0,0,0,0.1)\",cursor:\"pointer\"},role:\"img\",\"aria-label\":image.alt},index))}),showArrows&&validImages.length>visibleCount&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{onClick:goToPrevious,disabled:currentIndex===0,style:{position:\"absolute\",left:16,top:\"50%\",transform:\"translateY(-50%)\",width:40,height:40,borderRadius:\"50%\",border:\"none\",backgroundColor:\"rgba(255, 255, 255, 0.9)\",cursor:currentIndex===0?\"not-allowed\":\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:2,opacity:currentIndex===0?.3:1,transition:\"opacity 0.3s ease\"},\"aria-label\":\"Previous slide\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"polyline\",{points:\"15 18 9 12 15 6\"})})}),/*#__PURE__*/_jsx(\"button\",{onClick:goToNext,disabled:currentIndex>=maxIndex,style:{position:\"absolute\",right:16,top:\"50%\",transform:\"translateY(-50%)\",width:40,height:40,borderRadius:\"50%\",border:\"none\",backgroundColor:\"rgba(255, 255, 255, 0.9)\",cursor:currentIndex>=maxIndex?\"not-allowed\":\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:2,opacity:currentIndex>=maxIndex?.3:1,transition:\"opacity 0.3s ease\"},\"aria-label\":\"Next slide\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"polyline\",{points:\"9 18 15 12 9 6\"})})})]}),showDots&&validImages.length>visibleCount&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:16,left:\"50%\",transform:\"translateX(-50%)\",display:\"flex\",gap:8,zIndex:2},children:Array.from({length:maxIndex+1}).map((_,index)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>goToSlide(index),style:{width:10,height:10,borderRadius:\"50%\",border:\"none\",backgroundColor:index===currentIndex?activeDotColor:dotColor,cursor:\"pointer\",padding:0,transition:\"background-color 0.3s ease\"},\"aria-label\":`Go to slide ${index+1}`,\"aria-current\":index===currentIndex?\"true\":\"false\"},index))})]});}addPropertyControls(ImageSlider,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Slide 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Slide 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Slide 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Slide 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Slide 5\"}]},mobileVisibleCount:{type:ControlType.Number,title:\"Mobile Visible\",defaultValue:1,min:1,max:10,step:1,unit:\"img\"},tabletVisibleCount:{type:ControlType.Number,title:\"Tablet Visible\",defaultValue:3,min:1,max:10,step:1,unit:\"img\"},desktopVisibleCount:{type:ControlType.Number,title:\"Desktop Visible\",defaultValue:4,min:1,max:10,step:1,unit:\"img\"},peekAmount:{type:ControlType.Number,title:\"Preview Size\",defaultValue:60,min:0,max:200,step:10,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:16,min:0,max:50,step:2,unit:\"px\"},overlapAmount:{type:ControlType.Number,title:\"Overlap\",defaultValue:0,min:0,max:200,step:5,unit:\"px\"},showArrows:{type:ControlType.Boolean,title:\"Show Arrows\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#000000\",hidden:({showArrows})=>!showArrows},showDots:{type:ControlType.Boolean,title:\"Show Dots\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},dotColor:{type:ControlType.Color,title:\"Dot Color\",defaultValue:\"#CCCCCC\",hidden:({showDots})=>!showDots},activeDotColor:{type:ControlType.Color,title:\"Active Dot\",defaultValue:\"#000000\",hidden:({showDots})=>!showDots},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},imageHeight:{type:ControlType.Number,title:\"Image Height\",defaultValue:300,min:50,max:1e3,step:10,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageSlider\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"300\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageSlider.map"],"mappings":"2NAYG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,SAAS,EAAE,CAAC,IAAI,o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