{"version":3,"file":"ImageCarousel.BgUqce_b.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/1Tk32sNWVY6UzQfAtELd/YujLuTSZLC9ealO0qlW7/ImageCarousel.js"],"sourcesContent":["// Image carousel component with 36:25 aspect ratio, swipeable with navigation dots\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useMotionValue,animate}from\"framer-motion\";/**\n * Image Carousel Component with 36:25 aspect ratio\n *\n * @framerIntrinsicWidth 720\n * @framerIntrinsicHeight 500\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\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\"}],autoPlay=false,autoPlayInterval=3e3,showDots=true,dotColor=\"#CCCCCC\",activeDotColor=\"#FFFFFF\",dotSize=12,dotSpacing=8,transitionDuration=.5,imageWidth=100}=props;const[currentIndex,setCurrentIndex]=useState(0);const[isDragging,setIsDragging]=useState(false);const containerRef=useRef(null);const x=useMotionValue(0);const autoPlayTimerRef=useRef(null);const imageCount=images.length;// Calculate container width for drag constraints\nconst[containerWidth,setContainerWidth]=useState(0);useEffect(()=>{if(containerRef.current){setContainerWidth(containerRef.current.offsetWidth);}},[]);// Auto-play functionality\nuseEffect(()=>{if(autoPlay&&!isDragging&&imageCount>1){autoPlayTimerRef.current=window.setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%imageCount);});},autoPlayInterval);}return()=>{if(autoPlayTimerRef.current){clearInterval(autoPlayTimerRef.current);}};},[autoPlay,autoPlayInterval,isDragging,imageCount]);// Animate to current index\nuseEffect(()=>{if(containerWidth>0){animate(x,-currentIndex*containerWidth,{type:\"spring\",stiffness:300,damping:30});}},[currentIndex,containerWidth,x,transitionDuration]);const handleDragStart=()=>{startTransition(()=>setIsDragging(true));};const handleDragEnd=(event,info)=>{startTransition(()=>setIsDragging(false));const threshold=containerWidth*.2;const velocity=info.velocity.x;if(Math.abs(info.offset.x)>threshold||Math.abs(velocity)>500){if(info.offset.x>0&&currentIndex>0){startTransition(()=>setCurrentIndex(currentIndex-1));}else if(info.offset.x<0&&currentIndex<imageCount-1){startTransition(()=>setCurrentIndex(currentIndex+1));}else{animate(x,-currentIndex*containerWidth,{type:\"spring\",stiffness:300,damping:30});}}else{animate(x,-currentIndex*containerWidth,{type:\"spring\",stiffness:300,damping:30});}};const handleDotClick=index=>{startTransition(()=>setCurrentIndex(index));};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:16},children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,display:\"flex\",height:\"100%\",width:\"100%\",x,cursor:isDragging?\"grabbing\":\"grab\"},drag:\"x\",dragConstraints:{left:-(imageCount-1)*containerWidth,right:0},dragElastic:.1,onDragStart:handleDragStart,onDragEnd:handleDragEnd,children:images.map((image,index)=>{const imgSrc=typeof image.src===\"string\"?image.src:image.src.src;const imgSrcSet=typeof image.src===\"object\"?image.src.srcSet:undefined;const imgAlt=typeof image.src===\"object\"&&image.src.alt?image.src.alt:image.alt;return /*#__PURE__*/_jsx(\"div\",{style:{minWidth:\"100%\",height:\"100%\",position:\"relative\"},children:/*#__PURE__*/_jsx(\"img\",{src:imgSrc,srcSet:imgSrcSet,alt:imgAlt,style:{width:`${imageWidth}%`,height:\"100%\",objectFit:\"contain\",objectPosition:\"center\",userSelect:\"none\",pointerEvents:\"none\",margin:\"0 auto\"},draggable:false})},index);})})}),showDots&&imageCount>1&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:20,left:\"50%\",transform:\"translateX(-50%)\",display:\"flex\",gap:dotSpacing,zIndex:10},children:images.map((_,index)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>handleDotClick(index),style:{width:dotSize,height:dotSize,borderRadius:\"50%\",backgroundColor:index===currentIndex?activeDotColor:dotColor,border:\"none\",cursor:\"pointer\",padding:0,transition:\"background-color 0.3s ease\",opacity:index===currentIndex?1:.6},\"aria-label\":`Go to slide ${index+1}`},index))})]});}addPropertyControls(ImageCarousel,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.Object,controls:{src:{type:ControlType.ResponsiveImage,title:\"Image\"},alt:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Carousel image\"}}},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\"}]},imageWidth:{type:ControlType.Number,title:\"Image Width\",defaultValue:100,min:10,max:100,step:5,unit:\"%\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},autoPlayInterval:{type:ControlType.Number,title:\"Interval\",defaultValue:3e3,min:1e3,max:1e4,step:500,unit:\"ms\",hidden:({autoPlay})=>!autoPlay},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:\"#FFFFFF\",hidden:({showDots})=>!showDots},dotSize:{type:ControlType.Number,title:\"Dot Size\",defaultValue:12,min:6,max:24,step:2,unit:\"px\",hidden:({showDots})=>!showDots},dotSpacing:{type:ControlType.Number,title:\"Dot Spacing\",defaultValue:8,min:4,max:20,step:2,unit:\"px\",hidden:({showDots})=>!showDots},transitionDuration:{type:ControlType.Number,title:\"Transition\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageCarousel\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"500\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"720\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageCarousel.map"],"mappings":"0QASG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,mBAAmB,EAAE,CAAC,IAAI,oEAAoE,IAAI,qBAAqB,EAAE,CAAC,IAAI,uEAAuE,IAAI,qBAAqB,CAAC,EAAE,WAAS,GAAM,mBAAiB,IAAI,WAAS,GAAK,WAAS,UAAU,iBAAe,UAAU,UAAQ,GAAG,aAAW,EAAE,qBAAmB,GAAG,aAAW,KAAK,EAAW,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAO,CAAC,EAAW,GAAeA,EAAS,EAAK,EAAQ,EAAaC,EAAO,IAAI,EAAQ,EAAE,EAAe,CAAC,EAAQ,EAAiBA,EAAO,IAAI,EAAQ,EAAW,EAAO,OACjuB,CAAC,EAAe,GAAmBD,EAAS,CAAC,EAAE,MAAc,CAAI,EAAa,SAAS,EAAkB,EAAa,QAAQ,WAAW,CAAG,EAAE,CAAC,CAAC,EACrJ,OAAkB,GAAU,CAAC,GAAY,EAA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