-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
253 lines (221 loc) · 7.67 KB
/
404.html
File metadata and controls
253 lines (221 loc) · 7.67 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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!DOCTYPE html>
<!--
_ _ _ _ ____ _
| \ | | __ _| |_| |__ __ _ _ __ / ___|_ __ ___ ___ _ __ | |__ __ ___ __
| \| |/ _` | __| '_ \ / _` | '_ \| | _| '__/ _ \/ _ \ '_ \| '_ \ / _` \ \ /\ / /
| |\ | (_| | |_| | | | (_| | | | | |_| | | | __/ __/ | | | | | | (_| |\ V V /
|_| \_|\__,_|\__|_| |_|\__,_|_| |_|\____|_| \___|\___|_| |_|_| |_|\__,_| \_/\_/
Hey there, fellow code explorer! Thanks for peeking under the hood.
Feel free to look around - it's just HTML, CSS, and a bit of vanilla JS.
Want to chat? me@nathangreenhaw.org
(Hold Shift while viewing the page)
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>404 | Nathan Greenhaw</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="404 - Page not found on Nathan Greenhaw's website." />
<link rel="icon" type="image/svg+xml" href="favicon.svg">
<style>
:root {
--terminal-green: #33ff33;
--terminal-dark: #0a0a0a;
}
.amber {
--terminal-green: #ffb000;
}
html.transitions-ready, html.transitions-ready *, html.transitions-ready *::before, html.transitions-ready *::after {
transition: color 100ms, text-shadow 100ms, border-color 100ms, box-shadow 100ms;
}
* {
box-sizing: border-box;
margin: 0;
}
html {
height: 100%;
background: var(--terminal-dark);
color: var(--terminal-green);
}
body {
font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
min-height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 2em;
text-shadow: 0 0 3px rgba(51, 255, 51, 0.5);
}
/* CRT scanline effect */
body::before {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
background: repeating-linear-gradient(
0deg,
rgba(0, 0, 0, 0.15),
rgba(0, 0, 0, 0.15) 1px,
transparent 1px,
transparent 2px
);
z-index: 1000;
}
/* CRT vignette */
body::after {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.6) 100%);
z-index: 999;
}
.error-code {
font-size: 6em;
font-weight: normal;
text-shadow: 0 0 10px var(--terminal-green), 0 0 20px rgba(51, 255, 51, 0.5);
}
.terminal-output {
margin: 2em 0;
text-align: left;
line-height: 1.8;
}
.prompt {
opacity: 0.7;
}
.blink {
animation: blink 1s step-end infinite;
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
#input {
position: absolute;
left: -9999px;
}
.history-line {
opacity: 0.8;
}
.hint {
font-size: 0.8em;
opacity: 0.4;
margin-top: 0.5em;
transition: opacity 0.5s;
}
.hint.hidden {
opacity: 0;
}
a {
color: var(--terminal-green);
text-decoration: none;
border-bottom: 1px dashed var(--terminal-green);
transition: ease-in all 100ms;
}
a:hover {
background: var(--terminal-green);
color: var(--terminal-dark);
border-bottom-color: transparent;
text-shadow: none;
}
</style>
</head>
<body>
<h1 class="error-code" id="scramble" data-text="404">404</h1>
<div class="terminal-output" id="terminal">
<p><span class="prompt">$</span> cat requested_page.html</p>
<p>cat: requested_page.html: No such file or directory</p>
<p class="terminal-input"><span class="prompt">$</span> <span id="input-display"></span><span class="blink">█</span></p>
<p class="hint" id="hint">try typing a command...</p>
</div>
<input type="text" id="input" autofocus autocomplete="off" spellcheck="false">
<p><a href="/">Return to home</a></p>
<script>
const scrambleEl = document.getElementById('scramble');
const finalText = scrambleEl.dataset.text;
const chars = '0123456789@#$%&*!?';
function runScramble() {
let iterations = 0;
const scrambleInterval = setInterval(() => {
scrambleEl.textContent = finalText
.split('')
.map((char, index) => {
if (index < iterations) return finalText[index];
return chars[Math.floor(Math.random() * chars.length)];
})
.join('');
iterations += 0.15;
if (iterations >= finalText.length) {
clearInterval(scrambleInterval);
scrambleEl.textContent = finalText;
}
}, 80);
}
runScramble();
setInterval(runScramble, 8000);
// Interactive terminal
const errors = [
(cmd) => `${cmd}: command not found`,
(cmd) => `bash: ${cmd}: No such file or directory`,
(cmd) => `${cmd}: Permission denied`,
(cmd) => `${cmd}: Operation not permitted`,
(cmd) => `-bash: ${cmd}: command not found`,
(cmd) => `zsh: command not found: ${cmd}`,
(cmd) => `${cmd}: unable to resolve host`,
(cmd) => `Segmentation fault (core dumped)`,
(cmd) => `${cmd}: connection refused`,
(cmd) => `Error: ENOENT: no such file or directory`,
];
const input = document.getElementById('input');
const inputDisplay = document.getElementById('input-display');
const terminal = document.getElementById('terminal');
const inputLine = document.querySelector('.terminal-input');
const hint = document.getElementById('hint');
input.addEventListener('input', () => {
inputDisplay.textContent = input.value;
hint.classList.toggle('hidden', input.value.length > 0);
});
input.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
const cmd = input.value.trim();
if (cmd) {
const cmdLine = document.createElement('p');
cmdLine.className = 'history-line';
const promptSpan = document.createElement('span');
promptSpan.className = 'prompt';
promptSpan.textContent = '$';
cmdLine.appendChild(promptSpan);
cmdLine.appendChild(document.createTextNode(' ' + cmd));
terminal.insertBefore(cmdLine, inputLine);
const errorLine = document.createElement('p');
const randomError = errors[Math.floor(Math.random() * errors.length)];
errorLine.textContent = randomError(cmd.split(' ')[0]);
terminal.insertBefore(errorLine, inputLine);
}
input.value = '';
inputDisplay.textContent = '';
}
});
// Keep focus on input (works for both click and touch)
document.addEventListener('click', () => input.focus());
terminal.addEventListener('touchstart', () => input.focus());
// Amber easter egg
requestAnimationFrame(() => {
document.documentElement.classList.add('transitions-ready');
});
document.addEventListener('keydown', (e) => {
if (e.key === 'Shift') document.documentElement.classList.add('amber');
});
document.addEventListener('keyup', (e) => {
if (e.key === 'Shift') document.documentElement.classList.remove('amber');
});
</script>
</body>
</html>