{"version":3,"file":"CountdownTimer.Cz2uCSba.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/sADjPnv2b5C0A7cUubjy/qjTQLQheFytiHVqWRlAU/CountdownTimer.js"],"sourcesContent":["// Fully customizable countdown component with Days, Hours, Minutes, and Seconds\n// Displays large numbers with small labels below in a horizontal row\n// Updates every second and freezes at zero\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * CountdownTimer Timer\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 120\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CountdownTimer(props){const{targetDate,timezone,numberFont,labelFont,numberColor,labelColor,rowGapMode,rowGap,columnGapMode,columnGap,labelSpacing,alignment,cellAlignment,padding,layoutMode,columns,rows}=props;const[timeRemaining,setTimeRemaining]=useState({days:0,hours:0,minutes:0,seconds:0});useEffect(()=>{const calculateTimeRemaining=()=>{const now=new Date().getTime();const target=new Date(targetDate).getTime();// Convert target date to selected timezone\nconst targetInTimezone=new Date(new Date(targetDate).toLocaleString(\"en-US\",{timeZone:timezone})).getTime();const difference=targetInTimezone-now;if(difference<=0){return{days:0,hours:0,minutes:0,seconds:0};}const days=Math.floor(difference/(1e3*60*60*24));const hours=Math.floor(difference%(1e3*60*60*24)/(1e3*60*60));const minutes=Math.floor(difference%(1e3*60*60)/(1e3*60));const seconds=Math.floor(difference%(1e3*60)/1e3);return{days,hours,minutes,seconds};};const updateTimer=()=>{const newTime=calculateTimeRemaining();startTransition(()=>setTimeRemaining(newTime));};updateTimer();const interval=setInterval(updateTimer,1e3);return()=>clearInterval(interval);},[targetDate,timezone]);const formatNumber=num=>{return num.toString().padStart(2,\"0\");};const timeBlocks=[{value:timeRemaining.days,label:\"Days\"},{value:timeRemaining.hours,label:\"Hours\"},{value:timeRemaining.minutes,label:\"Minutes\"},{value:timeRemaining.seconds,label:\"Seconds\"}];const isFixedWidth=props?.style&&props.style.width===\"100%\";const isFixedHeight=props?.style&&props.style.height===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",backgroundColor:\"transparent\",padding,display:\"flex\",justifyContent:alignment,alignItems:\"center\",overflow:\"visible\",...isFixedWidth?{}:{width:\"max-content\"},...isFixedHeight?{}:{height:\"max-content\"}},children:/*#__PURE__*/_jsx(\"div\",{style:{display:layoutMode===\"grid\"?\"grid\":\"flex\",rowGap:rowGapMode===\"fill\"?undefined:rowGap,columnGap:columnGapMode===\"fill\"?undefined:columnGap,alignItems:\"center\",...layoutMode===\"grid\"&&{gridTemplateColumns:`repeat(${columns}, 1fr)`,gridTemplateRows:`repeat(${rows}, 1fr)`,width:\"100%\",height:\"100%\",...rowGapMode===\"fill\"&&{alignContent:\"space-between\"},...columnGapMode===\"fill\"&&{justifyContent:\"space-between\"}},...layoutMode===\"auto\"&&{...columnGapMode===\"fill\"&&{justifyContent:\"space-between\",width:\"100%\"}}},children:timeBlocks.map((block,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:labelSpacing},children:[/*#__PURE__*/_jsx(\"div\",{style:{...numberFont,color:numberColor,lineHeight:1,textAlign:cellAlignment,width:\"100%\"},children:formatNumber(block.value)}),/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,lineHeight:1,textAlign:cellAlignment,width:\"100%\"},children:block.label})]},block.label))})});}addPropertyControls(CountdownTimer,{targetDate:{type:ControlType.Date,title:\"Target Date\",displayTime:true},timezone:{type:ControlType.Enum,title:\"Timezone\",defaultValue:\"UTC\",options:[\"UTC\",\"America/New_York\",\"America/Chicago\",\"America/Denver\",\"America/Los_Angeles\",\"America/Toronto\",\"America/Mexico_City\",\"America/Sao_Paulo\",\"Europe/London\",\"Europe/Paris\",\"Europe/Berlin\",\"Europe/Rome\",\"Europe/Madrid\",\"Europe/Amsterdam\",\"Europe/Stockholm\",\"Europe/Warsaw\",\"Asia/Dubai\",\"Asia/Kolkata\",\"Asia/Singapore\",\"Asia/Tokyo\",\"Asia/Shanghai\",\"Asia/Hong_Kong\",\"Asia/Seoul\",\"Australia/Sydney\",\"Pacific/Auckland\"],optionTitles:[\"UTC\",\"New York (EST/EDT)\",\"Chicago (CST/CDT)\",\"Denver (MST/MDT)\",\"Los Angeles (PST/PDT)\",\"Toronto (EST/EDT)\",\"Mexico City (CST/CDT)\",\"S\\xe3o Paulo (BRT)\",\"London (GMT/BST)\",\"Paris (CET/CEST)\",\"Berlin (CET/CEST)\",\"Rome (CET/CEST)\",\"Madrid (CET/CEST)\",\"Amsterdam (CET/CEST)\",\"Stockholm (CET/CEST)\",\"Warsaw (CET/CEST)\",\"Dubai (GST)\",\"Mumbai (IST)\",\"Singapore (SGT)\",\"Tokyo (JST)\",\"Shanghai (CST)\",\"Hong Kong (HKT)\",\"Seoul (KST)\",\"Sydney (AEDT/AEST)\",\"Auckland (NZDT/NZST)\"]},layoutMode:{type:ControlType.Enum,title:\"Layout Mode\",options:[\"auto\",\"grid\"],optionTitles:[\"Auto (Row)\",\"Grid\"],defaultValue:\"auto\",displaySegmentedControl:true},columns:{type:ControlType.Number,title:\"Columns\",defaultValue:2,min:1,max:4,step:1,displayStepper:true,hidden:({layoutMode})=>layoutMode!==\"grid\"},rows:{type:ControlType.Number,title:\"Rows\",defaultValue:2,min:1,max:4,step:1,displayStepper:true,hidden:({layoutMode})=>layoutMode!==\"grid\"},rowGapMode:{type:ControlType.Enum,title:\"Row Gap Mode\",options:[\"fixed\",\"fill\"],optionTitles:[\"Fixed\",\"Fill\"],defaultValue:\"fixed\",displaySegmentedControl:true},rowGap:{type:ControlType.Number,title:\"Row Gap\",defaultValue:32,min:0,max:100,step:1,unit:\"px\",hidden:({rowGapMode})=>rowGapMode===\"fill\"},columnGapMode:{type:ControlType.Enum,title:\"Column Gap Mode\",options:[\"fixed\",\"fill\"],optionTitles:[\"Fixed\",\"Fill\"],defaultValue:\"fixed\",displaySegmentedControl:true},columnGap:{type:ControlType.Number,title:\"Column Gap\",defaultValue:32,min:0,max:100,step:1,unit:\"px\",hidden:({columnGapMode})=>columnGapMode===\"fill\"},numberFont:{type:ControlType.Font,title:\"Number Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"64px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"}},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"0.05em\",lineHeight:\"1em\"}},numberColor:{type:ControlType.Color,title:\"Number Color\",defaultValue:\"#000000\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#666666\"},labelSpacing:{type:ControlType.Number,title:\"Label Spacing\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},alignment:{type:ControlType.Enum,title:\"Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},cellAlignment:{type:ControlType.Enum,title:\"Cell Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountdownTimer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"120\",\"framerIntrinsicWidth\":\"600\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountdownTimer.map"],"mappings":"+LAWG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,WAAS,aAAW,YA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