-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.HTML
More file actions
68 lines (65 loc) · 1.98 KB
/
Copy path404.HTML
File metadata and controls
68 lines (65 loc) · 1.98 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Error $404$</title>
<style>
html, body { height: 100%; margin: 0; }
body {
background-color: #ffffff;
color: #111;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
align-items: flex-start;
justify-content: flex-start;
padding: 32px;
box-sizing: border-box;
/* animation setup: start hidden */
opacity: 0;
transition: opacity 1s ease-in;
}
body.visible { opacity: 1; }
body.fade-out { opacity: 0; transition: opacity 280ms ease; }
.container { max-width: 900px; }
h1 { margin: 0 0 16px; font-size: 1.8rem; }
p { margin: 0; line-height: 1.6; font-size: 1rem; }
</style>
</head>
<body>
<main class="container" role="main">
<h1>Error 404</h1>
<p>This page could not be found, or has not been added yet.</p>
</main>
<script>
// Fade-in on load
document.addEventListener('DOMContentLoaded', function () {
requestAnimationFrame(function () {
document.body.classList.add('visible');
});
});
// Fade-out for in-page navigation: intercept same-origin links
document.addEventListener('click', function (e) {
const a = e.target.closest('a');
if (!a) return;
try {
const url = new URL(a.href, location.href);
if (url.origin === location.origin) {
e.preventDefault();
document.body.classList.add('fade-out');
setTimeout(function () { location.href = url.href; }, 320);
}
} catch (err) {
// if URL parsing fails, just navigate normally
}
});
// Best-effort fade-out when page is hidden or being unloaded
document.addEventListener('visibilitychange', function () {
if (document.visibilityState === 'hidden') {
document.body.classList.add('fade-out');
}
});
window.addEventListener('pagehide', function () { document.body.classList.add('fade-out'); });
</script>
</body>
</html>