generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path404.html
152 lines (136 loc) · 4.61 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
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
<!DOCTYPE html>
<html>
<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';
function addWPDataAttributes(matchedRow, main) {
if (!main) return;
Object.entries(matchedRow).forEach(([key, value]) => {
if (key.includes('wp')) {
main.setAttribute(`data-${key}`, value);
}
});
}
window.addEventListener('load', async () => {
if (document.referrer) {
const { origin, pathname } = new URL(document.referrer);
if (origin === window.location.origin) {
const backBtn = document.createElement('a');
backBtn.classList.add('button', 'error-button-back');
backBtn.href = pathname;
backBtn.textContent = 'Go back';
backBtn.title = 'Go back';
const btnContainer = document.querySelector('.button-container');
btnContainer.append(backBtn);
}
}
const resp = await fetch(`metadata.json`);
if (resp.ok) {
const json = await resp.json();
const matchedRow = json && json.data?.find((row) => (row.URL === '404.html'));
const main = matchedRow && document.querySelector('main');
addWPDataAttributes(matchedRow, main);
}
sampleRUM('404', { source: document.referrer, target: window.location.href });
});
</script>
<link rel="stylesheet" href="/styles/styles.css">
<link rel="stylesheet" href="/blocks/social/social.css">
<style>
main.error {
min-height: calc(100vh - var(--nav-height));
display: flex;
justify-content: center;
flex-wrap: wrap;
}
main.error .error-number {
width: 100%;
}
main.error .error-number text {
font-family: var(--fixed-font-family);
}
main .error-button a.button:hover {
color: var(--c-dark-plum);
}
main .error-subtitle {
color: var(--c-dark-gray);
font-size: 50px;
}
.separator-container {
padding: 0;
}
hr.separator {
border: var(--c-light-gray) 1px solid;
}
</style>
<link rel="stylesheet" href="/styles/lazy-styles.css">
</head>
<body>
<header></header>
<main class="error" data-wp-version-name="franklin" data-wp-http-status="404" data-wp-page-type="error">
<div class="title-container">
<h2 class="error-title">
Page Not Found
</h2>
<h3 class="error-subtitle">
404
</h3>
</div>
<div class="separator-container">
<hr class="separator">
</div>
<div class="links-container">
<h4>Here are some helpful links instead:</h4>
<p class="button-container error-button">
<a href="/" title="Go back to our homepage" class="button">
Go back to our homepage
</a>
</p>
<p class="button-container error-button">
<a href="/insights" title="Read our latest insights" class="button">
Read our latest insights
</a>
</p>
<p class="button-container error-button">
<a href="/lets-talk" title="Get in touch with us" class="button">
Get in touch with us
</a>
</p>
</div>
<div class="social-container">
<div class="social">
<div>
<div class="button-container"><a href="https://www.linkedin.com/company/CognizantNetcentric" title="" class="button"><span class="icon icon-linkedin"></span><span class="icon icon-chevron-right"></span></a></div>
<div>
<h2 id="linkedin">linkedIn</h2>
<p>Cognizant Netcentric</p>
</div>
</div>
<div>
<div class="button-container"><a href="https://www.facebook.com/CognizantNetcentric/" title="" class="button"><span class="icon icon-facebook"></span><span class="icon icon-chevron-right"></span></a></div>
<div>
<h2 id="facebook">facebook</h2>
<p>Cognizant Netcentric</p>
</div>
</div>
<div>
<div class="button-container"><a href="https://twitter.com/netcentrichq" title="" class="button"><span class="icon icon-twitter"></span><span class="icon icon-chevron-right"></span></a></div>
<div>
<h2 id="twitter">twitter</h2>
<p>Cognizant Netcentric</p>
</div>
</div>
</div>
</div>
</main>
<footer></footer>
</body>
</html>