This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
forked from Netcentric/vg-macktrucks-com-rd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
65 lines (58 loc) · 2.14 KB
/
404.html
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
<!DOCTYPE html>
<html class="redesign-v2">
<head>
<title>Page not found</title>
<script type="text/javascript">
window.isErrorPage = true;
window.errorCode = '404';
</script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Page not found">
<script src="/scripts/scripts.js" type="module" crossorigin="use-credentials"></script>
<script type="module">
import { sampleRUM } from '/scripts/lib-franklin.js';
import { getTextLabel } from '/scripts/common.js';
window.addEventListener('load', () => {
if (document.referrer) {
const { origin, pathname } = new URL(document.referrer);
if (origin === window.location.origin) {
const main = document.querySelector('main.error');
const observer = new MutationObserver((mutations, observer) => {
const fragmentContainer = document.querySelector('.fragment');
if (fragmentContainer) {
const backLinkTitle = getTextLabel('404 Back link title');
const btnContainer = document.createElement('p');
const backBtn = document.createElement('a');
backBtn.classList.add('button', 'button--primary');
backBtn.href = pathname;
backBtn.textContent = backLinkTitle;
backBtn.title = backLinkTitle;
btnContainer.append(backBtn);
fragmentContainer.append(btnContainer);
observer.disconnect();
}
});
observer.observe(main, {
childList: true,
subtree: true
});
}
}
sampleRUM('404', { source: document.referrer, target: window.location.href });
});
</script>
<link rel="stylesheet" href="/styles/styles.css">
<link rel="stylesheet" href="/styles/lazy-styles.css">
</head>
<body>
<header></header>
<main class="error">
<div>
<div class="fragment" style="--section-padding-top: ">
<a href="/404" style="visibility: hidden;">https://main--vg-macktrucks-gt--hlxsites.hlx.page/404</a>
</div>
</div>
</main>
<footer></footer>
</body>
</html>