generated from nighthawkcoders/Nighthawk-Pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
202 lines (177 loc) · 3.92 KB
/
404.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
---
permalink: /404.html
layout: default
search_exclude: true
---
<style type="text/css" media="screen">
@import url("https://fonts.googleapis.com/css?family=Raleway:900&display=swap");
@import url("https://fonts.googleapis.com/css?family=Noto%20Sans%20TC:900&display=swap");
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
font-size: 25px;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
animation-name: rhythm;
animation-duration: 4s;
animation-iteration-count: infinite;
}
h2 {
color: white;
text-align: center;
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
font-family: 'Initial Font', sans-serif;
transition: font-family 1s ease;
}
.hindi {
font-family: 'Hindi Font', sans-serif;
}
.error {
font-size: 25px;
color: green;
}
p {
font-size: 30px;
color: white;
}
img {
width: 2000px;
height: 100px;
}
body {
margin: 0px;
background-color: rgb(242, 160, 242);
background-image: url('../../images/musicInfiniteLoop.gif');
background-size: 405px;
}
#container {
position: absolute;
margin: auto;
width: 100vw;
height: 80pt;
top: 0;
bottom: 0;
filter: url(#threshold) blur(0.6px);
}
#text1, #text2 {
position: absolute;
width: 100%;
display: inline-block;
font-family: "Noto Sans TC", sans-serif;
font-size: 80pt;
text-align: center;
user-select: none;
}
@keyframes rhythm {
from {color: green;}
to {color: yellow;}
}
@keyframes changeFont {
0% {
font-family: 'Initial Font', sans-serif;
}
50% {
font-family: 'New Font', monospace;
}
100% {
font-family: 'Initial Font', sans-serif;
}
}
</style>
<div class="container">
<h1>404 ERROR</h1>
<div class="error">
</div>
</div>
<div id="container">
<span id="text1"></span>
<span id="text2"></span>
</div>
<svg id="filters">
<defs>
<filter id="threshold">
<feColorMatrix in="SourceGraphic" type="matrix" values="1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 255 -140" />
</filter>
</defs>
</svg>
<h2>Uh Oh!</h2>
<script>
const elts = {
text1: document.getElementById("text1"),
text2: document.getElementById("text2")
};
const texts = [
"Classroom",
"Jukebox",
"searched",
"but",
"could",
"not",
"find",
"the",
"requested",
"page",
];
const morphTime = 1;
const cooldownTime = 0.25;
let textIndex = texts.length - 1;
let time = new Date();
let morph = 0;
let cooldown = cooldownTime;
elts.text1.textContent = texts[textIndex % texts.length];
elts.text2.textContent = texts[(textIndex + 1) % texts.length];
function doMorph() {
morph -= cooldown;
cooldown = 0;
let fraction = morph / morphTime;
if (fraction > 1) {
cooldown = cooldownTime;
fraction = 1;
}
setMorph(fraction);
}
function setMorph(fraction) {
elts.text2.style.filter = `blur(${Math.min(8 / fraction - 8, 100)}px)`;
elts.text2.style.opacity = `${Math.pow(fraction, 0.4) * 100}%`;
fraction = 1 - fraction;
elts.text1.style.filter = `blur(${Math.min(8 / fraction - 8, 100)}px)`;
elts.text1.style.opacity = `${Math.pow(fraction, 0.4) * 100}%`;
elts.text1.textContent = texts[textIndex % texts.length];
elts.text2.textContent = texts[(textIndex + 1) % texts.length];
}
function doCooldown() {
morph = 0;
elts.text2.style.filter = "";
elts.text2.style.opacity = "100%";
elts.text1.style.filter = "";
elts.text1.style.opacity = "0%";
}
function animate() {
requestAnimationFrame(animate);
let newTime = new Date();
let shouldIncrementIndex = cooldown > 0;
let dt = (newTime - time) / 1000;
time = newTime;
cooldown -= dt;
if (cooldown <= 0) {
if (shouldIncrementIndex) {
textIndex++;
}
doMorph();
} else {
doCooldown();
}
}
animate();
</script>