From 7e0e7dbfdbab146888286919b51d17e59519cf13 Mon Sep 17 00:00:00 2001 From: anushka Date: Thu, 4 Jun 2026 13:22:38 +0530 Subject: [PATCH 1/3] added 404 website themed page --- frontend/404.html | 270 ++++++++++++++++++++++++++++++++++++++++++++++ server.js | 6 +- 2 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 frontend/404.html diff --git a/frontend/404.html b/frontend/404.html new file mode 100644 index 00000000..dc9f4355 --- /dev/null +++ b/frontend/404.html @@ -0,0 +1,270 @@ + + + + + + 404 — Not Found | CodePVG + + + + + + +
+ +
404 — Not Found
+
> route resolution failed. filesystem integrity nominal.
+ +
+ +
+
+ guest@codepvg:~$ + cd /unknown-path +
+
+ bash: cd: /unknown-path: No such file or directory +
+
+ +
+
# exit code: 404
+
# This route doesn't exist. Unlike your rank, which does.
+
+ +
+ +
+
+ guest@codepvg:~$ + ls /valid-routes +
+
+ leaderboard/ +    + registration/ +
+
+ +
+ guest@codepvg:~$ + +
+ + + +
+ + + + + \ No newline at end of file diff --git a/server.js b/server.js index 298ff019..b3d92f71 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,6 @@ const express = require("express"); +const path = require('path'); const cors = require("cors"); -const path = require("path"); const app = express(); const PORT = process.env.PORT || 3000; @@ -36,6 +36,7 @@ const studentCache = new Map(); app.get("/api/student/:username", async (req, res) => { const username = req.params.username; + if (studentCache.has(username)) { const cached = studentCache.get(username); if (Date.now() - cached.timestamp < 5 * 60 * 1000) { @@ -57,8 +58,9 @@ app.get("/api/student/:username", async (req, res) => { } }); +// 404 handler app.use((req, res) => { - res.status(404).send("Page not found"); + res.status(404).sendFile(path.join(__dirname, "frontend", "404.html")); }); app.listen(PORT, () => { From 41bb16ac449e4bc6ea703b904af60cd6a58470b1 Mon Sep 17 00:00:00 2001 From: Jagdish Prajapati Date: Fri, 5 Jun 2026 15:21:29 +0530 Subject: [PATCH 2/3] refine 404 page layout and responsiveness --- frontend/404.html | 131 +++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/frontend/404.html b/frontend/404.html index dc9f4355..36ebde7b 100644 --- a/frontend/404.html +++ b/frontend/404.html @@ -1,26 +1,20 @@ + 404 — Not Found | CodePVG + + + + + + @@ -205,20 +202,23 @@ ls /valid-routes
- leaderboard/ + leaderboard/ +    + registration/    - registration/ + about/
guest@codepvg:~$ - +
@@ -267,4 +267,5 @@ - \ No newline at end of file + + From 1a29ca69c0e3f19a346d346e862f790f3c628bd6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 5 Jun 2026 09:52:59 +0000 Subject: [PATCH 3/3] style: auto-format code with Prettier (/format) --- frontend/404.html | 517 ++++++++++++++++++++++++---------------------- server.js | 3 +- 2 files changed, 271 insertions(+), 249 deletions(-) diff --git a/frontend/404.html b/frontend/404.html index 36ebde7b..ea707228 100644 --- a/frontend/404.html +++ b/frontend/404.html @@ -1,271 +1,294 @@ - + + + + + 404 — Not Found | CodePVG + + + + + + - - + /* Main panel */ + .panel { + position: relative; + z-index: 1; + background: rgba(0, 10, 0, 0.85); + border: 1px solid rgba(0, 255, 65, 0.3); + border-radius: 4px; + padding: 2.5rem 3rem; + max-width: 680px; + width: 90%; + box-shadow: + 0 0 40px rgba(0, 255, 65, 0.08), + inset 0 0 60px rgba(0, 0, 0, 0.5); + } - + /* Title */ + .title { + font-size: 2.4rem; + font-weight: normal; + color: var(--green); + text-shadow: + 0 0 20px rgba(0, 255, 65, 0.4), + 0 0 40px rgba(0, 255, 65, 0.4); + letter-spacing: 2px; + margin-bottom: 0.4rem; + } -
+ .title .cursor { + display: inline-block; + width: 3px; + height: 2.2rem; + background: var(--green); + vertical-align: middle; + margin-left: 4px; + animation: blink 1s step-end infinite; + box-shadow: 0 0 8px var(--green); + } -
404 — Not Found
-
> route resolution failed. filesystem integrity nominal.
+ @keyframes blink { + 50% { + opacity: 0; + } + } -
+ .subtitle { + color: #4a8c4a; + font-size: 0.85rem; + margin-bottom: 2rem; + } -
-
- guest@codepvg:~$ - cd /unknown-path + /* Terminal lines */ + .terminal-block { + margin-bottom: 1.4rem; + } + + .line { + line-height: 1.8; + font-size: 0.95rem; + } + + .prompt { + color: var(--green); + text-shadow: 0 0 8px rgba(0, 255, 65, 0.4); + } + + .prompt-sym { + color: var(--green-dim); + } + + .cmd { + color: #c9e8c9; + } + + .error-line { + color: var(--red); + text-shadow: 0 0 8px rgba(255, 68, 68, 0.4); + } + + .comment { + color: #4a8c4a; + } + + .highlight { + color: var(--green); + font-weight: bold; + text-shadow: 0 0 10px rgba(0, 255, 65, 0.4); + } + + .highlight a { + color: inherit; + text-decoration: none; + transition: color 0.15s ease; + } + + .highlight a:hover { + color: #66ffaa; + text-shadow: 0 0 12px rgba(0, 255, 65, 0.4); + } + + /* Divider */ + .divider { + border: none; + border-top: 1px solid rgba(0, 255, 65, 0.3); + margin: 1.4rem 0; + } + + /* Button area — centered */ + .nav-links { + display: flex; + gap: 1.2rem; + flex-wrap: wrap; + margin-top: 1.8rem; + justify-content: center; + } + + /* Scanline overlay */ + body::after { + content: ""; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: repeating-linear-gradient( + 0deg, + transparent, + transparent 2px, + rgba(0, 0, 0, 0.05) 2px, + rgba(0, 0, 0, 0.05) 4px + ); + pointer-events: none; + z-index: 2; + } + + + + + + +
+
404 — Not Found
+
+ > route resolution failed. filesystem integrity nominal.
-
- bash: cd: /unknown-path: No such file or directory + +
+ +
+
+ guest@codepvg:~$ + cd /unknown-path +
+
+ bash: cd: /unknown-path: No such file + or directory +
-
-
-
# exit code: 404
-
# This route doesn't exist. Unlike your rank, which does.
-
+
+
# exit code: 404
+
+ # This route doesn't exist. Unlike your rank, which does. +
+
-
+
+ +
+
+ guest@codepvg:~$ + ls /valid-routes +
+
+ leaderboard/ +    + registration/ +    + about/ +
+
-
- guest@codepvg:~$ - ls /valid-routes + guest@codepvg:~$ +
- -
- guest@codepvg:~$ - -
+ - - + setInterval(drawMatrix, 40); + + diff --git a/server.js b/server.js index b3d92f71..2dee9a9b 100644 --- a/server.js +++ b/server.js @@ -1,5 +1,5 @@ const express = require("express"); -const path = require('path'); +const path = require("path"); const cors = require("cors"); const app = express(); @@ -36,7 +36,6 @@ const studentCache = new Map(); app.get("/api/student/:username", async (req, res) => { const username = req.params.username; - if (studentCache.has(username)) { const cached = studentCache.get(username); if (Date.now() - cached.timestamp < 5 * 60 * 1000) {