-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcountdown.html
More file actions
26 lines (23 loc) · 932 Bytes
/
countdown.html
File metadata and controls
26 lines (23 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<div style="background-color: #000000;color:#FFFF00; font-size: 85px; font-weight: normal">
<center>
Nome do Evento - Faltam
<div id="dday"></div>
</center>
</div>
<script>
var countDownDate = new Date("April 25, 2022 12:00:00").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("dday").innerHTML = days + " dias " + hours + ":"
+ minutes + ":" + seconds + "s";
if (distance < 0) {
clearInterval(x);
document.getElementById("dday").innerHTML = "EVENTO JÁ ACONTECEU!";
}
}, 1000);
</script>