-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
52 lines (47 loc) · 1.9 KB
/
index.html
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<title>Summer Countdown</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container">
<article class="content">
<h1>Countdown of <span id="bio">Summer</span></h1>
<div class="launch-time">
<div>
<p class="bigger" id="days">00</p>
<span>Days</span>
</div>
<div>
<p class="bigger" id="hours">00</p>
<span>Hours</span>
</div>
<div>
<p class="bigger" id="minutes">00</p>
<span>Minutes</span>
</div>
<div>
<p class="bigger" id="seconds">00</p>
<span>Seconds</span>
</div>
</div>
</article>
</div>
<script>
var countDownDate = new Date ("August 19, 2024 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("days").innerHTML = days;
document.getElementById("hours").innerHTML = hours;
document.getElementById("minutes").innerHTML = minutes;
document.getElementById("seconds").innerHTML = seconds;
},1000)
</script>
</body>
</html>