-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path404.html
More file actions
51 lines (47 loc) · 1.56 KB
/
404.html
File metadata and controls
51 lines (47 loc) · 1.56 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Not found</title>
<style>
/* minimal styling while we fetch the app */
html,body{height:100%;margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial}
.center{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#555}
a{color:inherit}
</style>
</head>
<body>
<div class="center">
<h1>Not found</h1>
<p>Loading the app to handle this route...</p>
</div>
<script>
(function () {
var requested = location.pathname + location.search + location.hash;
// Fetch index.html relative to current path so it works on GitHub Pages subpaths
fetch('./index.html').then(function (r) {
if (!r.ok) throw new Error('index fetch failed');
return r.text();
}).then(function (html) {
document.open();
document.write(html);
document.close();
// Restore requested URL so SPA can route to it
history.replaceState({}, '', requested);
// Trigger SPA routing if available
try {
if (typeof updateContent === 'function') updateContent();
if (typeof window.onload === 'function') window.onload();
} catch (e) {
// ignore
}
}).catch(function () {
// If index fetch fails, fallback to site root
location.replace('/');
});
})();
</script>
</body>
</html>