Skip to content

Commit

Permalink
Add countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal-Atlas committed Jul 17, 2024
1 parent 717ce3b commit db8f63f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div><h1 id="time"></h1></div>

<style>
body { text-align: center; }
div {
margin: 50vh;
height: 100vh;
}
h1 {
margin: auto;
width: auto;
}
</style>
<script>
const time = document.getElementById("time")
const meet = 1721367000000
const minute = 60
const hour = 60 * minute
const day = 24 * hour
const update = () => {
now = new Date()
span = Math.floor((meet - now) / 1000)
d = Math.floor(span / day)
span = span - day * d
h = Math.floor(span / hour)
span = span - hour * h
m = Math.floor(span / minute)
span = span - minute * m
s = span
time.innerText = d + " Day and " + h + ":" + m + ":" + s
}
setInterval(update, 1000)
</script>

0 comments on commit db8f63f

Please sign in to comment.