From 8b9a434be3628fabb615c0ea5b55dab8a1d9e315 Mon Sep 17 00:00:00 2001 From: Cam Spry Date: Mon, 2 Mar 2026 01:21:17 -0500 Subject: [PATCH] Added menu screen, about section, etc --- public/{index.html => game.html} | 2 +- public/menu.html | 226 +++++++++++++++++++++++++++++++ server.js | 8 +- 3 files changed, 233 insertions(+), 3 deletions(-) rename public/{index.html => game.html} (99%) create mode 100644 public/menu.html diff --git a/public/index.html b/public/game.html similarity index 99% rename from public/index.html rename to public/game.html index a665e38..8bb38b3 100644 --- a/public/index.html +++ b/public/game.html @@ -369,7 +369,7 @@ (function() { // Get room name from URL const pathParts = window.location.pathname.split('/').filter(p => p); - const roomName = pathParts[0] || 'default'; + const roomName = pathParts[pathParts.length-1] || 'default'; document.getElementById('room-display').textContent = `Room: ${roomName}`; // Get or create player UUID diff --git a/public/menu.html b/public/menu.html new file mode 100644 index 0000000..339f82b --- /dev/null +++ b/public/menu.html @@ -0,0 +1,226 @@ + + + + + + Y.A.R.N. 2026 + + + + + + +
+

Y.A.R.N.

+

HTML5 Edition

+ + +
+ + +
+ + +
+ +
+
+ + +
+ +
+ + + +
+ + + + + \ No newline at end of file diff --git a/server.js b/server.js index e63b01c..e998788 100644 --- a/server.js +++ b/server.js @@ -344,8 +344,12 @@ function getOrCreateGame(roomName) { } // Route for game rooms -app.get('/:roomName', (req, res) => { - res.sendFile(path.join(__dirname, 'public', 'index.html')); +app.get('/game/:roomName', (req, res) => { + res.sendFile(path.join(__dirname, 'public', 'game.html')); +}); + +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'public', 'menu.html')); }); // Socket.IO connection handling