This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-dummy.html
155 lines (150 loc) · 3.91 KB
/
index-dummy.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@500&display=swap" rel="stylesheet">
<style>
body {
background-color: #000000;
font-family: 'Roboto Mono', monospace;
user-select: none;
}
#countdown {
font-size: 10vw;
color: rgb(0,0,0);
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#hint {
text-align: center;
color: rgb(85,85,85);
position: fixed;
left: 50%;
transform: translate(-50%, -50%);
width: 100vw;
font-size: 1.25vw;
top: 80%;
}
</style>
</head>
<body>
<span id="countdown">0:00:00.000</span>
<span id="hint">(if you're reading this, you should enable javascript. or wait another second.)</span>
<script>
/* ===================================================================================
HEY!
This area is not for public vision, so if you're here for some reason (like
you somehow intercepted a certain document, or post-it note on the breakroom
bulletin board that WASN'T MEANT FOR YOU...) then please go no further than
this point.
(This is basically me saying this is the stopping point for if you want to
not spoil yourself. I'm not putting clues past this point that don't show
up on the page itself. If you do choose to look past this point don't spoil
anything for anybody else...PLEASE.
And don't act like you got the answer just for cool points. You didn't.
We'll be able to tell.
Thanks.)
-DS
=================================================================================== */
//
//
//
//
//
//
//
//
//
//
//
// You've
// been
// warned!
//
//
//
//
//
//
//
//
//
//
function countdown(current) {
if (!grayed) {
targetRed = 100;
targetGreen = 50;
targetBlue = 50;
if (red == 100 && green == 50 && blue == 50) {
grayed = true;
}
}
else if (current % 2000 < 1000) {
targetRed = 100;
targetGreen = 50;
targetBlue = 50;
red = 100;
green = 50;
blue = 50;
}
else {
targetRed = 0;
targetGreen = 0;
targetBlue = 0;
red = 0;
green = 0;
blue = 0;
}
red = red + (targetRed - red)/30;
green = green + (targetGreen - green)/30;
blue = blue + (targetBlue - blue)/30;
if (targetRed - 1 < red && red < targetRed + 1) {
red = targetRed;
}
if (targetGreen - 1 < green && green < targetGreen + 1) {
green = targetGreen;
}
if (targetBlue - 1 < blue && blue < targetBlue + 1) {
blue = targetBlue;
}
element.style.color = "rgb(" + red + "," + green + "," + blue + ")";
// here's actual countdown code for you snoops out there.
// use it as you wish.
// go away now, and please try not to spoil anything for anybody...
/*
element.innerHTML = (Math.floor(timeTo/60/60/1000) >= 24 ? Math.floor(timeTo/60/60/1000/24) + ":" : "")
+ Math.floor(timeTo/60/60/1000%24) // hours
+ ":" + (Math.floor(timeTo/60/1000%60) < 10 ? "0" : "") + Math.floor(timeTo/60/1000%60) // minutes
+ ":" + (Math.floor(timeTo/1000%60) < 10 ? "0" : "") + Math.floor(timeTo/1000%60) // seconds
+ (Math.floor(timeTo/60/60/1000) > 0 // milliseconds if there's less than one hour left
? ""
: "." + (Math.floor(timeTo%1000) < 100
? "0" + (Math.floor(timeTo%1000) < 10
? "0" + Math.floor(timeTo%1000)
: Math.floor(timeTo%1000))
: Math.floor(timeTo%1000)
)
);
*/
element.innerHTML = "-99:59:59.999"
requestAnimationFrame(countdown);
}
red = 0;
green = 0;
blue = 0;
targetRed = 0;
targetGreen = 0;
targetBlue = 0;
grayed = false;
tips = [
`the countdown has not been set. come back later.`
]
const element = document.getElementById("countdown");
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("hint").innerHTML = "(" + tips[0] + ")";
})
countdown();
</script>
</body>