-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
146 lines (122 loc) · 3.84 KB
/
index.html
File metadata and controls
146 lines (122 loc) · 3.84 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TechX 2019 Capstone Hackathon</title>
<style>
@font-face {
font-family: NesobriteEx-Bold;
src: url(./font.ttf);
}
.frame {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
background: black;
}
.bg {
display: none;
position: absolute;
width: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
.bg-mobile {
display: none;
position: absolute;
height: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
.widget {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 90%;
}
#countdown {
color: white;
font-size: 95px;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: NesobriteEx-Bold;
width: auto;
z-index: 3;
}
@media only screen and (max-width: 600px) {
.bg-mobile {
display: block;
}
.widget {
width: 180%;
}
#countdown {
font-size: 20px;
}
}
@media only screen and (min-width: 667px) {
.bg {
display: block;
width: 90%;
}
#countdown {
font-size: 40px;
}
}
@media only screen and (min-width: 980px) {
#countdown {
font-size: 60px;
}
}
</style>
</head>
<body>
<div class="frame">
<img src="pc.png" class="bg">
<img src="mobile.png" class="bg-mobile">
<img src="center.png" class="widget">
<div id="countdown">READY?</div>
</div>
<script>
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
// Set the date we're counting down to
var startCountDownDate = new Date("July 29, 2019 21:00:00").getTime();
var countDownDate = new Date("July 30, 2019 21:00:00").getTime();
// Update the count down every 1 second
var x = setInterval(function () {
if (new Date().getTime() >= startCountDownDate) {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
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);
// Display the result in the element with id="demo"
document.getElementById("countdown").innerText = pad(hours, 2) + " : " + pad(minutes, 2) + " : " + pad(seconds, 2);
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("countdown").innerHTML = "TIME UP";
}
}
}, 1000);
</script>
</body>
</html>