{"version":3,"file":"ImageCarousel3D_1.DHxFmbim.mjs","names":[],"sources":["https:/framerusercontent.com/modules/6KczgRKZVT9K3UFTLMIh/aG2obgfCpCfFTv94jOdn/ImageCarousel3D_1.js"],"sourcesContent":["// 3D image carousel with rotating perspective, configurable images, spacing, and rotation speed\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,useMotionValue,useSpring,animate}from\"framer-motion\";/**\n * 3D Image Carousel\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ImageCarousel3D(props){const{images,spacing=300,rotationSpeed=20,autoRotate=false,imageWidth=200,imageHeight=280,perspective=1e3,showReflection=true,borderRadius=12,backgroundColor=\"#F5F5F5\"}=props;const defaultImages=[{image:{src:\"https://images.unsplash.com/photo-1755956187917-65cbe263b4e6?q=80&w=685&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 1\"}},{image:{src:\"https://images.unsplash.com/photo-1751324136341-d7c64d2e1571?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 2\"}},{image:{src:\"https://images.unsplash.com/photo-1623463199109-186089df3102?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 3\"}},{image:{src:\"https://images.unsplash.com/photo-1743195954972-687f202d830f?q=80&w=627&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 4\"}},{image:{src:\"https://images.unsplash.com/photo-1696215105730-fa23954dd164?q=80&w=627&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 5\"}},{image:{src:\"https://images.unsplash.com/photo-1755956187917-65cbe263b4e6?q=80&w=685&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 6\"}},{image:{src:\"https://images.unsplash.com/photo-1751324136341-d7c64d2e1571?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 7\"}},{image:{src:\"https://images.unsplash.com/photo-1623463199109-186089df3102?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 8\"}},{image:{src:\"https://images.unsplash.com/photo-1743195954972-687f202d830f?q=80&w=627&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 9\"}},{image:{src:\"https://images.unsplash.com/photo-1696215105730-fa23954dd164?q=80&w=627&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 10\"}}];const displayImages=images&&images.length>0?images:defaultImages;const rotation=useMotionValue(0);const smoothRotation=useSpring(rotation,{stiffness:100,damping:25,mass:.5});const isStatic=RenderTarget.current()===RenderTarget.thumbnail;const imageCount=displayImages.length;const angleStep=360/imageCount;const handleImageClick=index=>{if(isStatic)return;const currentRotation=rotation.get()%360;const targetAngle=-angleStep*index;let rotationDiff=targetAngle-currentRotation;// Find shortest rotation path\nif(rotationDiff>180)rotationDiff-=360;if(rotationDiff<-180)rotationDiff+=360;animate(rotation,rotation.get()+rotationDiff,{type:\"spring\",stiffness:80,damping:30});};const handlePrevious=()=>{if(isStatic)return;animate(rotation,rotation.get()-angleStep,{type:\"spring\",stiffness:80,damping:30});};const handleNext=()=>{if(isStatic)return;animate(rotation,rotation.get()+angleStep,{type:\"spring\",stiffness:80,damping:30});};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\",position:\"relative\",userSelect:\"none\",background:backgroundColor},children:[/*#__PURE__*/_jsx(\"button\",{onClick:handlePrevious,style:{position:\"absolute\",left:20,top:\"50%\",transform:\"translateY(-50%)\",width:24,height:24,borderRadius:\"50%\",border:\"none\",background:\"#FFFFFF\",boxShadow:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,transition:\"all 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.background=\"#FFFFFF\";e.currentTarget.style.transform=\"translateY(-50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.background=\"#FFFFFF\";e.currentTarget.style.transform=\"translateY(-50%) scale(1)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"12\",height:\"12\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"#000\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"polyline\",{points:\"15 18 9 12 15 6\"})})}),/*#__PURE__*/_jsx(\"button\",{onClick:handleNext,style:{position:\"absolute\",right:20,top:\"50%\",transform:\"translateY(-50%)\",width:24,height:24,borderRadius:\"50%\",border:\"none\",background:\"#FFFFFF\",boxShadow:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,transition:\"all 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.background=\"#FFFFFF\";e.currentTarget.style.transform=\"translateY(-50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.background=\"#FFFFFF\";e.currentTarget.style.transform=\"translateY(-50%) scale(1)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"12\",height:\"12\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"#000\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"polyline\",{points:\"9 18 15 12 9 6\"})})}),/*#__PURE__*/_jsx(motion.div,{style:{position:\"relative\",width:imageWidth,height:imageHeight,transformStyle:\"preserve-3d\",perspective:perspective},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"relative\",width:\"100%\",height:\"100%\",transformStyle:\"preserve-3d\",rotateY:smoothRotation},children:displayImages.map((item,index)=>{const angle=angleStep*index;const radians=angle*Math.PI/180;const translateZ=spacing;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",width:imageWidth,height:imageHeight,left:0,top:0,transform:`rotateY(${angle}deg) translateZ(${translateZ}px)`,transformStyle:\"preserve-3d\",backfaceVisibility:\"hidden\"},onClick:()=>handleImageClick(index),children:[/*#__PURE__*/_jsx(motion.img,{src:item.image.src,alt:item.image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:borderRadius,boxShadow:\"0 20px 60px rgba(0, 0, 0, 0.4)\",pointerEvents:\"none\",border:\"1px solid rgba(255, 255, 255, 0.2)\"},whileHover:{scale:1.05},transition:{type:\"spring\",stiffness:300,damping:20},draggable:false}),showReflection&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:\"100%\",height:\"100%\",top:\"100%\",left:0,transform:\"scaleY(-1)\",transformOrigin:\"top\",opacity:.3,maskImage:\"linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 60%)\",WebkitMaskImage:\"linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 60%)\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"img\",{src:item.image.src,alt:\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:borderRadius},draggable:false})})]},index);})})})]});}addPropertyControls(ImageCarousel3D,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Image\"}}},defaultValue:[{image:{src:\"https://images.unsplash.com/photo-1755956187917-65cbe263b4e6?q=80&w=685&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 1\"}},{image:{src:\"https://images.unsplash.com/photo-1751324136341-d7c64d2e1571?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 2\"}},{image:{src:\"https://images.unsplash.com/photo-1623463199109-186089df3102?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 3\"}},{image:{src:\"https://images.unsplash.com/photo-1743195954972-687f202d830f?q=80&w=627&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 4\"}},{image:{src:\"https://images.unsplash.com/photo-1696215105730-fa23954dd164?q=80&w=627&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",alt:\"Image 5\"}}]},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:300,min:100,max:600,step:10,unit:\"px\"},imageWidth:{type:ControlType.Number,title:\"Image Width\",defaultValue:200,min:100,max:400,step:10,unit:\"px\"},imageHeight:{type:ControlType.Number,title:\"Image Height\",defaultValue:280,min:100,max:500,step:10,unit:\"px\"},perspective:{type:ControlType.Number,title:\"Perspective\",defaultValue:1e3,min:500,max:2e3,step:50,unit:\"px\"},showReflection:{type:ControlType.Boolean,title:\"Reflection\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:40,step:1,unit:\"px\",description:\"More Components at [DiverseKit](https://framer.link/se2heI4)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageCarousel3D\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"600\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageCarousel3D_1.map"],"mappings":"gPASG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,SAAO,UAAQ,IAAI,gBAAc,GAAG,aAAW,GAAM,aAAW,IAAI,cAAY,IAAI,cAAY,IAAI,iBAAe,GAAK,eAAa,GAAG,kBAAgB,WAAW,EAA28D,EAAc,GAAQ,EAAO,OAAO,EAAE,EAAv9D,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,wKAAwK,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI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