{"version":3,"file":"CountdownTimer_1.Dsapy1Z7.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/cA0KAYwrW9fzt4L042wx/l8cON7be6O00pBtWMDqv/CountdownTimer_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Daily Countdown Timer\n *\n * A countdown timer that restarts every day at the same time (8PM EST by default).\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CountdownTimer(props){const{targetHour=20,targetMinute=0,timezoneOffset=-5,backgroundColor=\"#111111\",textColor=\"#FFFFFF\",labelColor=\"#888888\",font,labelFont,showLabels=true,labelText=\"\"}=props;const[timeLeft,setTimeLeft]=useState({hours:0,minutes:0,seconds:0});useEffect(()=>{if(typeof window===\"undefined\")return;const calculateTimeLeft=()=>{const now=new Date;// Create target time in EST\nconst target=new Date;target.setUTCHours(targetHour-timezoneOffset);target.setUTCMinutes(targetMinute);target.setUTCSeconds(0);target.setUTCMilliseconds(0);// If target time has passed today, move to tomorrow\nif(target.getTime()<=now.getTime()){target.setUTCDate(target.getUTCDate()+1);}const diff=target.getTime()-now.getTime();const hours=Math.floor(diff/(1e3*60*60));const minutes=Math.floor(diff%(1e3*60*60)/(1e3*60));const seconds=Math.floor(diff%(1e3*60)/1e3);return{hours,minutes,seconds};};// Initial calculation\nstartTransition(()=>setTimeLeft(calculateTimeLeft()));// Update every second\nconst interval=setInterval(()=>{startTransition(()=>setTimeLeft(calculateTimeLeft()));},1e3);return()=>clearInterval(interval);},[targetHour,targetMinute,timezoneOffset]);const formatNumber=num=>num.toString().padStart(2,\"0\");const timeUnitStyle={display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:4};const numberStyle={fontSize:font?.fontSize||\"48px\",fontWeight:font?.fontWeight||700,fontFamily:font?.fontFamily||\"Inter, sans-serif\",lineHeight:\"1\",color:textColor,minWidth:\"60px\",textAlign:\"center\"};const unitLabelStyle={fontSize:labelFont?.fontSize||\"12px\",fontWeight:labelFont?.fontWeight||500,fontFamily:labelFont?.fontFamily||\"Inter, sans-serif\",textTransform:\"uppercase\",letterSpacing:\"0.1em\",color:labelColor};const separatorStyle={fontSize:font?.fontSize||\"48px\",fontWeight:font?.fontWeight||700,fontFamily:font?.fontFamily||\"Inter, sans-serif\",color:textColor,lineHeight:\"1\",paddingBottom:showLabels?\"20px\":\"0\"};return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,padding:\"3% 5%\",borderRadius:\"16px\",gap:showLabels?8:0,minWidth:\"max-content\",height:\"100%\",width:\"100%\",boxSizing:\"border-box\"},children:[showLabels&&/*#__PURE__*/_jsx(\"span\",{style:{fontSize:labelFont?.fontSize||\"14px\",fontWeight:labelFont?.fontWeight||500,fontFamily:labelFont?.fontFamily||\"Inter, sans-serif\",color:labelColor,textTransform:\"uppercase\",letterSpacing:\"0.05em\"},children:labelText}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:8},children:[/*#__PURE__*/_jsxs(\"div\",{style:timeUnitStyle,children:[/*#__PURE__*/_jsx(\"span\",{style:numberStyle,children:formatNumber(timeLeft.hours)}),showLabels&&/*#__PURE__*/_jsx(\"span\",{style:unitLabelStyle,children:\"Hours\"})]}),/*#__PURE__*/_jsx(\"span\",{style:separatorStyle,children:\":\"}),/*#__PURE__*/_jsxs(\"div\",{style:timeUnitStyle,children:[/*#__PURE__*/_jsx(\"span\",{style:numberStyle,children:formatNumber(timeLeft.minutes)}),showLabels&&/*#__PURE__*/_jsx(\"span\",{style:unitLabelStyle,children:\"Minutes\"})]}),/*#__PURE__*/_jsx(\"span\",{style:separatorStyle,children:\":\"}),/*#__PURE__*/_jsxs(\"div\",{style:timeUnitStyle,children:[/*#__PURE__*/_jsx(\"span\",{style:numberStyle,children:formatNumber(timeLeft.seconds)}),showLabels&&/*#__PURE__*/_jsx(\"span\",{style:unitLabelStyle,children:\"Seconds\"})]})]})]});}addPropertyControls(CountdownTimer,{targetHour:{type:ControlType.Number,title:\"Target Hour\",defaultValue:20,min:0,max:23,step:1,unit:\"h\"},targetMinute:{type:ControlType.Number,title:\"Target Minute\",defaultValue:0,min:0,max:59,step:1,unit:\"m\"},timezoneOffset:{type:ControlType.Number,title:\"Timezone Offset\",defaultValue:-5,min:-12,max:14,step:.5,unit:\"hrs\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111111\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#888888\"},font:{type:ControlType.Font,title:\"Number Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"48px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"}},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"12px\",variant:\"Medium\",letterSpacing:\"0.1em\",lineHeight:\"1em\"}},showLabels:{type:ControlType.Boolean,title:\"Show Labels\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},labelText:{type:ControlType.String,title:\"Label Text\",defaultValue:\"\",placeholder:\"Enter label text...\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountdownTimer\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"300\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountdownTimer_1.map"],"mappings":"6MAUG,SAA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