{"version":3,"file":"ImageGallery_2.BA6MzuNb.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/3Imf9ZrxnfQnHG1GNJKR/cMkggaMaJefCtA4GqIXf/ImageGallery_2.js"],"sourcesContent":["// Image gallery with CMS variables, emphasis view, miniatures, and zoom functionality\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,motion,AnimatePresence}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageGallery(props){const{image1=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",image2=\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",image3=\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",image4=\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",backgroundColor,borderRadius,spacing,thumbnailSize,showZoom,zoomBackgroundColor,style}=props;// Create images array from individual image props\nconst images=[{src:image1,alt:\"Gallery Image 1\"},{src:image2,alt:\"Gallery Image 2\"},{src:image3,alt:\"Gallery Image 3\"},{src:image4,alt:\"Gallery Image 4\"}];// Filter out images that don't have valid src\nconst validImages=images.filter(img=>img&&img.src&&img.src.trim()!==\"\");const[selectedIndex,setSelectedIndex]=useState(0);const[isZoomed,setIsZoomed]=useState(false);const handleThumbnailClick=index=>{startTransition(()=>{setSelectedIndex(index);});};const handleMainImageClick=()=>{if(showZoom){startTransition(()=>{setIsZoomed(true);});}};const handleZoomClose=()=>{startTransition(()=>{setIsZoomed(false);});};const selectedImage=validImages[selectedIndex]||validImages[0];// Don't render if no valid images\nif(validImages.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius,color:\"#666\",fontSize:14},children:\"No images available\"});}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor,borderRadius,padding:spacing,display:\"flex\",flexDirection:\"column\",gap:spacing,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{flex:1,position:\"relative\",borderRadius:borderRadius*.75,overflow:\"hidden\",cursor:showZoom?\"zoom-in\":\"default\"},onClick:handleMainImageClick,children:/*#__PURE__*/_jsx(motion.img,{src:selectedImage.src,alt:selectedImage.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3}},selectedIndex)}),validImages.length>1&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:spacing*.5,justifyContent:\"center\",flexWrap:\"wrap\"},children:validImages.map((image,index)=>/*#__PURE__*/_jsx(\"div\",{style:{width:thumbnailSize,height:thumbnailSize,borderRadius:borderRadius*.5,overflow:\"hidden\",cursor:\"pointer\",border:index===selectedIndex?\"2px solid #007AFF\":\"2px solid transparent\",opacity:index===selectedIndex?1:.7,transition:\"all 0.2s ease\"},onClick:()=>handleThumbnailClick(index),onMouseEnter:e=>{if(index!==selectedIndex){e.currentTarget.style.opacity=\"1\";}},onMouseLeave:e=>{if(index!==selectedIndex){e.currentTarget.style.opacity=\"0.7\";}},children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\"}})},index))})]}),/*#__PURE__*/_jsx(AnimatePresence,{children:isZoomed&&/*#__PURE__*/_jsxs(motion.div,{style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,backgroundColor:zoomBackgroundColor,zIndex:1e3,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"zoom-out\",padding:20},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onClick:handleZoomClose,children:[/*#__PURE__*/_jsx(motion.img,{src:selectedImage.src,alt:selectedImage.alt,style:{maxWidth:\"90%\",maxHeight:\"90%\",objectFit:\"contain\",borderRadius:borderRadius},initial:{scale:.8},animate:{scale:1},exit:{scale:.8},transition:{duration:.3}}),/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",top:20,right:20,width:40,height:40,borderRadius:\"50%\",backgroundColor:\"rgba(0, 0, 0, 0.5)\",border:\"none\",color:\"white\",fontSize:20,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},onClick:e=>{e.stopPropagation();handleZoomClose();},children:\"\\xd7\"})]})})]});}addPropertyControls(ImageGallery,{image1:{type:ControlType.String,title:\"Image 1 URL\",defaultValue:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\"},image2:{type:ControlType.String,title:\"Image 2 URL\",defaultValue:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\"},image3:{type:ControlType.String,title:\"Image 3 URL\",defaultValue:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\"},image4:{type:ControlType.String,title:\"Image 4 URL\",defaultValue:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#F5F5F5\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:32,unit:\"px\"},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:16,min:4,max:32,unit:\"px\"},thumbnailSize:{type:ControlType.Number,title:\"Thumbnail Size\",defaultValue:60,min:40,max:120,unit:\"px\"},showZoom:{type:ControlType.Boolean,title:\"Enable Zoom\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},zoomBackgroundColor:{type:ControlType.Color,title:\"Zoom Background\",defaultValue:\"rgba(0, 0, 0, 0.9)\",hidden:({showZoom})=>!showZoom}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageGallery\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageGallery_2.map"],"mappings":"gPAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,SAAO,sEAAsE,SAAO,oEAAoE,SAAO,uEAAuE,SAAO,sEAAsE,kBAAgB,eAAa,UAAQ,gBAAc,WAAS,sBAAoB,SAAO,EAEzb,EADO,CAAC,CAAC,IAAI,EAAO,IAAI,kBAAkB,CAAC,CAAC,IAAI,EAAO,IAAI,kBAAkB,CAAC,CAAC,IAAI,EAAO,IAAI,kBAAkB,CAAC,CAAC,IAAI,EAAO,IAAI,kBAAkB,CAAC,CACjI,OAAO,GAAK,GAAK,EAAI,KAAK,EAAI,IAAI,MAAM,GAAG,GAAG,CAAM,CAAC,EAAc,GAAkBA,EAAS,EAAE,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAO,EAAqB,GAAO,CAAC,MAAoB,CAAC,EAAiB,EAAM,EAAG,EAAS,MAAyB,CAAI,GAAU,MAAoB,CAAC,EAAY,GAAK,EAAG,EAAU,MAAoB,CAAC,MAAoB,CAAC,EAAY,GAAM,EAAG,EAAS,EAAc,EAAY,IAAgB,EAAY,GAC1P,OAA5N,EAAY,SAAS,EAAuB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,kBAAgB,eAAa,MAAM,OAAO,SAAS,GAAG,CAAC,SAAS,sBAAsB,CAAC,CAAsB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,kBAAgB,eAAa,QAAQ,EAAQ,QAAQ,OAAO,cAAc,SAAS,IAAI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