{"version":3,"file":"Countdown.DPI0o7Bl.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/4kniYL9OKguGQ1YJbCvQ/m9LEixjmScYNV26BwNbl/Countdown.js"],"sourcesContent":["// Countdown component with customizable number and label sizes, colors, and fonts\n// Numbers displayed large at top, labels (days, hours, minutes, seconds) below\n// Separate controls for number and label styling\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Countdown(props){const{targetDate,numberColor,labelColor,numberFont,labelFont,showDays,showHours,showMinutes,showSeconds,gap}=props;const[timeLeft,setTimeLeft]=useState({days:0,hours:0,minutes:0,seconds:0});useEffect(()=>{const calculateTimeLeft=()=>{const difference=+new Date(targetDate)-+new Date;if(difference>0){startTransition(()=>{setTimeLeft({days:Math.floor(difference/(1e3*60*60*24)),hours:Math.floor(difference/(1e3*60*60)%24),minutes:Math.floor(difference/1e3/60%60),seconds:Math.floor(difference/1e3%60)});});}else{startTransition(()=>{setTimeLeft({days:0,hours:0,minutes:0,seconds:0});});}};calculateTimeLeft();const timer=setInterval(calculateTimeLeft,1e3);return()=>clearInterval(timer);},[targetDate]);const formatNumber=num=>String(num).padStart(2,\"0\");const units=[{value:timeLeft.days,label:\"Days\",show:showDays},{value:timeLeft.hours,label:\"Hours\",show:showHours},{value:timeLeft.minutes,label:\"Minutes\",show:showMinutes},{value:timeLeft.seconds,label:\"Seconds\",show:showSeconds}];const visibleUnits=units.filter(unit=>unit.show);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:`${gap}px`,alignItems:\"center\",justifyContent:\"center\"},children:visibleUnits.map((unit,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"8px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{color:numberColor,...numberFont,lineHeight:\"1em\"},children:formatNumber(unit.value)}),/*#__PURE__*/_jsx(\"div\",{style:{color:labelColor,...labelFont,lineHeight:\"1em\"},children:unit.label})]},unit.label))});}addPropertyControls(Countdown,{targetDate:{type:ControlType.Date,title:\"Target Date\",displayTime:true},numberColor:{type:ControlType.Color,title:\"Number Color\",defaultValue:\"#000000\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000000\"},numberFont:{type:ControlType.Font,title:\"Number Font\",defaultValue:{fontSize:\"64px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},labelFont:{type:ControlType.Font,title:\"Label Font\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"0.05em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:32,min:0,max:100,step:1,unit:\"px\"},showDays:{type:ControlType.Boolean,title:\"Show Days\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showHours:{type:ControlType.Boolean,title:\"Show Hours\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showMinutes:{type:ControlType.Boolean,title:\"Show Minutes\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Countdown\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Countdown.map"],"mappings":"+LAMG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,aAAW,cAAY,aAAW,aAAW,YAAU,WAAS,YAAU,cAAY,cAAY,OA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