{"version":3,"file":"Timer.CweqVRWN.mjs","names":[],"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":"iRAAmJ,SAAgB,EAAU,CAAC,aAAW,eAAa,gBAAc,YAAU,aAAW,aAAW,aAAW,cAAY,UAAQ,CAAC,CAAC,IAAM,EAAkB,IAAI,CAAC,IAAM,EAAW,IAAI,KAAK,GAAY,SAAS,CAAC,IAAI,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,KAAK,MAAM,GAAY,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE,KAAK,MAAM,GAAY,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,KAAK,IAAI,EAAE,KAAK,MAAM,EAAW,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQ,KAAK,IAAI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