-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
186 lines (178 loc) · 6.52 KB
/
Copy path404.html
File metadata and controls
186 lines (178 loc) · 6.52 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="dark" />
<meta name="robots" content="noindex" />
<title>404 — Ethan Soh</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,12 92,86 8,86' fill='%23ffffff'/></svg>" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap" rel="stylesheet" />
<script>
(() => {
const redirects = {
github: "https://github.com/quantamShade0337",
gh: "https://github.com/quantamShade0337",
repos: "https://github.com/quantamShade0337?tab=repositories",
linkedin: "https://www.linkedin.com/in/ethan-soh-9548863a9/",
in: "https://www.linkedin.com/in/ethan-soh-9548863a9/",
link: "https://ethn.link",
links: "https://ethn.link",
kyro: "https://kyromarket.com",
meshlab: "https://meshlab.ethansoh.com",
flowday: "https://flowday.ethansoh.com",
axinote: "https://flowday.ethansoh.com",
scripties: "/scripties.html",
email: "mailto:ethansytwrites@gmail.com",
mail: "mailto:ethansytwrites@gmail.com",
source: "https://github.com/quantamShade0337/quantamShade0337.github.io"
};
const key = location.pathname.replace(/^\/+|\/+$/g, "").toLowerCase();
if (redirects[key]) location.replace(redirects[key]);
})();
</script>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; min-height: 100%; }
body {
overflow: hidden;
background: #000;
color: #fff;
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
}
.error-hero {
position: relative;
isolation: isolate;
display: grid;
min-height: 100svh;
place-items: center;
overflow: hidden;
background: #000;
text-align: center;
}
.pixel-field {
position: absolute;
inset: 0;
z-index: 0;
overflow: hidden;
filter: url(#pixel-goo);
}
.pixel-grid { display: grid; width: 100%; height: 100%; }
.pixel {
background: #fff;
opacity: 0;
transition: opacity 0s linear 500ms;
}
.pixel.active { opacity: 1; transition-delay: 0s; }
.error-copy {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
pointer-events: none;
}
.error-copy h1 {
font-family: "Bricolage Grotesque", sans-serif;
font-size: 96px;
font-weight: 400;
line-height: 1;
letter-spacing: -.025em;
}
.home-link {
color: rgba(255, 255, 255, .68);
font-size: 15px;
letter-spacing: -.01em;
pointer-events: auto;
transition: color 160ms ease;
}
.home-link:hover, .home-link:focus-visible { color: #fff; }
.home-link:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.goo-filter { position: absolute; width: 0; height: 0; }
@media (min-width: 768px) {
.error-copy h1 { font-size: 128px; }
}
</style>
</head>
<body>
<main class="error-hero" id="errorHero">
<svg class="goo-filter" aria-hidden="true">
<defs>
<filter id="pixel-goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="5" result="blur" />
<feColorMatrix
in="blur"
type="matrix"
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9"
result="goo"
/>
<feComposite in="SourceGraphic" in2="goo" operator="atop" />
</filter>
</defs>
</svg>
<div class="pixel-field" aria-hidden="true">
<div class="pixel-grid" id="pixelGrid"></div>
</div>
<div class="error-copy">
<h1>404</h1>
<a class="home-link" href="/">Return home →</a>
</div>
</main>
<script>
(() => {
const hero = document.querySelector("#errorHero");
const grid = document.querySelector("#pixelGrid");
const heading = document.querySelector(".error-copy h1");
let pixelSize = 32;
let columns = 0;
let rows = 0;
let resizeTimer;
const buildGrid = () => {
const rect = hero.getBoundingClientRect();
pixelSize = matchMedia("(max-width: 767px)").matches ? 24 : 32;
columns = Math.ceil(rect.width / pixelSize);
rows = Math.ceil(rect.height / pixelSize);
grid.style.gridTemplateColumns = `repeat(${columns}, ${pixelSize}px)`;
grid.style.gridTemplateRows = `repeat(${rows}, ${pixelSize}px)`;
grid.replaceChildren(...Array.from({ length: columns * rows }, () => {
const pixel = document.createElement("i");
pixel.className = "pixel";
return pixel;
}));
};
const revealPixel = (event) => {
const rect = hero.getBoundingClientRect();
const column = Math.floor((event.clientX - rect.left) / pixelSize);
const row = Math.floor((event.clientY - rect.top) / pixelSize);
if (column < 0 || column >= columns || row < 0 || row >= rows) return;
const headingRect = heading.getBoundingClientRect();
const clearance = matchMedia("(max-width: 767px)").matches ? 32 : 48;
const pixelCenterX = rect.left + column * pixelSize + pixelSize / 2;
const pixelCenterY = rect.top + row * pixelSize + pixelSize / 2;
const isNearHeading =
pixelCenterX >= headingRect.left - clearance &&
pixelCenterX <= headingRect.right + clearance &&
pixelCenterY >= headingRect.top - clearance &&
pixelCenterY <= headingRect.bottom + clearance;
if (isNearHeading) return;
const pixel = grid.children[row * columns + column];
pixel.classList.remove("active");
void pixel.offsetWidth;
pixel.classList.add("active");
clearTimeout(pixel.fadeTimer);
pixel.fadeTimer = setTimeout(() => pixel.classList.remove("active"), 500);
};
hero.addEventListener("pointermove", revealPixel, { passive: true });
addEventListener("resize", () => {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(buildGrid, 120);
});
buildGrid();
})();
</script>
</body>
</html>