{RANDOM_QUOTE}
@@ -52,6 +53,9 @@Socials
{PATH_SOCIALS} ++
{WEATHER_TEXT}
+diff --git a/config.json b/config.json index 2f96cec..c1b7fe8 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "activityImages": { - "ULTRAKILL": "https://fs.violets-purgatory.dev/ULTRAKILL/etc/DiscordIcon.webp" + "ULTRAKILL": "https://cdn.violets-purgatory.dev/fallbackImages/ULTRAKILL.webp" }, "discStatuses": { "online": { diff --git a/pageUpdater.js b/pageUpdater.js index 0f7f273..a174cc7 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -2,7 +2,8 @@ const path = require('path'), fs = require('fs'), WebSocket = require('ws'), minify = require('minify-html'), - activityToHTML = require("./overcomplicatedStatuses.js") + activityToHTML = require("./overcomplicatedStatuses.js"), + weatherGenerator = require("./weatherGenerator") var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json'))) @@ -16,7 +17,7 @@ var lanyardData = undefined var uptime = Date.now() -function converter(html) { +function converter(html, query) { while (html.includes("{PATH_")) { var pagePath = html.substring(html.indexOf("{PATH_")) pagePath = pagePath.substring(6, pagePath.indexOf('}')) @@ -43,6 +44,8 @@ function converter(html) { var username = "bingus_violet" } + var time = new Date(Date.now()) + var replacers = { "COMMIT_COUNT": commitCount, "RANDOM_QUOTE": quotes[Math.floor(Math.random() * quotes.length)], @@ -79,6 +82,19 @@ function converter(html) { html = html.substring(0, html.indexOf("
")) + bodyHTML + html.substring(html.indexOf("") + 7) + var weathers = ["rain", "none", "none", "none", "none", "none"] + + var weather = weathers[time.getDate() % weathers.length] + + if (weather == "rain") { + html = html.replaceAll("{WEATHER_MODIFIER}", weatherGenerator.makeRain("hardRain" in query)) + + html = html.replaceAll("{WEATHER_TEXT}", `The rain is so pretty... I wish I saw it more...`) + } else { + html = html.replaceAll("{WEATHER_MODIFIER}", "") + html = html.replaceAll("{WEATHER_TEXT}", "") + } + return html } @@ -110,7 +126,7 @@ module.exports = { if (req.path.includes(".css")) { res.setHeader("Content-Type", "text/css") } else if (!req.path.includes(".woff2")) { - data = converter(data) + data = converter(data, req.query) } res.send(minify.minify(data)) diff --git a/resources/snow.html b/resources/snow.html deleted file mode 100644 index 280b713..0000000 --- a/resources/snow.html +++ /dev/null @@ -1,196 +0,0 @@ - -I love the winter :>
- - \ No newline at end of file diff --git a/resources/stars.html b/resources/stars.html deleted file mode 100644 index e45475b..0000000 --- a/resources/stars.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/static/global.css b/static/global.css index c0dfcb6..525f94e 100644 --- a/static/global.css +++ b/static/global.css @@ -61,8 +61,6 @@ body { min-height: 100vh; - padding: 5vh 0; - animation: hideContent 2.5s; } diff --git a/static/index.html b/static/index.html index 567c5dc..1f9aaf8 100644 --- a/static/index.html +++ b/static/index.html @@ -19,6 +19,7 @@ + {WEATHER_MODIFIER}{RANDOM_QUOTE}
@@ -52,6 +53,9 @@{WEATHER_TEXT}
+