From 13e1d14d8259fe70e451fba208ed146f84218512 Mon Sep 17 00:00:00 2001 From: MythicalPlayz Date: Wed, 23 Nov 2022 18:04:31 +0200 Subject: [PATCH 1/4] Add 404 Page --- locales/en_US.json | 3 + public/assets/css/404.css | 24 ++++++ public/assets/images/shockedbandwidth.svg | 92 +++++++++++++++++++++++ src/server.js | 4 +- views/404.handlebars | 11 +++ 5 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 public/assets/css/404.css create mode 100644 public/assets/images/shockedbandwidth.svg create mode 100644 views/404.handlebars diff --git a/locales/en_US.json b/locales/en_US.json index b737da1..8167558 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -366,5 +366,8 @@ "cancel": "Cancel", "confirm": "Confirm", "close": "Close" + }, + "notfound":{ + "description": "Oops! We could not find this page." } } diff --git a/public/assets/css/404.css b/public/assets/css/404.css new file mode 100644 index 0000000..03512c3 --- /dev/null +++ b/public/assets/css/404.css @@ -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; + } +} \ No newline at end of file diff --git a/public/assets/images/shockedbandwidth.svg b/public/assets/images/shockedbandwidth.svg new file mode 100644 index 0000000..702169c --- /dev/null +++ b/public/assets/images/shockedbandwidth.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/server.js b/src/server.js index c26f332..456b79f 100644 --- a/src/server.js +++ b/src/server.js @@ -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'); diff --git a/views/404.handlebars b/views/404.handlebars new file mode 100644 index 0000000..0a4cd31 --- /dev/null +++ b/views/404.handlebars @@ -0,0 +1,11 @@ + + +{{> header}} + +
+
404
+
{{ locale.notfound.description }}
+ + {{> footer }} +
+ From a26023123dd14d86858668618b0bb989997c490b Mon Sep 17 00:00:00 2001 From: MythicalPlayz Date: Wed, 24 Apr 2024 19:38:03 +0200 Subject: [PATCH 2/4] Updated Files --- locales/en_US.json | 2 +- public/assets/css/404.css | 8 ++++---- src/server.js | 1 - views/404.handlebars | 8 ++++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/locales/en_US.json b/locales/en_US.json index 8167558..53fc5ff 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -367,7 +367,7 @@ "confirm": "Confirm", "close": "Close" }, - "notfound":{ + "notfound": { "description": "Oops! We could not find this page." } } diff --git a/public/assets/css/404.css b/public/assets/css/404.css index 03512c3..968561e 100644 --- a/public/assets/css/404.css +++ b/public/assets/css/404.css @@ -1,16 +1,16 @@ -.title404{ +.status { text-align: center; font-size: 8rem; padding-top: 60px; color: var(--text-shade-1); } -.dis404{ +.description { text-align: center; font-size: 1.7rem; margin-top: -10px; color: var(--text-shade-1); } -.shockedbandwidth{ +.shocked-bandwidth { display: block; margin-left: auto; margin-right: auto; @@ -18,7 +18,7 @@ margin-bottom: -120px; } @media screen and (max-width: 900px) { - .shockedbandwidth{ + .shocked-bandwidth { margin-bottom: -100px; } } \ No newline at end of file diff --git a/src/server.js b/src/server.js index 456b79f..a0905a7 100644 --- a/src/server.js +++ b/src/server.js @@ -102,7 +102,6 @@ logger.info('Creating 404 status handler'); app.use((request, response) => { const fullUrl = util.fullUrl(request); response.render('404'); - logger.warn(`HTTP 404 at ${fullUrl}`); }); logger.info('Setting up handlebars engine'); diff --git a/views/404.handlebars b/views/404.handlebars index 0a4cd31..54c7fca 100644 --- a/views/404.handlebars +++ b/views/404.handlebars @@ -3,9 +3,9 @@ {{> header}}
-
404
-
{{ locale.notfound.description }}
- - {{> footer }} +
404
+
{{ locale.notfound.description }}
+ + {{> footer }}
From 32934fa589922b87ec8bce4cef058bf42f8605c8 Mon Sep 17 00:00:00 2001 From: MythicalPlayz Date: Wed, 24 Apr 2024 19:40:54 +0200 Subject: [PATCH 3/4] remove empty space --- views/404.handlebars | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/views/404.handlebars b/views/404.handlebars index 54c7fca..0ee9604 100644 --- a/views/404.handlebars +++ b/views/404.handlebars @@ -7,5 +7,4 @@
{{ locale.notfound.description }}
{{> footer }} - - + \ No newline at end of file From e1bd69fe61482a2236bd36e3c0b25e6108849376 Mon Sep 17 00:00:00 2001 From: MythicalPlayz Date: Thu, 25 Apr 2024 10:22:50 +0200 Subject: [PATCH 4/4] Reformatted using tabs --- public/assets/css/404.css | 28 ++++++++++++++-------------- views/404.handlebars | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/public/assets/css/404.css b/public/assets/css/404.css index 968561e..016adc0 100644 --- a/public/assets/css/404.css +++ b/public/assets/css/404.css @@ -1,24 +1,24 @@ .status { - text-align: center; - font-size: 8rem; - padding-top: 60px; + text-align: center; + font-size: 8rem; + padding-top: 60px; color: var(--text-shade-1); } .description { - text-align: center; - font-size: 1.7rem; - margin-top: -10px; + text-align: center; + font-size: 1.7rem; + margin-top: -10px; color: var(--text-shade-1); } .shocked-bandwidth { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 70px; - margin-bottom: -120px; + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 70px; + margin-bottom: -120px; } @media screen and (max-width: 900px) { - .shocked-bandwidth { - margin-bottom: -100px; - } + .shocked-bandwidth { + margin-bottom: -100px; + } } \ No newline at end of file diff --git a/views/404.handlebars b/views/404.handlebars index 0ee9604..3a49409 100644 --- a/views/404.handlebars +++ b/views/404.handlebars @@ -3,8 +3,8 @@ {{> header}}
-
404
-
{{ locale.notfound.description }}
- - {{> footer }} +
404
+
{{ locale.notfound.description }}
+ + {{> footer }}
\ No newline at end of file