{"version":3,"file":"Float.CaLRQBuo.mjs","names":[],"sources":["https:/framerusercontent.com/modules/yRsbbI8DDmjLClYMM4Vl/l1pJC2ShiKocjJBqhD33/Float.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";import{AnimatePresence,motion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function StaticGallery(props){const{images,columns,rows,gap,style,font,fontSize,fontColor,titleFont,descFont,captionPosition,zoom,lightboxSize,maxLightboxWidth,arrowSize}=props;const[activeIndex,setActiveIndex]=useState(null);const[hoveredIndex,setHoveredIndex]=useState(null);const[direction,setDirection]=useState(0);const totalCells=columns*rows;const activeImage=images[activeIndex];const touchStartX=useRef(null);const nextImage=()=>{if(images.length>0){setDirection(1);setActiveIndex((activeIndex+1)%images.length);}};const prevImage=()=>{if(images.length>0){setDirection(-1);setActiveIndex((activeIndex-1+images.length)%images.length);}};useEffect(()=>{const handleKey=e=>{if(activeIndex!==null){if(e.key===\"ArrowRight\")nextImage();else if(e.key===\"ArrowLeft\")prevImage();else if(e.key===\"Escape\")setActiveIndex(null);}};window.addEventListener(\"keydown\",handleKey);document.body.style.overflow=activeIndex!==null?\"hidden\":\"auto\";return()=>{window.removeEventListener(\"keydown\",handleKey);document.body.style.overflow=\"auto\";};},[activeIndex]);const handleTouchStart=e=>{touchStartX.current=e.touches[0].clientX;};const handleTouchEnd=e=>{const touchEndX=e.changedTouches[0].clientX;const diff=touchStartX.current-touchEndX;if(Math.abs(diff)>50){if(diff>0)nextImage();else prevImage();}};const variants={enter:dir=>({x:dir>0?300:-300,opacity:0}),center:{x:0,opacity:1},exit:dir=>({x:dir<0?300:-300,opacity:0})};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"grid\",gridTemplateColumns:`repeat(${columns}, 1fr)`,gridTemplateRows:`repeat(${rows}, 1fr)`,gap:gap,width:\"100%\",height:\"100%\"},children:images.slice(0,totalCells).map((img,index)=>{const isHovered=hoveredIndex===index;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",cursor:\"pointer\"},onClick:()=>setActiveIndex(index),onMouseEnter:()=>setHoveredIndex(index),onMouseLeave:()=>setHoveredIndex(null),children:[/*#__PURE__*/_jsx(\"img\",{src:img.src,alt:img.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"rgba(255,255,255,0.4)\",opacity:isHovered?1:0,transition:\"opacity 0.3s ease-in-out\",pointerEvents:\"none\"}})]},index);})}),/*#__PURE__*/_jsx(AnimatePresence,{custom:direction,children:activeImage&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:\"rgba(0,0,0,0.85)\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999,padding:20,boxSizing:\"border-box\"},onClick:()=>setActiveIndex(null),onTouchStart:handleTouchStart,onTouchEnd:handleTouchEnd,children:[/*#__PURE__*/_jsxs(\"div\",{style:{maxWidth:`${maxLightboxWidth}px`,width:\"90%\",position:\"relative\"},onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsx(motion.img,{src:activeImage.src,alt:activeImage.alt,custom:direction,variants:variants,initial:\"enter\",animate:\"center\",exit:\"exit\",transition:{duration:.3},style:{transform:`scale(${zoom})`,transition:\"transform 0.2s ease\",width:\"100%\",height:\"auto\",objectFit:\"contain\",zIndex:1,marginBottom:16,display:\"block\"}},activeImage.src),/*#__PURE__*/_jsx(\"div\",{onClick:prevImage,style:{position:\"absolute\",left:-arrowSize,top:\"50%\",transform:\"translateY(-50%)\",fontSize:arrowSize,color:\"white\",cursor:\"pointer\",zIndex:2,userSelect:\"none\"},children:\"‹\"}),/*#__PURE__*/_jsx(\"div\",{onClick:nextImage,style:{position:\"absolute\",right:-arrowSize,top:\"50%\",transform:\"translateY(-50%)\",fontSize:arrowSize,color:\"white\",cursor:\"pointer\",zIndex:2,userSelect:\"none\"},children:\"›\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{textAlign:\"center\",maxWidth:\"100%\",color:\"white\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:4,visibility:activeImage.alt?\"visible\":\"hidden\",...titleFont},children:activeImage.alt||\"placeholder\"}),/*#__PURE__*/_jsx(\"div\",{style:{visibility:activeImage.description?\"visible\":\"hidden\",...descFont},children:activeImage.description||\"placeholder\"})]})]},\"lightbox\")})]});}StaticGallery.displayName=\"Static Gallery\";addPropertyControls(StaticGallery,{images:{type:ControlType.Array,control:{type:ControlType.Object,controls:{src:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"png\",\"jpeg\",\"webp\"]},alt:{type:ControlType.String},description:{type:ControlType.String,defaultValue:\"\",displayTextArea:true}}}},columns:{type:ControlType.Number,defaultValue:3,min:1,max:10,displayStepper:true},rows:{type:ControlType.Number,defaultValue:2,min:1,max:10,displayStepper:true},gap:{type:ControlType.Number,defaultValue:0,min:0,max:50,displayStepper:true,unit:\"px\"},fontSize:{type:ControlType.Number,defaultValue:18,displayStepper:true,unit:\"px\"},fontColor:{type:ControlType.Color,defaultValue:\"#000000\",title:\"Hover Text Color\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:18,lineHeight:1.2}},titleFont:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:24,fontWeight:600}},descFont:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1.4}},captionPosition:{type:ControlType.Enum,defaultValue:\"bottom\",options:[\"top\",\"bottom\",\"left\",\"right\"],optionTitles:[\"Top\",\"Bottom\",\"Left\",\"Right\"]},zoom:{type:ControlType.FusedNumber,defaultValue:1,toggleKey:\"auto\",toggleTitles:[\"Custom\",\"Auto\"],valueKeys:[\"zoom\"],valueLabels:[\"Zoom\"],min:.1,max:1.5,step:.01},lightboxSize:{type:ControlType.FusedNumber,defaultValue:80,toggleKey:\"auto\",toggleTitles:[\"Custom\",\"Auto\"],valueKeys:[\"size\"],valueLabels:[\"Size %\"],min:10,max:100,step:1,unit:\"%\"},maxLightboxWidth:{type:ControlType.Number,defaultValue:600,min:100,max:1200,unit:\"px\",displayStepper:true,title:\"Max Lightbox Width\"},arrowSize:{type:ControlType.Number,defaultValue:32,min:12,max:100,unit:\"px\",displayStepper:true,title:\"Arrow Size\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaticGallery\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Float.map"],"mappings":"saAGG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,UAAQ,OAAK,MAAI,QAAM,OAAK,WAAS,YAAU,YAAU,WAAS,kBAAgB,OAAK,eAAa,mBAAiB,YAAU,CAAC,EAAW,CAAC,EAAY,EAAe,CAAC,EAAS,KAAK,CAAM,CAAC,EAAa,EAAgB,CAAC,EAAS,KAAK,CAAM,CAAC,EAAU,EAAa,CAAC,EAAS,EAAE,CAAO,EAAW,EAAQ,EAAW,EAAY,EAAO,GAAmB,EAAY,EAAO,KAAK,CAAO,EAAU,IAAI,CAAC,AAAG,EAAO,OAAO,IAAG,EAAa,EAAE,CAAC,GAAgB,EAAY,GAAG,EAAO,OAAO,CAAG,EAAO,EAAU,IAAI,CAAC,AAAG,EAAO,OAAO,I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