-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
160 lines (125 loc) · 3.35 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<body>
<div class="container">
<h1 id="headline">The Green Opens In:</h1>
<div id="countdown">
<ul>
<li><span id="days"></span>days</li>
<li><span id="hours"></span>Hours</li>
<li><span id="minutes"></span>Minutes</li>
<li><span id="seconds"></span>Seconds</li>
</ul>
</div>
<div class="message">
<div id="content">
<span class="emoji">🥳</span>
<span class="emoji">🎉</span>
<span class="emoji">🎂</span>
</div>
</div>
</div>
</body>
<style>
/* general styling */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
margin: 0;
}
body {
align-items: center;
background-color: #0f9e16;
display: flex;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.bgimg {
background-image: url('jacarnda_touched.png');
min-height: 100%;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
}
.container {
color: rgb(199, 83, 199);
margin: 0 auto;
text-align: center;
}
h1 {
font-weight: normal;
letter-spacing: 0.125rem;
text-transform: uppercase;
}
li {
display: inline-block;
font-size: 1.5em;
list-style-type: none;
padding: 1em;
text-transform: uppercase;
}
li span {
display: block;
font-size: 4.5rem;
}
.message {
font-size: 4rem;
}
#content {
display: none;
padding: 1rem;
}
.emoji {
padding: 0 0.25rem;
}
@media all and (max-width: 768px) {
h1 {
font-size: 1.5rem;
}
li {
font-size: 1.125rem;
padding: 0.75rem;
}
li span {
font-size: 3.375rem;
}
}
</style>
<script>
(function () {
const second = 1000,
minute = second * 60,
hour = minute * 60,
day = hour * 24;
let birthday = "Dec 11, 2021 18:00:00",
countDown = new Date(birthday).getTime(),
x = setInterval(function () {
let now = new Date().getTime(),
distance = countDown - now;
(document.getElementById("days").innerText = Math.floor(distance / day)),
(document.getElementById("hours").innerText = Math.floor(
(distance % day) / hour
)),
(document.getElementById("minutes").innerText = Math.floor(
(distance % hour) / minute
)),
(document.getElementById("seconds").innerText = Math.floor(
(distance % minute) / second
));
//do something later when date is reached
if (distance < 0) {
let headline = document.getElementById("headline"),
countdown = document.getElementById("countdown"),
content = document.getElementById("content");
headline.innerText = "Giddy up!";
countdown.style.display = "none";
content.style.display = "block";
clearInterval(x);
}
//seconds
}, 0);
})();
</script>