Skip to content

Commit c53fe20

Browse files
committed
feat: add ms (temporary)
1 parent 838d663 commit c53fe20

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pages/countdown.astro

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const eventEnd = import.meta.env.EVENT_END;
3535
<h1
3636
id="countdown"
3737
data-end={eventEnd}
38-
class="text-9xl tracking-wider animate-squiggle uppercase"
38+
class="text-9xl font-black tracking-wider animate-squiggle uppercase font-mono"
3939
>
4040
--:--:--
4141
</h1>
@@ -81,11 +81,14 @@ const eventEnd = import.meta.env.EVENT_END;
8181
2,
8282
"0",
8383
);
84+
const miliseconds = String(
85+
Math.floor((remainingTime % 1000) / 10),
86+
).padStart(2, "0");
8487

85-
countdownElement.innerText = `${hours}:${minutes}:${seconds}`;
88+
countdownElement.innerText = `${hours}:${minutes}:${seconds}.${miliseconds}`;
8689
}
8790

8891
updateCountdown();
89-
const timer = setInterval(updateCountdown, 1000);
92+
const timer = setInterval(updateCountdown, 10);
9093
</script>
9194
</BaseLayout>

0 commit comments

Comments
 (0)