{"version":3,"file":"Timer.BbufsBQf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/ych6iWAVXkGHYbGANziV/rC6qGPCCOsWmpRYLHLGc/Timer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";export function Countdown({targetDate,timeFontSize,labelFontSize,timeColor,labelColor,colonColor,timeWeight,labelWeight,spacing}){const calculateTimeLeft=()=>{const difference=new Date(targetDate).getTime()-new Date().getTime();return{days:Math.max(0,Math.floor(difference/(1e3*60*60*24))),hours:Math.max(0,Math.floor(difference/(1e3*60*60)%24)),minutes:Math.max(0,Math.floor(difference/1e3/60%60)),seconds:Math.max(0,Math.floor(difference/1e3%60))};};const[timeLeft,setTimeLeft]=useState(calculateTimeLeft());useEffect(()=>{const timer=setInterval(()=>{setTimeLeft(calculateTimeLeft());},1e3);return()=>clearInterval(timer);},[targetDate]);return /*#__PURE__*/_jsx(\"div\",{style:{textAlign:\"center\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"flex-start\",gap:`${spacing}px`},children:[\"days\",\"hours\",\"minutes\",\"seconds\"].map((unit,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"'Fira Code', monospace\",fontSize:timeFontSize,color:timeColor,fontWeight:500,lineHeight:1},children:String(timeLeft[unit]).padStart(2,\"0\")}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"'Poppins', sans-serif\",fontSize:labelFontSize,color:labelColor,fontWeight:labelWeight,textTransform:\"uppercase\",opacity:.8},children:unit})]},unit)).reduce((acc,el,index,array)=>{if(index<array.length-1){acc.push(el,/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"'Fira Code', monospace\",fontSize:timeFontSize,color:colonColor,fontWeight:500,lineHeight:1,opacity:.6},children:\":\"},`colon-${index}`));}else{acc.push(el);}return acc;},[])})});}// Property Controls\naddPropertyControls(Countdown,{targetDate:{type:ControlType.String,title:\"Target Date\",defaultValue:\"2025-04-07T00:00:00\"},timeFontSize:{type:ControlType.Number,title:\"Time Font Size\",defaultValue:48,min:10,max:100},labelFontSize:{type:ControlType.Number,title:\"Label Font Size\",defaultValue:20,min:10,max:50},timeColor:{type:ControlType.Color,title:\"Time Color\",defaultValue:\"#68FB9A\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"rgba(255, 255, 255, 0.8)\"},colonColor:{type:ControlType.Color,title:\"Colon Color\",defaultValue:\"#FFFFFF\"},timeWeight:{type:ControlType.Number,title:\"Time Weight\",defaultValue:500,min:100,max:900,step:100},labelWeight:{type:ControlType.Number,title:\"Label Weight\",defaultValue:500,min:100,max:900,step:100},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:12,min:5,max:50}});\nexport const __FramerMetadata__ = {\"exports\":{\"Countdown\":{\"type\":\"reactComponent\",\"name\":\"Countdown\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Timer.map"],"mappings":"wLAAmJ,SAAgB,EAAU,CAAC,aAAW,eAAa,gBAAc,YAAU,aAAW,aAAW,aAAW,cAAY,WAAS,CAAC,IAAM,MAAsB,CAAC,IAAM,EAAW,IAAI,KAAK,CAAU,CAAC,CAAC,QAAQ,EAAE,IAAI,KAAK,CAAA,CAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,KAAK,MAAM,GAAY,IAAI,GAAG,GAAG,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,MAAM,GAAY,IAAI,GAAG,IAAI,EAAE,CAAC,EAAE,QAAQ,KAAK,IAAI,EAAE,KAAK,MAAM,EAAW,IAAI,GAAG,EAAE,CAAC,EAAE,Q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