diff --git a/.gitignore b/.gitignore index ceaea36..8327e4c 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,5 @@ dist .yarn/install-state.gz .pnp.* +# Violet's Purgatory +static/assets/ \ No newline at end of file diff --git a/index.js b/index.js index 11d0f73..87b32da 100644 --- a/index.js +++ b/index.js @@ -22,51 +22,65 @@ app.listen(PORT, () => { }) app.get("/", (req, res) => { - var html = fs.readFileSync(mainpage).toString() - var addedHTML = "" + res.setHeader("X-Content-Type-Options", "") + + 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)" + } + } + + var html = fs.readFileSync(mainpage).toString() + + var checkpoint = ["{LANYARD_STATUS}", "{LANYARD}"] + + function io(numb, end=false) { + if (end) { + return html.indexOf(checkpoint[numb]) + checkpoint[numb].length + } + return html.indexOf(checkpoint[numb]) + } + + res.write(html.substring(0, io(0))) + + var statusData = statuses[lanyardData.discord_status] + + res.write(`
${statusData.text}
`) + res.write(``) + + res.write(html.substring(io(0, true), io(1))) if (lanyardData) { for (let index = 0; index < lanyardData.activities.length; index++) { const activity = lanyardData.activities[index]; console.log(activity) if (activity.type == 2) { - addedHTML += `Listening to on ${activity.name}: ${activity.details} (by ${activity.state})
` + res.write(`Listening on ${activity.name}: ${activity.details} (by ${activity.state})
`) } else if (activity.type == 4) { - addedHTML += `"${lanyardData.activities[0].state}" - ${lanyardData.discord_user.display_name} ${new Date(Date.now()).getFullYear()}
` + res.write(`"${lanyardData.activities[0].state}" - ${lanyardData.discord_user.display_name} ${new Date(Date.now()).getFullYear()}
`) } } - 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)" - } - } - var statusData = statuses[lanyardData.discord_status] - - addedHTML += `` - console.log(lanyardData.activities) } - - html = html.replace("{LANYARD_STATUS}", `${statusData.text}
`) - - html = html.replace("{LANYARD}", addedHTML) - - res.send(html) + console.log(io(checkpoint.length - 1, true)) + res.write(html.substring(io(checkpoint.length - 1, true), html.length) + "Thank you for checking out my website <3
", () => { + res.end() + }) }) // Lanyard Stuffs diff --git a/resources/mainPage.html b/resources/mainPage.html index a6ba5c6..31ac833 100644 --- a/resources/mainPage.html +++ b/resources/mainPage.html @@ -5,16 +5,18 @@ - +Due to changes in hosting, some services are still down. SearX (the original) has decent uptime, but SearXNG will be continiously going back up and down. Univerter & Fortnite have currently no efforts put towards getting them back up.
@@ -29,15 +28,16 @@Things with a green border are up, things with a yellow border are inconsistent or have problems, things with a red border are down.
Univerter (Report issues here!): yt.violets-purgatory.dev
+Univerter (Report issues here!): yt.violets-purgatory.dev
Planned: Matrix, Mastodon
Whoogle: wg.violets-purgatory.dev
SearX: sx.violets-purgatory.dev
SearXNG: sxng.violets-purgatory.dev
Nothing planned...
Fortnite (Web edition!): fortnite.violets-purgatory.dev
-Nothing planned.
+Nothing planned...
Have any ideas of what I should host? Submit an issue with your idea to codeberg!
All ideas are welcome, just make sure that they have not been tried in the past! Please also ensure that it is not listed on the codeberg page.
diff --git a/static/pronouns/index.html b/static/pronouns/index.html index 6ac3971..3134e3e 100644 --- a/static/pronouns/index.html +++ b/static/pronouns/index.html @@ -23,7 +23,6 @@ -