Add 404 Page

This commit is contained in:
MythicalPlayz
2022-11-23 18:04:31 +02:00
parent 67c4dfaf90
commit 13e1d14d82
5 changed files with 132 additions and 2 deletions

View File

@@ -366,5 +366,8 @@
"cancel": "Cancel",
"confirm": "Confirm",
"close": "Close"
},
"notfound":{
"description": "Oops! We could not find this page."
}
}

24
public/assets/css/404.css Normal file
View File

@@ -0,0 +1,24 @@
.title404{
text-align: center;
font-size: 8rem;
padding-top: 60px;
color: var(--text-shade-1);
}
.dis404{
text-align: center;
font-size: 1.7rem;
margin-top: -10px;
color: var(--text-shade-1);
}
.shockedbandwidth{
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 70px;
margin-bottom: -120px;
}
@media screen and (max-width: 900px) {
.shockedbandwidth{
margin-bottom: -100px;
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -99,10 +99,10 @@ app.use('/nso-legacy-pack', routes.aprilfools);
logger.info('Creating 404 status handler');
// This works because it is the last router created
// Meaning the request could not find a valid router
app.use((request, response, next) => {
app.use((request, response) => {
const fullUrl = util.fullUrl(request);
response.render('404');
logger.warn(`HTTP 404 at ${fullUrl}`);
next();
});
logger.info('Setting up handlebars engine');

11
views/404.handlebars Normal file
View File

@@ -0,0 +1,11 @@
<link rel="stylesheet" href="/assets/css/404.css">
{{> header}}
<div class="wrapper">
<div class="title404"><b>404</b></div>
<div class="dis404">{{ locale.notfound.description }}</div>
<img src="/assets/images/shockedbandwidth.svg" class="shockedbandwidth"/>
{{> footer }}
</div>