forked from numfocus/DISCOVER-Cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
300 lines (266 loc) · 7.89 KB
/
Copy path404.html
File metadata and controls
300 lines (266 loc) · 7.89 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 - Not Found</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
display: flex;
align-items: center;
justify-content: center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
overflow-x: hidden;
position: relative;
padding: 1rem;
}
@media (prefers-reduced-motion: reduce) {
body *,
body *::before,
body *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
.light-blur {
position: absolute;
width: min(500px, 90vw);
height: min(500px, 90vw);
background: radial-gradient(circle at center, rgba(232, 146, 23, 0.08) 0%, transparent 70%);
border-radius: 50%;
filter: blur(60px);
top: 15%;
left: 5%;
animation: drift 12s ease-in-out infinite alternate;
z-index: 0;
pointer-events: none;
}
@keyframes drift {
0% { transform: translate(0, 0); }
100% { transform: translate(40px, 25px); }
}
.glass-card {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
padding: 2rem 2.5rem;
border-radius: 16px;
border: 1px solid rgba(222, 226, 230, 0.8);
max-width: 520px;
width: 100%;
text-align: center;
z-index: 1;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}
h1 {
font-size: clamp(1.75rem, 5vw, 2.5rem);
color: #222832;
margin-bottom: 0.5rem;
font-weight: 600;
line-height: 1.2;
}
.card-content p {
font-size: clamp(0.95rem, 2.5vw, 1.1rem);
color: #495057;
margin-bottom: 1rem;
line-height: 1.5;
}
.card-content p:last-of-type {
margin-bottom: 1.25rem;
}
.card-content strong {
color: #222832;
}
.actions {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
justify-content: center;
margin-bottom: 1.25rem;
}
a.cta {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 44px;
padding: 0.6rem 1.25rem;
border-radius: 8px;
text-decoration: none;
font-weight: 600;
font-size: 0.95rem;
transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
cursor: pointer;
}
a.cta-primary {
background: #e89217;
color: #1a1a1a;
}
a.cta-primary:hover {
background: #d48314;
box-shadow: 0 2px 8px rgba(232, 146, 23, 0.35);
}
a.cta-secondary {
background: #f8f9fa;
color: #222832;
border: 1px solid #dee2e6;
}
a.cta-secondary:hover {
background: #e9ecef;
border-color: #ced4da;
}
a.cta:focus {
outline: 2px solid #e89217;
outline-offset: 2px;
}
.language-section {
margin-top: 1.5rem;
padding-top: 1.25rem;
border-top: 1px solid #e9ecef;
}
.language-section label {
display: block;
margin-bottom: 0.5rem;
color: #495057;
font-size: 0.9rem;
}
select {
padding: 0.5rem 2rem 0.5rem 0.75rem;
border-radius: 6px;
border: 1px solid #dee2e6;
font-size: 1rem;
background: #fff;
color: #222832;
min-height: 40px;
cursor: pointer;
}
select:focus {
outline: 2px solid #e89217;
outline-offset: 2px;
}
#footer {
margin-top: 1rem;
font-size: 0.85rem;
color: #6c757d;
}
/* Tablet */
@media (max-width: 768px) {
body {
padding: 1.5rem;
}
.glass-card {
padding: 1.75rem 2rem;
}
.actions {
flex-direction: column;
align-items: stretch;
}
a.cta {
width: 100%;
}
}
/* Mobile */
@media (max-width: 480px) {
body {
padding: 1rem;
}
.glass-card {
padding: 1.5rem 1.25rem;
border-radius: 12px;
}
.light-blur {
width: 70vw;
height: 70vw;
top: 10%;
}
}
/* Small phones */
@media (max-width: 320px) {
.glass-card {
padding: 1.25rem 1rem;
}
}
</style>
</head>
<body>
<div class="light-blur" aria-hidden="true"></div>
<main class="glass-card" role="main" aria-labelledby="title">
<h1 id="title">404 - Page Not Found</h1>
<div class="card-content">
<p id="message">This page might've wandered off or was never here at all.</p>
<p id="suggestion">Maybe it was deleted, renamed, or never existed in the first place.</p>
<p><strong id="what-do">What can you do?</strong></p>
</div>
<div class="actions">
<a href="./intro.html" id="home" class="cta cta-primary" aria-label="Back to home page">Back to Home</a>
<a href="https://github.com/numfocus/DISCOVER-Cookbook/issues" id="report" class="cta cta-secondary" target="_blank" rel="noopener noreferrer" aria-label="Report this issue on GitHub">Report the Issue</a>
</div>
<div class="language-section">
<label for="language-switcher">Switch language</label>
<select id="language-switcher" aria-label="Choose page language">
<option value="en">English</option>
<option value="es">Español</option>
</select>
</div>
<p id="footer">If you think this is an error, let us know by creating an issue.</p>
</main>
<script>
const translations = {
en: {
title: "404 - Page Not Found",
message: "This page might've wandered off or was never here at all.",
suggestion: "Maybe it was deleted, renamed, or never existed in the first place.",
whatDo: "What can you do?",
home: "Back to Home",
report: "Report the Issue",
footer: "If you think this is an error, let us know by creating an issue."
},
es: {
title: "404 - Página no encontrada",
message: "Esta página se ha perdido o nunca existió.",
suggestion: "Tal vez fue eliminada, renombrada o nunca existió.",
whatDo: "¿Qué puedes hacer?",
home: "Volver al inicio",
report: "Informar del problema",
footer: "Si crees que esto es un error, infórmanos creando un issue."
}
};
function detectLanguage() {
const pathLang = location.pathname.split("/")[1];
const refLang = new URL(document.referrer || "", location.origin).pathname.split("/")[1];
const storedLang = localStorage.getItem("preferredLang");
return translations[pathLang]
? pathLang
: translations[refLang]
? refLang
: translations[storedLang]
? storedLang
: "en";
}
function applyLanguage(lang) {
const t = translations[lang] || translations["en"];
document.getElementById("title").textContent = t.title;
document.getElementById("message").textContent = t.message;
document.getElementById("suggestion").textContent = t.suggestion;
document.getElementById("what-do").textContent = t.whatDo;
document.getElementById("home").textContent = t.home;
document.getElementById("report").textContent = t.report;
document.getElementById("footer").textContent = t.footer;
document.getElementById("language-switcher").value = lang;
localStorage.setItem("preferredLang", lang);
}
const initialLang = detectLanguage();
applyLanguage(initialLang);
document.getElementById("language-switcher").addEventListener("change", function () {
applyLanguage(this.value);
});
</script>
</body>
</html>