{"version":3,"file":"Project_Gallery_Carousel.CTZX8dOF.mjs","names":["useMemo","useState","useRef","useCallback","_Fragment","startTransition"],"sources":["https:/framerusercontent.com/modules/IHSdpRv7aHLzgrcQm4eF/gIoHBFb5BRFcq4AM2nrB/Project_Gallery_Carousel.js"],"sourcesContent":["// User request: Create a new React code component for Framer called \"Project Gallery Carousel\" with dynamic image array slides (1-10), one-at-a-time cover display, radius/aspectRatio controls, arrow + dot navigation, swipe gesture, and fullscreen lightbox with keyboard/backdrop close, SSR-safe behavior, and minimal neutral styling.\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ProjectGalleryCarousel(props){const{imagesJson=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\\nhttps://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"}],radius=24,aspectRatio=1.33,style}=props;const isStaticRenderer=useIsStaticRenderer();const validImages=useMemo(()=>{const parsedLineImages=imagesJson.split(\"\\n\").map(line=>line.trim()).filter(Boolean).map(line=>({src:line,alt:\"Project image\"}));const sourceImages=parsedLineImages.length>0?parsedLineImages:images||[];const filtered=sourceImages.filter(image=>Boolean(image?.src));if(filtered.length>0)return filtered.slice(0,10);return[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"}];},[images,imagesJson]);const totalSlides=validImages.length;const showNavigation=totalSlides>1;const[currentIndex,setCurrentIndex]=useState(0);const[isLightboxOpen,setIsLightboxOpen]=useState(false);const pointerStartX=useRef(null);useEffect(()=>{if(currentIndex>totalSlides-1){startTransition(()=>setCurrentIndex(0));}},[currentIndex,totalSlides]);const goToNext=useCallback(()=>{if(!showNavigation)return;startTransition(()=>setCurrentIndex(prev=>{return(prev+1)%totalSlides;}));},[showNavigation,totalSlides]);const goToPrevious=useCallback(()=>{if(!showNavigation)return;startTransition(()=>setCurrentIndex(prev=>{return(prev-1+totalSlides)%totalSlides;}));},[showNavigation,totalSlides]);const openLightbox=useCallback(()=>{if(isStaticRenderer)return;startTransition(()=>setIsLightboxOpen(true));},[isStaticRenderer]);const closeLightbox=useCallback(()=>{startTransition(()=>setIsLightboxOpen(false));},[]);useEffect(()=>{if(!isLightboxOpen)return;if(typeof window===\"undefined\")return;const onKeyDown=event=>{if(event.key===\"Escape\"){closeLightbox();}else if(event.key===\"ArrowRight\"){goToNext();}else if(event.key===\"ArrowLeft\"){goToPrevious();}};window.addEventListener(\"keydown\",onKeyDown);return()=>{window.removeEventListener(\"keydown\",onKeyDown);};},[isLightboxOpen,closeLightbox,goToNext,goToPrevious]);const onPointerDown=useCallback(event=>{pointerStartX.current=event.clientX;},[]);const onPointerUp=useCallback(event=>{if(pointerStartX.current===null||!showNavigation)return;const deltaX=event.clientX-pointerStartX.current;const threshold=40;if(Math.abs(deltaX)>threshold){if(deltaX<0)goToNext();if(deltaX>0)goToPrevious();}pointerStartX.current=null;},[goToNext,goToPrevious,showNavigation]);const currentImage=validImages[currentIndex];const isHeightAuto=style?.height===undefined||style?.height===\"auto\";const wrapperStyle={position:\"relative\",width:\"100%\",height:isHeightAuto?\"auto\":\"100%\",aspectRatio:isHeightAuto?`${aspectRatio}`:undefined,minHeight:isHeightAuto?180:undefined,overflow:\"hidden\",borderRadius:radius,background:\"#0000000D\",...style};return /*#__PURE__*/_jsxs(\"div\",{style:wrapperStyle,onPointerDown:onPointerDown,onPointerUp:onPointerUp,children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:openLightbox,\"aria-label\":\"Open image in fullscreen\",style:{position:\"relative\",width:\"100%\",height:\"100%\",padding:0,border:\"none\",background:\"transparent\",cursor:isStaticRenderer?\"default\":\"zoom-in\",display:\"block\"},children:/*#__PURE__*/_jsx(\"img\",{src:currentImage?.src,srcSet:currentImage?.srcSet,alt:currentImage?.alt||`Project image ${currentIndex+1}`,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",pointerEvents:\"none\"}})}),showNavigation&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Previous image\",onClick:goToPrevious,style:arrowButtonStyle(\"left\"),children:/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:chevronStyle,children:\"‹\"})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Next image\",onClick:goToNext,style:arrowButtonStyle(\"right\"),children:/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:chevronStyle,children:\"›\"})})]}),showNavigation&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:\"50%\",bottom:12,transform:\"translateX(-50%)\",display:\"flex\",alignItems:\"center\",gap:8,zIndex:3},children:validImages.map((_,index)=>/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":`Go to image ${index+1}`,onClick:()=>startTransition(()=>setCurrentIndex(index)),style:{width:8,height:8,borderRadius:999,border:\"none\",padding:0,cursor:\"pointer\",background:index===currentIndex?\"#FFFFFF\":\"#FFFFFF80\"}},`dot-${index}`))}),isLightboxOpen&&!isStaticRenderer&&/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":\"Project gallery fullscreen viewer\",onClick:closeLightbox,style:{position:\"fixed\",inset:0,background:\"rgba(0, 0, 0, 0.88)\",zIndex:9999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:24},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:closeLightbox,\"aria-label\":\"Close fullscreen viewer\",style:{position:\"absolute\",top:16,right:16,width:40,height:40,borderRadius:999,border:\"none\",background:\"rgba(0, 0, 0, 0.5)\",color:\"#FFFFFF\",cursor:\"pointer\",fontSize:24,lineHeight:1},children:\"\\xd7\"}),/*#__PURE__*/_jsxs(\"div\",{onClick:event=>event.stopPropagation(),style:{position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[/*#__PURE__*/_jsx(\"img\",{src:currentImage?.src,srcSet:currentImage?.srcSet,alt:currentImage?.alt||`Project image ${currentIndex+1}`,style:{maxWidth:\"100%\",maxHeight:\"100%\",objectFit:\"contain\",display:\"block\"}}),showNavigation&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Previous image\",onClick:goToPrevious,style:arrowButtonStyle(\"left\",true),children:/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:chevronStyle,children:\"‹\"})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Next image\",onClick:goToNext,style:arrowButtonStyle(\"right\",true),children:/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:chevronStyle,children:\"›\"})})]})]})]})]});}function arrowButtonStyle(side,isLightbox=false){return{position:\"absolute\",top:\"50%\",[side]:isLightbox?16:12,transform:\"translateY(-50%)\",width:36,height:36,borderRadius:999,border:\"none\",background:\"rgba(0, 0, 0, 0.45)\",color:\"#FFFFFF\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:3};}const chevronStyle={fontSize:22,lineHeight:1};addPropertyControls(ProjectGalleryCarousel,{imagesJson:{title:\"Image URLs\",type:ControlType.String,displayTextArea:true,defaultValue:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\\nhttps://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\\nhttps://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\"},images:{title:\"Images\",type:ControlType.Array,maxCount:10,defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"}],control:{type:ControlType.ResponsiveImage}},radius:{title:\"Radius\",type:ControlType.Number,defaultValue:24,min:0,max:80,step:1},aspectRatio:{title:\"Aspect Ratio\",type:ControlType.Number,defaultValue:1.33,min:.5,max:2,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProjectGalleryCarousel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Project_Gallery_Carousel.map"],"mappings":"4OAIG,SAAwB,EAAuB,EAAM,CAAC,GAAK,CAAC,aAAW;mEAAyI,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,mBAAmB,CAAC,EAAE,SAAO,GAAG,cAAY,KAAK,SAAO,EAAY,EAAiB,EAAoB,EAAQ,EAAYA,MAAY,CAAC,IAAM,EAAiB,EAAW,MAAM;CAAI,CAAC,CAAC,IAAI,GAAM,EAAK,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,IAAO,CAAC,IAAI,EAAK,IAAI,eAAe,EAAE,EAAiF,GAA5D,EAAiB,OAAO,EAAE,EAAiB,GAAQ,CAAC,EAAA,CAA8B,OAAO,GAAO,EAAQ,GAAO,GAAI,EAAmD,OAA9C,EAAS,OAAO,EAAS,EAAS,MAAM,EAAE,EAAE,EAAQ,CAAC,CAAC,IAAI,sEAAsE,IAAI,mBAAmB,CAAC,CAAE,EAAE,CAAC,EAAO,CAAU,CAAC,EAAQ,EAAY,EAAY,OAAa,EAAe,EAAY,EAAO,CAAC,EAAa,GAAiBC,EAAS,CAAC,EAAO,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