From 02a8a44125e15562e6fa4b78ab94e88215a8ae5c Mon Sep 17 00:00:00 2001
From: bingus_violet
Date: Sun, 21 Apr 2024 13:01:21 -0500
Subject: [PATCH] Remove websocket code, show global spin count for users
without JS, and new noscript class
---
index.js | 19 -------------------
pageUpdater.js | 7 ++++++-
static/global.css | 4 ++++
static/index.html | 4 +++-
static/noScript.css | 4 ++++
5 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/index.js b/index.js
index d5600e3..969c2d3 100644
--- a/index.js
+++ b/index.js
@@ -40,25 +40,6 @@ app.get("/discHTML", (req, res) => {
app.use(pageUpdater.middleWare)
-var sockets = []
-
-
-wsServer = WebSocket.Server;
-
-let server = require('http').createServer()
-
-wsServer = new wsServer({
- server: server,
- perMessageDeflate: false
-})
-
-server.on('request', app)
-
-wsServer.on("connection", function connection(socket) {
- console.log("BALLS")
- socket.send("FUCK")
-})
-
process.on('uncaughtException', (err, origin) => {
fs.writeSync(
process.stderr.fd,
diff --git a/pageUpdater.js b/pageUpdater.js
index 643305f..494af88 100644
--- a/pageUpdater.js
+++ b/pageUpdater.js
@@ -11,6 +11,8 @@ var highlightedWords = config.highlightedWords
var quotes = config.quotes
var titles = config.titles
+var globalSpins = 0
+
var commitCount = "400+"
var lanyardData = undefined
@@ -74,7 +76,8 @@ function converter(html, query) {
"TOPBAR": ``,
"DISCORD_USER": username,
"CUSTOM_STATUS": statusText,
- "LATEST_YOUTUBE": "filler"
+ "LATEST_YOUTUBE": "filler",
+ "SPINCOUNT": globalSpins
}
var rpTable = Object.keys(replacers)
@@ -278,6 +281,8 @@ function socketeer() {
}
}
+ } else if (data.op == 4) {
+ globalSpins = data.spins
}
})
}
diff --git a/static/global.css b/static/global.css
index 9835200..17a1a2f 100644
--- a/static/global.css
+++ b/static/global.css
@@ -227,4 +227,8 @@ ul, ol {
li {
font-size: 1.2rem;
text-align: left;
+}
+
+.noscript {
+ display: none;
}
\ No newline at end of file
diff --git a/static/index.html b/static/index.html
index ed6822b..9086fc2 100644
--- a/static/index.html
+++ b/static/index.html
@@ -45,8 +45,10 @@
+ Violet has been spun {SPINCOUNT} times!
You have spun Violet 4 times!
- Everyone has spun Violet 2 times!
+ Everyone has spun Violet {SPINCOUNT} times!
+
Hi! I'm Violet, a 15 year old web and game developer. I make server-sided dynamic websites, with no Javascript required! I'm currently making games in the Godot Engine, and my dynamic sites in NodeJS.
diff --git a/static/noScript.css b/static/noScript.css
index e31aff4..63de797 100644
--- a/static/noScript.css
+++ b/static/noScript.css
@@ -2,4 +2,8 @@
rotate: 7200deg;
transform: scale(1.15);
transition: all 5s cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
+}
+
+.noscript {
+ display: initial;
}
\ No newline at end of file