{"version":3,"file":"GridPreloader.B1JCDTST.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":"yOAC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