-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
482 lines (456 loc) · 16.2 KB
/
Copy path404.html
File metadata and controls
482 lines (456 loc) · 16.2 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 — Page Not Found</title>
<link rel="stylesheet" href="/assets/css/main.css" />
<link rel="stylesheet" href="/assets/css/wide.css" />
<link rel="stylesheet" href="/assets/css/gallium.css" />
<link rel="stylesheet" href="/assets/css/cursor.css" />
<style>
body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.wrap {
max-width: 480px;
padding: 40px 24px;
animation: fadeUp .5s cubic-bezier(.22,.68,0,1.1);
}
@keyframes fadeUp {
from { opacity:0; transform:translateY(30px); }
to { opacity:1; transform:translateY(0); }
}
.error-hero {
display: flex;
align-items: center;
justify-content: center;
gap: 18px;
margin-bottom: 12px;
}
.code {
font-size: 96px;
font-weight: 900;
letter-spacing: -.04em;
background: linear-gradient(120deg, var(--a), var(--a2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1;
margin-bottom: 12px;
}
.error-character {
position: relative;
width: 118px;
height: 104px;
flex: 0 0 118px;
}
.stick-figure {
position: absolute;
right: 4px;
bottom: 2px;
width: 54px;
height: 78px;
color: var(--txt);
animation: figureFloat 3.5s ease-in-out infinite;
}
body.dark .stick-figure { color: var(--txtd); }
.stick-figure circle { fill: none; stroke: currentColor; stroke-width: 3; }
.stick-figure path, .stick-figure line { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.speech-bubble {
position: absolute;
left: 0;
top: 0;
max-width: 105px;
padding: 8px 11px;
border: 1px solid color-mix(in srgb, var(--a) 45%, transparent);
border-radius: 13px;
background: color-mix(in srgb, var(--bg, white) 78%, transparent);
backdrop-filter: blur(10px);
color: var(--txt);
font-size: 11px;
line-height: 1.25;
font-weight: 700;
box-shadow: 0 8px 25px rgba(0,0,0,.08);
}
body.dark .speech-bubble { color: var(--txtd); }
.speech-bubble::after {
content: "";
position: absolute;
right: 18px;
bottom: -7px;
width: 12px;
height: 12px;
background: inherit;
border-right: 1px solid color-mix(in srgb, var(--a) 45%, transparent);
border-bottom: 1px solid color-mix(in srgb, var(--a) 45%, transparent);
transform: rotate(45deg);
}
@keyframes figureFloat {
0%,100% { transform: translateY(0) rotate(-1deg); }
50% { transform: translateY(-4px) rotate(1deg); }
}
@media (max-width: 560px) {
.error-hero { gap: 6px; }
.error-character { transform: scale(.82); transform-origin: left center; margin-right: -20px; }
.code { font-size: 78px; }
}
.msg {
font-size: 20px;
font-weight: 700;
margin-bottom: 10px;
color: var(--txt);
}
body.dark .msg { color: var(--txtd); }
.sub {
font-size: 14px;
color: var(--mut);
margin-bottom: 32px;
line-height: 1.6;
}
body.dark .sub { color: var(--mutd); }
.home-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 14px 32px;
border-radius: 999px;
background: linear-gradient(120deg, var(--a), var(--a2));
color: #050816;
font-weight: 700;
font-size: 15px;
text-decoration: none;
transition: opacity .2s, transform .2s;
}
.home-btn:hover { opacity: .87; transform: translateY(-2px); }
.nav-suggest {
margin-bottom: 20px;
min-height: 0;
}
.nav-suggest-btn {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 13px 26px;
border-radius: 999px;
border: 1.5px solid var(--a);
background: transparent;
color: var(--a);
font-weight: 700;
font-size: 14.5px;
cursor: pointer;
transition: background .2s, transform .2s, color .2s;
opacity: 0;
transform: translateY(8px);
animation: fadeUp .45s cubic-bezier(.22,.68,0,1.1) forwards;
}
.nav-suggest-btn:hover {
background: var(--a);
color: #050816;
transform: translateY(-2px);
}
.nav-suggest-btn svg { flex-shrink: 0; }
</style>
<link rel="icon" href="/404favicon.ico" type="image/x-icon">
</head>
<body>
<div class="cursor-dot"></div>
<div class="cursor-trail"></div>
<div class="auth-top-right">
<button id="signInBtn" class="auth-btn">Sign In</button>
<button id="signUpBtn" class="auth-btn">Sign Up</button>
<button id="signOutBtn" class="auth-btn" style="display:none;">Sign Out</button>
</div>
<div class="wrap">
<div class="error-hero">
<div class="code">404</div>
<div class="error-character" aria-hidden="true">
<div class="speech-bubble" id="error-nicknack">well this is ironic</div>
<svg class="stick-figure" viewBox="0 0 60 86" role="img">
<circle cx="30" cy="13" r="9"></circle>
<path d="M30 22v27"></path>
<path d="M30 30 15 39"></path>
<path d="M30 30 45 36"></path>
<path d="M30 49 18 70"></path>
<path d="M30 49 43 70"></path>
</svg>
</div>
</div>
<div class="msg">Page not found</div>
<p class="sub">Looks like this page doesn't exist — or maybe it moved.<br>Head back to 360 and keep searching.</p>
<div class="nav-suggest" id="nav-suggest"></div>
<a class="home-btn" href="/">← Back to 360</a>
</div>
<script src="/assets/js/main.js"></script>
<script src="/assets/js/auth-fix.js"></script>
<script src="/assets/js/wide.js"></script>
<script src="/assets/js/gallium.js"></script>
<script src="/assets/js/cursor.js"></script>
<script>
(() => {
// Tiny 404 easter eggs: intentionally different on each visit.
const path = (location.pathname || "/").toLowerCase();
const generalNicknacks = [
"well this is ironic",
"uh... wrong turn",
"I swear it was here",
"nothing to see here",
"the internet misplaced it",
"this is awkward",
"whoops",
"welp, here we are",
"I have no comment",
"you saw nothing",
"keep walking",
"how did we get here",
"I have several questions",
"I have zero answers",
"the page has escaped",
"the page took the day off",
"the page is on vacation",
"the server knows something",
"the server refuses to elaborate",
"I asked the server. It hung up.",
"maybe it's on the other internet",
"I don't trust this link",
"this link has bad vibes",
"wrong hallway",
"wrong door",
"wrong timeline",
"the webpage dimension is closed",
"please remain calm",
"everything is probably fine",
"everything is absolutely not fine",
"I think we're lost",
"we're both lost",
"I need a map",
"did you check under the couch?",
"maybe the page is hiding",
"the URL betrayed us",
"who moved the page?",
"WHO MOVED THE PAGE",
"I was promised a webpage",
"that was certainly a URL",
"10/10 URL. 0/10 page.",
"bold choice of URL",
"excellent typo",
"was that intentional?",
"I respect the confidence",
"the URL is doing its best",
"future me can handle this",
"future me is going to hate this",
"loading... spiritually",
"estimated wait time: yes",
"please hold",
"your page is important to us",
"ERROR: vibes not found",
"ERROR: common sense not found",
"the internet did a little oopsie",
"someone unplugged the webpage",
"the page has left the building",
"congratulations?",
"achievement unlocked: absolutely nothing",
"+0 results",
"search harder",
"you almost had it",
"close enough",
"not even close",
"nice try",
"I was looking for that too",
"I came here expecting a webpage",
"and yet, here we are",
"well... that's new",
"that's probably fine",
"that's probably not fine",
"who gave me access to production",
"someone revoke my permissions",
"it worked yesterday",
"works on my machine",
"I have made a terrible mistake",
"please send help",
"I need an adult",
"I am the adult",
"don't worry, I know what I'm doing",
"I absolutely do not know what I'm doing",
"may the URL be with you",
"404 but make it fashion",
"this page has been promoted to missing",
"the answer is no",
"the answer was almost yes"
];
const searchNicknacks = [
"I swear this was on the search bar",
"the search bar went missing too",
"I searched everywhere",
"searching...",
"still searching...",
"search harder",
"I searched for the page. The page searched back.",
"the search engine has entered witness protection",
"the search bar knows where it went",
"search.exe has stopped searching",
"I was promised search results",
"this search took a wrong turn",
"please speed I need this - I'm... kinda lost......."
];
const chatNicknacks = [
"the chat went quiet",
"nobody's here",
"awkward silence...",
"I think the chat wandered off"
];
const aiNicknacks = [
"the AI said it knew where this was",
"I asked the AI. It wasn't helpful.",
"even the AI couldn't find it",
"the AI is thinking about it"
];
const docsNicknacks = [
"I checked the docs. They're not helping.",
"the documentation doesn't mention this",
"RTFM did not work this time",
"the docs went missing too"
];
const rareNicknacks = [
"this is Zaki's fault",
"MINGZE WHAT DID YOU DO",
"who deployed this?",
"someone definitely tested this"
];
// URL chaos detector: normalize common separators, URL encoding, leetspeak,
// repeated letters, and small typos before checking crude keywords.
const decodedPath = (() => {
try { return decodeURIComponent(location.pathname || "/"); } catch (_) { return location.pathname || "/"; }
})();
const normalizeCrude = (s) => String(s || "")
.toLowerCase()
.replace(/0/g,"o").replace(/1/g,"i").replace(/2/g,"z")
.replace(/3/g,"e").replace(/4/g,"a").replace(/5/g,"s")
.replace(/6/g,"g").replace(/7/g,"t").replace(/8/g,"b")
.replace(/9/g,"g").replace(/@/g,"a")
.replace(/(.)\1+/g,"$1")
.replace(/[^a-z]/g,"");
const crudeWords = [
"ass","asses","asshole","bastard","bitch","bullshit","butt","crap",
"damn","dick","douche","douchebag","fuck","fucking","fucked",
"hell","jackass","lmfao","piss","shit","shitty","stfu","wtf"
].map(normalizeCrude);
const crudeReactions = [
"what the hell are you trying to do 😭🙏",
"bro... what did you type 😭",
"WHY IS THAT IN THE URL 😭🙏",
"you really put THAT in the path?",
"I am not paid enough for this URL",
"okay, who taught you URLs",
"the URL is fighting back",
"please reconsider that URL 😭🙏",
"I have questions. So many questions.",
"that is certainly one way to use a URL",
"sir, this is a search engine",
"ma'am, this is a 404 page",
"what possessed you to type that",
"the stickman would like an explanation",
"you cannot just put that in the URL 😭🙏",
"the server saw that and sighed",
"I am going to pretend I didn't see that",
"interesting choice of words...",
"we need to have a conversation about that URL",
"I don't even know what to say",
"respectfully... why",
"the webpage is judging you",
"that path is CRAZY 😭",
"bro typed that with confidence",
"the URL did not deserve this",
"please explain yourself",
"this is above my pay grade",
"we're gonna pretend that wasn't typed",
"the URL has seen enough",
"I was not trained for this situation",
"there are easier ways to get a 404",
"you successfully confused the website",
"this URL needs supervision",
"I need to speak to whoever typed this",
"I opened the path and immediately looked away",
"the stickman has concerns",
"you know the URL is public, right 😭",
"maybe choose a nicer word next time",
"I don't think that's what the search bar is for",
"I have forwarded this to absolutely nobody",
"the server would like to forget this",
"why would you even TRY that 😭🙏"
];
const tokens = decodedPath
.split(/[\/?#._\-\s+%=]+/)
.filter(Boolean);
const normalizedTokens = tokens.map(normalizeCrude);
const compact = normalizedTokens.join("");
function distance(a,b) {
if (Math.abs(a.length-b.length)>2) return 99;
const row=Array.from({length:b.length+1},(_,i)=>i);
for(let i=1;i<=a.length;i++){
let prev=row[0]; row[0]=i;
for(let j=1;j<=b.length;j++){
const old=row[j];
row[j]=Math.min(row[j]+1,row[j-1]+1,prev+(a[i-1]===b[j-1]?0:1));
prev=old;
}
}
return row[b.length];
}
const hasCrudeKeyword = normalizedTokens.some(t =>
crudeWords.includes(t) ||
(t.length >= 4 && crudeWords.some(w => distance(t,w) <= (w.length >= 7 ? 2 : 1)))
) || crudeWords.some(w => w.length >= 4 && compact.includes(w));
const pool = hasCrudeKeyword ? crudeReactions
: path.includes("search") ? searchNicknacks
: path.includes("/chat") ? chatNicknacks
: path.includes("/ai") ? aiNicknacks
: path.includes("/docs") ? docsNicknacks
: generalNicknacks;
// Rare developer easter eggs; most visits get ordinary nonsense.
const choices = Math.random() < 0.012 ? rareNicknacks : pool;
const bubble = document.getElementById("error-nicknack");
if (bubble) bubble.textContent = choices[Math.floor(Math.random() * choices.length)];
// Ask the existing AI-backed navigate-suggest edge function whether the
// broken path looks like a typo/shorthand for a real 360 destination.
const NAV_SUGGEST_URL = "https://wiswfpfsjiowtrdyqpxy.supabase.co/functions/v1/navigate-suggest-groq";
const container = document.getElementById("nav-suggest");
if (!container) return;
const attemptedPath = location.pathname || "/";
if (attemptedPath === "/" || attemptedPath === "") return;
fetch(NAV_SUGGEST_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ path: attemptedPath }),
})
.then(res => res.json())
.then(data => {
if (!data || !data.match) return;
const btn = document.createElement("button");
btn.className = "nav-suggest-btn";
btn.type = "button";
btn.innerHTML = `
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M13 6l6 6-6 6"/></svg>
<span>Do you mean ${data.label ? escapeNavHtml(data.label) : data.match}? Navigate to it now!</span>
`;
btn.addEventListener("click", () => {
window.location.href = data.match;
});
container.innerHTML = "";
container.appendChild(btn);
})
.catch(() => {});
function escapeNavHtml(s) {
return String(s || "")
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """);
}
})();
</script>
</body>
</html>