-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathitscoming.html
214 lines (200 loc) · 5.61 KB
/
itscoming.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!--I bet you want to know what's coming, right? You'll see in, oh, about THIS much time.-->
<html>
<head>
<title>It's coming.</title>
<link rel="icon" href="pelement.png">
<style>
body{
display:block;
margin:0;
background-color:black;
width:100%;
height:100%;
}
#container{
display:flex;
position:relative;
justify-content:center;
/*Forgive me.*/
margin-top:calc(50vh - 5vw);
}
.number{
display:block;
position:relative;
float:left;
margin-right:1vw;
width:7vw;
height:10vw;
background:white;
font-family:Trebuchet MS,Arial,sans-serif;
font-size:10vw;
line-height:10vw;
text-align:center;
border-radius:0.5vw;
}
.flipbottom{
position:absolute;
border-radius:0 0 0.5vw 0.5vw;
height:5vw;
top:5vw;
overflow:hidden;
line-height:0;
transform-origin: 3.5vw 0;
transform: perspective(200px) rotateX(180deg);
}
.fliptop{
position:absolute;
border-radius:0.5vw 0.5vw 0 0;
height:5vw;
top:0;
overflow:hidden;
transform-origin: 3.5vw 5vw;
transform: perspective(200px) rotateX(0deg);
backface-visibility: hidden;
}
.lower{
position:absolute;
border-radius:0 0 0.5vw 0.5vw;
line-height:0;
height:5vw;
top:5vw;
overflow:hidden;
}
.push{
margin-right:2vw;
}
#broken{
display:none;
position:fixed;
bottom:0.5vw;
width:100%;
text-align:center;
font-size:1.5vw;
font-family:Trebuchet MS,Arial,sans-serif;
color:white;
}
@keyframes flip{
0%{
background:#999;
}
100%{
background:white;
transform: perspective(200px) rotateX(0deg);
}
}
@keyframes flip2{
50%{
background:#999;
}
100%{
background:white;
transform: perspective(200px) rotateX(-180deg);
}
}
</style>
</head>
<body>
<div id="container">
<div class="number main">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main push">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main push">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main push">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
<div class="number main">
<span class="back"></span>
<div class="number lower"></div>
<div class="number flipbottom"></div>
<div class="number fliptop"></div>
</div>
</div>
<div id="broken">EVERYTHING IS BROKEN. PANIC.</div>
<script>
const THANK_GOD=1478725200000;
var counter=0;
var time=['-','-','-','-','-','-','-','-'];
function countdown(){
var diff=Math.floor((THANK_GOD-new Date().getTime())/1000);
if (diff<0){
diff=Math.floor(Math.random()*8553600);
document.getElementById("broken").style.display="block";
}
var days=Math.floor(diff/86430);
var hours=Math.floor(diff/3600)%24;
var minutes=Math.floor(diff/60)%60
var tmpTime=[
Math.floor(days/10),
days%10,
Math.floor(hours/10),
hours%10,
Math.floor(minutes/10),
minutes%10,
Math.floor(diff%60/10),
diff%10
];
for (var i=0;i<time.length;i++){
if (time[i]!=tmpTime[i]){
flip(i,time[i],tmpTime[i]);
}
}
}
function count(){
counter++;
flip(0,counter%10,(counter+1)%10);
}
function flip(id,from,to){
var fb=document.getElementsByClassName("number flipbottom")[id];
var ft=document.getElementsByClassName("number fliptop")[id];
fb.style.animation="flip 700ms forwards 1";
ft.style.animation="flip2 700ms forwards 1";
document.getElementsByClassName("back")[id].innerHTML=to;
fb.innerHTML=to;
ft.innerHTML=from;
setTimeout(function(){
fb.style.animation="none";
ft.style.animation="none";
ft.innerHTML=to;
document.getElementsByClassName("number lower")[id].innerHTML=to;
time[id]=to;
},700);
}
setInterval(countdown,1000);
</script>
</body>
</html>