From e1309c96e0fbda93db5a81a8e3a7eea52a5eaf45 Mon Sep 17 00:00:00 2001 From: Ash Date: Wed, 17 Apr 2024 03:31:15 +0000 Subject: [PATCH] Add inital game support page --- locales/en_GB.json | 4 ++ locales/en_US.json | 4 ++ src/routes/games.js | 21 +++++++++ src/server.js | 4 +- views/games.handlebars | 99 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 src/routes/games.js create mode 100644 views/games.handlebars diff --git a/locales/en_GB.json b/locales/en_GB.json index cef02718..1535b55e 100644 --- a/locales/en_GB.json +++ b/locales/en_GB.json @@ -139,6 +139,10 @@ "title": "Our progress", "description": "Check the project's progress and goals! (Updated every hour or so, does not reflect ALL project goals or progress)" }, + "gamesPage": { + "title": "Game support", + "description": "Check which games are supported and online." + }, "blogPage": { "title": "Blog", "description": "The latest updates in condensed chunks. If you want to see more frequent updates, consider supporting us.", diff --git a/locales/en_US.json b/locales/en_US.json index 5ad0fe91..2429f9ed 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -252,6 +252,10 @@ "title": "Our progress", "description": "Check the project progress and goals! (Updated every hour or so, does not reflect ALL project goals or progress)" }, + "gamesPage": { + "title": "Game support", + "description": "Check which games are supported and online." + }, "blogPage": { "title": "Blog", "description": "The latest updates in condensed chunks. If you want to see more frequent updates, consider supporting us.", diff --git a/src/routes/games.js b/src/routes/games.js new file mode 100644 index 00000000..2f5867c4 --- /dev/null +++ b/src/routes/games.js @@ -0,0 +1,21 @@ +const { Router } = require('express'); +const router = new Router(); + +router.get('/', async (request, response) => { + const renderData = { + announcement: "April 17: Due to extremely high load, most servers are unstable. You may not be able to connect, even to services shown as Online. Please be patient while we make upgrades!", + games: { + "Friends": "online", + "Juxtaposition (Miiverse)": "tester", + "Mario Kart 8": "online", + "Splatoon": "online", + "Minecraft: Wii U Edition": "tester", + "Animal Crossing: New Leaf": "offline", + "Super Smash Bros: Wii U": "offline", + } + } + + response.render('games', renderData); +}); + +module.exports = router; \ No newline at end of file diff --git a/src/server.js b/src/server.js index 853e33e9..581fe255 100644 --- a/src/server.js +++ b/src/server.js @@ -98,7 +98,8 @@ const routes = { account: require('./routes/account'), blog: require('./routes/blog'), localization: require('./routes/localization'), - aprilfools: require('./routes/aprilfools') + aprilfools: require('./routes/aprilfools'), + games: require('./routes/games') }; app.use('/', routes.home); @@ -109,6 +110,7 @@ app.use('/account', routes.account); app.use('/localization', routes.localization); app.use('/blog', routes.blog); app.use('/nso-legacy-pack', routes.aprilfools); +app.use('/games', routes.games) logger.info('Creating 404 status handler'); // This works because it is the last router created diff --git a/views/games.handlebars b/views/games.handlebars new file mode 100644 index 00000000..8aeb50e4 --- /dev/null +++ b/views/games.handlebars @@ -0,0 +1,99 @@ +{{#section 'head'}} + +{{/section}} + +{{> header}} + +
+ +
+
+ + + + + + + +

{{ locale.gamesPage.title }}

+

{{ locale.gamesPage.description }}

+
+
+ + {{#if announcement}} +
+ {{{announcement}}} +
+ {{/if}} + +
+ +
+
+
+ + + +
+ Online +
+ +
+
+
+
+ Testers only +
+ +
+
+ Unavailable +
+
+ +
+ +
+
+
+
+ {{#each games}} +
+ {{#if (eq this "online")}} +
+ + + +
+ {{/if}} + {{#if (eq this "tester")}} +
+
+
+ {{/if}} + {{#if (eq this "offline")}} +
+ {{/if}} + {{ @key }} +
+ {{/each}} +
+
+
+
+ +
+ +{{#section 'foot'}} + +{{/section}} \ No newline at end of file