{"version":3,"file":"GridPreloader.CWCsDMfV.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Ou8GSJlbH9aZnKCcwRLF/iBtZkiAGEv2xhOcUmxKz/GridPreloader.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const gridSize=8// Number of rows and columns\n;export function GridPreloader({duration,primaryColor,backgroundColor,onFinish}){const[loading,setLoading]=useState(true);useEffect(()=>{const timer=setTimeout(()=>{setLoading(false);onFinish?.();},duration);return()=>clearTimeout(timer)// Cleanup timeout\n;},[duration,onFinish]);const randomDelays=Array.from({length:gridSize*gridSize}).map(()=>Math.random()*.8// Adjust animation randomness\n);return /*#__PURE__*/_jsx(AnimatePresence,{children:loading&&/*#__PURE__*/_jsx(motion.div,{exit:{opacity:0,transition:{duration:.8}},style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",display:\"grid\",gridTemplateColumns:`repeat(${gridSize}, 1fr)`,gridTemplateRows:`repeat(${gridSize}, 1fr)`,background:backgroundColor,zIndex:9999,placeItems:\"center\"},children:randomDelays.map((delay,index)=>/*#__PURE__*/_jsx(motion.div,{style:{aspectRatio:\"1 / 1\",width:\"100%\",height:\"100%\",background:primaryColor},initial:{opacity:1},animate:{opacity:0},transition:{delay,duration:.5,ease:\"easeInOut\"}},index))})});}addPropertyControls(GridPreloader,{duration:{type:ControlType.Number,defaultValue:3e3,min:1e3,max:1e4,step:500,unit:\"ms\"},primaryColor:{type:ControlType.Color,defaultValue:\"#001270\"},backgroundColor:{type:ControlType.Color,defaultValue:\"#000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"GridPreloader\":{\"type\":\"reactComponent\",\"name\":\"GridPreloader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GridPreloader.map"],"mappings":"yO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