diff --git a/index.js b/index.js
index 31b9ce9..10ccfd0 100644
--- a/index.js
+++ b/index.js
@@ -92,19 +92,6 @@ function pageUpdate() {
addedHTML = ""
- if (lanyardData) {
- for (let index = 0; index < lanyardData.activities.length; index++) {
- const activity = lanyardData.activities[index];
- if (activity.type == 4) {
- addedHTML += `
"${lanyardData.activities[0].state}" - ${lanyardData.discord_user.display_name} ${new Date(Date.now()).getFullYear()}
`
- }
- }
- }
-
- html = html.replace("{LANYARD_SPOTIFY}", addedHTML)
-
- addedHTML = ""
-
var debounce = false
if (lanyardData && lanyardData.activities.length > 0) {
diff --git a/resources/mainPage.html b/resources/mainPage.html
index aa2e63f..feb782f 100644
--- a/resources/mainPage.html
+++ b/resources/mainPage.html
@@ -34,7 +34,7 @@
-
Pronouns
+
Disc Status
Socials
Projects
diff --git a/static/discord/index.html b/static/discord/index.html
index 549639b..493dff7 100644
--- a/static/discord/index.html
+++ b/static/discord/index.html
@@ -31,7 +31,7 @@
diff --git a/static/discord/index.js b/static/discord/index.js
index 3b9780a..8244504 100644
--- a/static/discord/index.js
+++ b/static/discord/index.js
@@ -1,5 +1,24 @@
var lanyard = new WebSocket('wss://api.lanyard.rest/socket')
+var statuses = {
+ "online": {
+ "text": "Online",
+ "color": "rgb(100, 255, 100)"
+ },
+ "dnd": {
+ "text": "DND",
+ "color": "rgb(255, 100, 100)"
+ },
+ "idle": {
+ "text": "Idle",
+ "color": "rgb(255, 255, 75)"
+ },
+ "offline": {
+ "text": "Offline",
+ "color": "rgb(125, 125, 125)"
+ }
+}
+
function beat(dur) {
lanyard.send(JSON.stringify({
op: 3
@@ -21,6 +40,22 @@ lanyard.addEventListener("message", (res) => {
}))
} else if (data.op == 0) {
var lanyardData = data.d
- $("*").text(JSON.stringify(lanyardData))
+ // $("*").text(JSON.stringify(lanyardData))
+
+
+ var statusData = statuses[lanyardData.discord_status]
+
+ $("#discStatus").text(statusData.text)
+ $("#discStatus").css("color", statusData.color)
+ $(".pfp").css("border-color", statusData.color)
+
+ if (lanyardData) {
+ for (let index = 0; index < lanyardData.activities.length; index++) {
+ const activity = lanyardData.activities[index];
+ if (activity.type == 4) {
+ $("#discQuote").html(`
"${lanyardData.activities[0].state}" - ${lanyardData.discord_user.display_name} ${new Date(Date.now()).getFullYear()}`)
+ }
+ }
+ }
}
})
\ No newline at end of file