-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy path404.html
More file actions
198 lines (170 loc) · 6.07 KB
/
Copy path404.html
File metadata and controls
198 lines (170 loc) · 6.07 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
<!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>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
:root {
--bg-start: #000000;
--bg-mid: #0a0a0a;
--bg-end: #000000;
--card-bg: rgba(20,20,20,0.95);
--card-border: rgba(255,255,255,0.15);
--muted: rgba(255,255,255,0.7);
--text-on-card: #ffffff;
--select-bg: #1a1a1a;
}
[data-bs-theme="light"] {
--bg-start: #f8fafc;
--bg-mid: #f1f5f9;
--bg-end: #f8fafc;
--card-bg: rgba(255,255,255,0.9);
--card-border: rgba(0,0,0,0.08);
--muted: rgba(33,37,41,0.6);
--text-on-card: #111827;
--select-bg: #ffffff;
}
body {
background: linear-gradient(135deg, var(--bg-start), var(--bg-mid), var(--bg-end));
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
.card-custom {
background: var(--card-bg);
border: 1px solid var(--card-border);
backdrop-filter: blur(8px);
box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.text-muted-custom { color: var(--muted); }
.text-card { color: var(--text-on-card); }
/* ✅ FIXED SELECT */
.select-theme {
background-color: var(--select-bg);
color: var(--text-on-card);
border-color: var(--card-border);
color-scheme: light dark;
}
.select-theme option {
background-color: var(--select-bg);
color: var(--text-on-card);
}
.gradient-text {
background: linear-gradient(90deg, #c4a7ff, #8ec6ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
<script>
const applySystemTheme = (e) => {
const prefersDark = e && typeof e.matches === 'boolean'
? e.matches
: window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.setAttribute('data-bs-theme', prefersDark ? 'dark' : 'light');
};
applySystemTheme();
window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', applySystemTheme);
</script>
</head>
<body class="min-vh-100 d-flex align-items-center justify-content-center overflow-hidden">
<div class="card card-custom rounded-4 mx-3" style="max-width:48rem;">
<div class="card-body text-center px-5 py-5">
<div class="display-1 fw-bold gradient-text mb-3">404</div>
<h1 id="title" class="h3 fw-semibold text-card mb-2">
Page not found
</h1>
<p id="message" class="lead text-muted-custom mb-2">
Looks like this page took a wrong turn.
</p>
<p id="suggestion" class="text-muted-custom mb-4">
It may have been removed, renamed, or never existed.
</p>
<div class="d-flex flex-wrap justify-content-center gap-3 mb-4">
<a id="home" href="./intro.html" class="btn btn-light btn-lg">
← Go Home
</a>
<a id="report"
href="https://github.com/numfocus/DISCOVER-Cookbook/issues"
class="btn btn-outline-secondary btn-lg">
Report issue
</a>
</div>
<div class="d-flex flex-column align-items-center gap-2">
<span class="form-label small text-muted-custom mb-2">
Language
</span>
<div class="btn-group" role="group" aria-label="Language selector">
<button type="button"
id="lang-en"
class="btn btn-outline-light lang-toggle"
data-lang="en">
English
</button>
<button type="button"
id="lang-es"
class="btn btn-outline-light lang-toggle"
data-lang="es">
Español
</button>
</div>
</div>
<p id="footer" class="mt-4 small text-muted-custom">
Think this is a mistake? Open an issue and let us know.
</p>
</div>
</div>
<script>
const translations = {
en: {
title: "Page not found",
message: "Looks like this page took a wrong turn.",
suggestion: "It may have been removed, renamed, or never existed.",
home: "← Go Home",
report: "Report issue",
footer: "Think this is a mistake? Open an issue and let us know."
},
es: {
title: "Página no encontrada",
message: "Parece que esta página tomó un desvío incorrecto.",
suggestion: "Puede haber sido eliminada, renombrada o nunca existió.",
home: "← Volver al inicio",
report: "Informar problema",
footer: "¿Crees que esto es un error? Abre un issue y haznoslo saber."
}
};
function detectLanguage() {
const stored = localStorage.getItem("preferredLang");
return translations[stored] ? stored : "en";
}
function applyLanguage(lang) {
const t = translations[lang];
document.getElementById("title").textContent = t.title;
document.getElementById("message").textContent = t.message;
document.getElementById("suggestion").textContent = t.suggestion;
document.getElementById("home").textContent = t.home;
document.getElementById("report").textContent = t.report;
document.getElementById("footer").textContent = t.footer;
// Update toggle buttons
document.querySelectorAll('.lang-toggle').forEach(btn => {
if (btn.dataset.lang === lang) {
btn.classList.remove('btn-outline-light');
btn.classList.add('btn-light');
} else {
btn.classList.remove('btn-light');
btn.classList.add('btn-outline-light');
}
});
localStorage.setItem("preferredLang", lang);
}
applyLanguage(detectLanguage());
// Add click handlers to language toggle buttons
document.querySelectorAll('.lang-toggle').forEach(btn => {
btn.addEventListener('click', () => {
applyLanguage(btn.dataset.lang);
});
});
</script>
</body>
</html>