{"version":3,"file":"OK_Gallery_Lite.eb5BBExK.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/TKc145sW0WKDunDWlAVc/RwlKbYauqlGQ32hH9jSZ/OK_Gallery_Lite.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function MasonryGallery({images,paddingTop,paddingRight,paddingBottom,paddingLeft,gap,overlayColor,overlayOpacity,columns,zoomScale,lightboxOpacity,overlayTransition,zoomTransition,tiltIntensity,lightboxBlur,lightboxControlsColor,enableLightbox}){const[lightboxIndex,setLightboxIndex]=React.useState(null);const[hoverIndex,setHoverIndex]=React.useState(null);const[tilt,setTilt]=React.useState({x:0,y:0});const[visibleImages,setVisibleImages]=React.useState([]);const[currentColumns,setCurrentColumns]=React.useState(columns);// Responsive columns\nReact.useEffect(()=>{function handleResize(){const width=window.innerWidth;if(width<480)setCurrentColumns(1);else if(width<768)setCurrentColumns(Math.min(2,columns));else if(width<1024)setCurrentColumns(Math.min(3,columns));else setCurrentColumns(columns);}handleResize();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);},[columns]);// Fade-in animation\nReact.useEffect(()=>{images.forEach((_,i)=>{setTimeout(()=>setVisibleImages(prev=>[...prev,i]),i*100);});},[images]);// Detect hover support\nconst[supportsHover,setSupportsHover]=React.useState(true);React.useEffect(()=>{setSupportsHover(window.matchMedia(\"(hover: hover)\").matches);},[]);const handleMouseMove=(e,index)=>{const rect=e.currentTarget.getBoundingClientRect();const x=((e.clientX-rect.left)/rect.width-.5)*tiltIntensity*2;const y=((e.clientY-rect.top)/rect.height-.5)*-tiltIntensity*2;setTilt({x,y});setHoverIndex(index);};return /*#__PURE__*/_jsxs(\"div\",{style:{paddingTop,paddingRight,paddingBottom,paddingLeft},children:[/*#__PURE__*/_jsx(\"div\",{style:{columnCount:currentColumns,columnGap:gap},children:images.map((src,i)=>/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:gap,position:\"relative\",borderRadius:12,overflow:\"hidden\",cursor:\"pointer\",display:\"inline-block\",width:\"100%\",backgroundColor:\"transparent\",opacity:visibleImages.includes(i)?1:0,transform:visibleImages.includes(i)?\"translateY(0)\":\"translateY(20px)\",transition:\"opacity 0.6s ease, transform 0.6s ease\"},onMouseEnter:e=>supportsHover&&handleMouseMove(e,i),onMouseMove:e=>supportsHover&&handleMouseMove(e,i),onMouseLeave:()=>{supportsHover&&setHoverIndex(null);setTilt({x:0,y:0});},onClick:()=>{if(enableLightbox)setLightboxIndex(i)// NEW\n    ;},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",overflow:\"hidden\",borderRadius:\"inherit\"},children:[/*#__PURE__*/_jsx(\"img\",{src:src,alt:`Image ${i}`,style:{width:\"100%\",height:\"auto\",display:\"block\",transition:`transform ${zoomTransition}s ease`,transform:supportsHover&&hoverIndex===i?`scale(${zoomScale}) rotateX(${tilt.y}deg) rotateY(${tilt.x}deg)`:\"scale(1)\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:overlayColor,opacity:supportsHover&&hoverIndex===i?overlayOpacity:0,transition:`opacity ${overlayTransition}s ease`,pointerEvents:\"none\"}})]})},i))}),enableLightbox&&lightboxIndex!==null&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:`rgba(0,0,0,${lightboxOpacity})`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999,flexDirection:\"column\",padding:20,backdropFilter:`blur(${lightboxBlur}px)`,transition:\"opacity 0.4s ease\"},onClick:()=>setLightboxIndex(null),children:[/*#__PURE__*/_jsx(\"img\",{src:images[lightboxIndex],alt:`Lightbox ${lightboxIndex}`,style:{maxWidth:\"90%\",maxHeight:\"80%\",borderRadius:10}}),/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",left:20,top:\"50%\",transform:\"translateY(-50%)\",background:\"transparent\",border:\"none\",color:lightboxControlsColor,fontSize:40,cursor:\"pointer\"},onClick:e=>{e.stopPropagation();setLightboxIndex(prev=>prev!==null?(prev-1+images.length)%images.length:null);},children:\"‹\"}),/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",right:20,top:\"50%\",transform:\"translateY(-50%)\",background:\"transparent\",border:\"none\",color:lightboxControlsColor,fontSize:40,cursor:\"pointer\"},onClick:e=>{e.stopPropagation();setLightboxIndex(prev=>prev!==null?(prev+1)%images.length:null);},children:\"›\"}),/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",top:20,right:20,background:\"transparent\",border:\"none\",color:lightboxControlsColor,fontSize:30,cursor:\"pointer\"},onClick:()=>setLightboxIndex(null),children:\"\\xd7\"})]})]});}// ===== Default Props =====\nMasonryGallery.defaultProps={images:[],paddingTop:20,paddingRight:0,paddingBottom:20,paddingLeft:0,gap:20,overlayColor:\"#F15B2A\",overlayOpacity:.2,columns:2,zoomScale:1.05,lightboxOpacity:.1,overlayTransition:.1,zoomTransition:.1,tiltIntensity:5,lightboxBlur:6,lightboxControlsColor:\"#ffffff\",enableLightbox:true};addPropertyControls(MasonryGallery,{// ===== Images Section =====\nimages:{type:ControlType.Array,propertyControl:{type:ControlType.Image},section:\"Images\",description:\"Add your gallery images\"},// ===== Layout Section =====\npaddingTop:{type:ControlType.Number,title:\"Padding Top\",section:\"Layout\"},paddingRight:{type:ControlType.Number,title:\"Padding Right\",section:\"Layout\"},paddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",section:\"Layout\"},paddingLeft:{type:ControlType.Number,title:\"Padding Left\",section:\"Layout\",description:\"Adjust the padding of the gallery component\"},gap:{type:ControlType.Number,title:\"Gap\",section:\"Layout\",description:\"Adjust the gap inbetween the gallery images\"},columns:{type:ControlType.Number,title:\"Columns\",min:1,max:6,step:1,section:\"Layout\",description:\"Adjust the amount of columns in the gallery\"},// ===== Hover Section =====\nzoomScale:{type:ControlType.Number,title:\"Zoom Scale\",min:1,max:2,step:.01,section:\"Hover Effects\"},zoomTransition:{type:ControlType.Number,title:\"Zoom Transition (s)\",min:0,max:2,step:.05,section:\"Hover Effects\",description:\"Adjust the hover zoom\"},tiltIntensity:{type:ControlType.Number,title:\"Hover Tilt\",min:0,max:15,step:.1,section:\"Hover Effects\",description:\"Adjust the hover tilt\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",section:\"Hover Effects\"},overlayOpacity:{type:ControlType.Number,title:\"Overlay Opacity\",min:0,max:1,step:.05,section:\"Hover Effects\"},overlayTransition:{type:ControlType.Number,title:\"Overlay Fade (s)\",min:0,max:2,step:.05,section:\"Hover Effects\",description:\"Adjust the hover overlay\"},// ===== Lightbox Section =====\nenableLightbox:{// NEW\ntype:ControlType.Boolean,title:\"Enable Lightbox\",defaultValue:true,section:\"Lightbox\"},lightboxOpacity:{type:ControlType.Number,title:\"Lightbox Opacity\",min:0,max:1,step:.05,section:\"Lightbox\"},lightboxBlur:{type:ControlType.Number,title:\"Lightbox Blur\",min:0,max:50,step:1,section:\"Lightbox\"},lightboxControlsColor:{type:ControlType.Color,title:\"Controls Color\",section:\"Lightbox\",description:\"Adjust the lightbox\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MasonryGallery\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OK_Gallery_Lite.map"],"mappings":"iMAAyI,SAAwB,EAAe,CAAC,SAAO,aAAW,eAAa,gBAAc,cAAY,MAAI,eAAa,iBAAe,UAAQ,YAAU,kBAAgB,oBAAkB,iBAAe,gBAAc,eAAa,wBAAsB,kBAAgB,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAe,KAAK,CAAM,CAAC,EAAW,GAAeA,EAAe,KAAK,CAAM,CAAC,EAAK,GAASA,EAAe,CAAC,EAAE,EAAE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