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
206 lines (188 loc) · 5.67 KB
/
Copy path404.html
File metadata and controls
206 lines (188 loc) · 5.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
<!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 {
height: 100vh;
background: linear-gradient(135deg, #eef2ff, #f8fafc);
display: flex;
align-items: center;
justify-content: center;
font-family: 'Segoe UI', sans-serif;
overflow: hidden;
position: relative;
}
.light-blur {
position: absolute;
width: 500px;
height: 500px;
background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 70%);
border-radius: 50%;
filter: blur(80px);
top: 20%;
left: 10%;
animation: drift 10s ease-in-out infinite alternate;
z-index: 0;
}
@keyframes drift {
0% { transform: translate(0, 0); }
100% { transform: translate(60px, 30px); }
}
.glass-card {
/* background-color: #444;*/
background: rgba(31, 41, 55, 0.9);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
padding: 2.5rem 3rem;
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.3);
max-width: 500px;
text-align: center;
z-index: 1;
box-shadow: 0 10px 30px rgba(192, 91, 91, 0.1);
}
h1 {
font-size: 2.5em;
color: rgb(255, 250, 250);
margin-bottom: 0.5rem;
line-height:1.5;
}
p {
font-size: 1.1em;
color: rgb(255, 247, 247);
margin-bottom: 1.4rem;
line-height: 1.5;
}
a {
display: inline-block;
margin: 0.4rem;
padding: 0.6rem 1rem;
border-radius: 12px;
text-decoration: none;
background: #86efac;
color: #064e3b;
font-weight: 600;
transition: background 0.3s ease;
}
a:hover {
background: #9eaba2;
color: rgb(255, 255, 255);
}
select {
margin-top: 1rem;
padding: 0.5rem;
border-radius: 6px;
border: 1px solid #ccc;
font-size: 1em;
background: #2f3a47; /* Darker background matching the card */
color: #fff;
}
select option
{
background: #2f3a47;
color: #fff;
}
@media (max-width: 600px) {
body {
padding: 1rem;
}
.glass-card {
max-width: 90%;
padding: 1.5rem;
border-radius: 12px;
}
h1 {
font-size: 1.8em;
}
p {
font-size: 1em;
}
a {
padding: 0.5rem 0.8rem;
font-size: 0.9em;
}
select {
width: 100%;
}
}
</style>
</head>
<body>
<div class="light-blur"></div>
<div class="glass-card">
<h1 id="title">Oops! We can’t find that page</h1>
<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>
<a href="./intro.html" id="home">⬅️ Back to Home</a>
<a href="https://github.com/numfocus/DISCOVER-Cookbook/issues" id="report">🐞 Report the Issue</a>
<div>
<label for="language-switcher" style="display:block; margin-top:1.5rem; color:#fffbfb;"> 🌐 Switch Language</label>
<select id="language-switcher">
<option value="en">English</option>
<option value="es">Español</option>
</select>
</div>
<p id="footer" style="margin-top: 1.2rem;">If you think this is an error, let us know by creating an issue.</p>
</div>
<script>
const translations = {
en: {
title: "Oops! We can’t find that page",
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: "No se pudo encontrar la página",
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>