{"version":3,"file":"ImageGallery.MzYtWSQL.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/bZznLIhRS9LQxfy2F4rb/m4kZ0ws05W9sZxWBcf5g/ImageGallery.js"],"sourcesContent":["// Gallery component with expandable images and navigation\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageGallery(props){const{images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Image 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Image 5\"}],columns=3,gap=16,borderRadius=8,backgroundColor=\"#FFFFFF\",overlayColor=\"rgba(0, 0, 0, 0.8)\",navigationColor=\"#FFFFFF\"}=props;const[selectedIndex,setSelectedIndex]=useState(null);const openImage=useCallback(index=>{startTransition(()=>setSelectedIndex(index));},[]);const closeImage=useCallback(()=>{startTransition(()=>setSelectedIndex(null));},[]);const nextImage=useCallback(()=>{if(selectedIndex!==null){const nextIndex=(selectedIndex+1)%images.length;startTransition(()=>setSelectedIndex(nextIndex));}},[selectedIndex,images.length]);const prevImage=useCallback(()=>{if(selectedIndex!==null){const prevIndex=selectedIndex===0?images.length-1:selectedIndex-1;startTransition(()=>setSelectedIndex(prevIndex));}},[selectedIndex,images.length]);const handleKeyDown=useCallback(e=>{if(selectedIndex===null)return;switch(e.key){case\"Escape\":closeImage();break;case\"ArrowRight\":nextImage();break;case\"ArrowLeft\":prevImage();break;}},[selectedIndex,closeImage,nextImage,prevImage]);// Add keyboard event listeners\nuseEffect(()=>{if(typeof window!==\"undefined\"&&selectedIndex!==null){window.addEventListener(\"keydown\",handleKeyDown);return()=>window.removeEventListener(\"keydown\",handleKeyDown);}},[selectedIndex,handleKeyDown]);return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor,borderRadius,overflow:\"hidden\",padding:gap},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"grid\",gridTemplateColumns:`repeat(${columns}, 1fr)`,gap,width:\"100%\",height:\"100%\"},children:images.map((image,index)=>/*#__PURE__*/_jsx(motion.div,{style:{position:\"relative\",borderRadius,overflow:\"hidden\",cursor:\"pointer\",backgroundColor:\"#f0f0f0\"},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>openImage(index),children:/*#__PURE__*/_jsx(\"img\",{src:typeof image.src===\"string\"?image.src:image.src.src,alt:image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}})},index))}),/*#__PURE__*/_jsx(AnimatePresence,{children:selectedIndex!==null&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,backgroundColor:overlayColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:1e3,padding:40},onClick:closeImage,children:[/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",top:20,right:20,background:\"none\",border:\"none\",color:navigationColor,fontSize:24,cursor:\"pointer\",padding:8,borderRadius:4,zIndex:1001},onClick:closeImage,\"aria-label\":\"Close\",children:\"✕\"}),images.length>1&&/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",left:20,top:\"50%\",transform:\"translateY(-50%)\",background:\"rgba(0, 0, 0, 0.5)\",border:\"none\",color:navigationColor,fontSize:24,cursor:\"pointer\",padding:12,borderRadius:\"50%\",width:48,height:48,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:1001},onClick:e=>{e.stopPropagation();prevImage();},\"aria-label\":\"Previous image\",children:\"‹\"}),images.length>1&&/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",right:20,top:\"50%\",transform:\"translateY(-50%)\",background:\"rgba(0, 0, 0, 0.5)\",border:\"none\",color:navigationColor,fontSize:24,cursor:\"pointer\",padding:12,borderRadius:\"50%\",width:48,height:48,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:1001},onClick:e=>{e.stopPropagation();nextImage();},\"aria-label\":\"Next image\",children:\"›\"}),/*#__PURE__*/_jsx(motion.img,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},src:typeof images[selectedIndex].src===\"string\"?images[selectedIndex].src:images[selectedIndex].src.src,alt:images[selectedIndex].alt,style:{maxWidth:\"90%\",maxHeight:\"90%\",objectFit:\"contain\",borderRadius,boxShadow:\"0 20px 40px rgba(0, 0, 0, 0.3)\"},onClick:e=>e.stopPropagation()},selectedIndex),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",bottom:20,left:\"50%\",transform:\"translateX(-50%)\",color:navigationColor,fontSize:14,background:\"rgba(0, 0, 0, 0.5)\",padding:\"8px 16px\",borderRadius:20,zIndex:1001},children:[selectedIndex+1,\" / \",images.length]})]})})]});}addPropertyControls(ImageGallery,{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:\"Gallery image\"}}},defaultValue:[{src:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},alt:\"Image 1\"},{src:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},alt:\"Image 2\"},{src:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"},alt:\"Image 3\"},{src:{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Image 4\"},alt:\"Image 4\"}],maxCount:50},columns:{type:ControlType.Number,title:\"Columns\",defaultValue:3,min:1,max:6,step:1,displayStepper:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:16,min:0,max:40,step:2,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:20,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},overlayColor:{type:ControlType.Color,title:\"Modal Overlay\",defaultValue:\"rgba(0, 0, 0, 0.8)\"},navigationColor:{type:ControlType.Color,title:\"Navigation Color\",defaultValue:\"#FFFFFF\"}});\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.map"],"mappings":"4QAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,UAAU,CAAC,CAAC,IAAI,oEAAoE,IAAI,UAAU,CAAC,CAAC,IAAI,uEAAuE,IAAI,UAAU,CAAC,CAAC,IAAI,oEAAoE,IAAI,UAAU,CAAC,CAAC,IAAI,sEAAsE,IAAI,UAAU,CAAC,CAAC,UAAQ,EAAE,MAAI,GAAG,eAAa,EAAE,kBAAgB,UAAU,eAAa,qBAAqB,kBAAgB,WAAW,EAAW,CAAC,EAAc,GAAkBA,EAAS,KAAK,CAAO,EAAUC,EAAY,GAAO,CAAC,M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