From ae576d6ca9ce3a261ebc165cdd0abb3b3c6b709e Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Sun, 30 Jun 2024 02:14:09 -0500 Subject: [PATCH 1/2] No longer transparent --- static/themes/magic/style.css | 2 +- static/themes/rain/style.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/themes/magic/style.css b/static/themes/magic/style.css index 05b8512..1721029 100644 --- a/static/themes/magic/style.css +++ b/static/themes/magic/style.css @@ -1,6 +1,6 @@ #card { - background-color: rgba(20, 5, 90, 0.5); + background-color: rgba(25, 0, 70, 1); /* backdrop-filter: blur(5px); */ } .magicStuff { diff --git a/static/themes/rain/style.css b/static/themes/rain/style.css index 3302382..d10daae 100644 --- a/static/themes/rain/style.css +++ b/static/themes/rain/style.css @@ -1,6 +1,6 @@ #card { - background-color: rgba(50, 0, 90, 0.5); + background-color: rgba(25, 0, 70, 1); /* backdrop-filter: blur(5px); */ } .rainStuff { From 392532787579e4937de4d8e9a64c44b6372bf7d7 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Sun, 30 Jun 2024 02:14:50 -0500 Subject: [PATCH 2/2] Express handler is split from index.js --- expressHandler.js | 28 ++++++++++++++++++++++++++++ index.js | 29 +++++------------------------ 2 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 expressHandler.js diff --git a/expressHandler.js b/expressHandler.js new file mode 100644 index 0000000..8e3dd47 --- /dev/null +++ b/expressHandler.js @@ -0,0 +1,28 @@ +const express = require("express"), +path = require("path") + +var app = express() + +const PORT = process.env.PORT || 8080 + +const cachePath = path.join(__dirname, 'cached') +const assetPath = path.join(__dirname, "assets") + +app.listen(PORT, () => { + console.log("Violet's Purgatory is now listening on port: " + PORT) +}) + +const pageUpdater = require("./pageUpdater.js") + +app.use("/fonts", express.static(path.join(assetPath, "fonts"))) +app.use("/cached", express.static(cachePath)) +app.use("/imgs", express.static(path.join(assetPath, "Images"))) +app.use("/snds", express.static(path.join(assetPath, "Sounds"))) + +app.use("/emojis", express.static(path.join(cachePath, "emojis"))) + +app.use(pageUpdater.middleWare) + +module.exports = { + app: app +} \ No newline at end of file diff --git a/index.js b/index.js index df08653..4433575 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,8 @@ -const express = require('express'), +const express = require('./expressHandler.js'), path = require('path'), fs = require('fs'), WebSocket = require("ws") -var app = express() - -const PORT = process.env.PORT || 8080 - const staticpath = path.join(__dirname, 'static') const cachePath = path.join(__dirname, 'cached') const assetPath = path.join(__dirname, "assets") @@ -27,21 +23,8 @@ if (!fs.existsSync(announcementFile)) { fs.writeFileSync(announcementFile, ``) } -const pageUpdater = require('./pageUpdater.js') - var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json'))) -app.listen(PORT, () => { - console.log("Violet's Purgatory is now listening on port: " + PORT) -}) - -app.use("/fonts", express.static(path.join(assetPath, "fonts"))) -app.use("/cached", express.static(cachePath)) -app.use("/imgs", express.static(path.join(assetPath, "Images"))) -app.use("/snds", express.static(path.join(assetPath, "Sounds"))) - -app.use("/emojis", express.static(path.join(cachePath, "emojis"))) - if (!fs.existsSync(cachePath)) { fs.mkdirSync(cachePath) } @@ -50,12 +33,10 @@ if (!fs.existsSync(path.join(cachePath, "emojis"))) { fs.mkdirSync(path.join(cachePath, "emojis")) } -app.use(pageUpdater.middleWare) - process.on('uncaughtException', (err, origin) => { fs.writeSync( - process.stderr.fd, - `Caught exception: ${err}\n` + - `Exception origin: ${origin}`, + process.stderr.fd, + `Caught exception: ${err}\n` + + `Exception origin: ${origin}`, ); - }); \ No newline at end of file +}); \ No newline at end of file