diff --git a/overcomplicatedStatuses.js b/overcomplicatedStatuses.js index d9601b6..297d542 100644 --- a/overcomplicatedStatuses.js +++ b/overcomplicatedStatuses.js @@ -3,6 +3,27 @@ const path = require("path"), var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json'))) +function get_img_url(activity, size = "large_image") { + if ("assets" in activity) { + var image = activity.assets[size] + + if (image) { + if (image.includes("https/")) { + return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length)) + } else if (image.includes("spotify")) { + return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length)) + } else { + return decodeURIComponent('https://cdn.discordapp.com/app-assets/' + activity.application_id + "/" + image + ".png") + } + } + } + + if (!image && size == "large_image") { + + } + return null +} + function makeCompat(string="") { return string.replaceAll("<", "<").replaceAll(">", ">") } @@ -63,7 +84,7 @@ module.exports = { } function get_img(activity, size = "large_image") { - return "https://cache.violets-purgatory.dev/cached/byID/" + activity.id + "?size=" + size + "&url=" + activity.assets[size] + return "https://cache.violets-purgatory.dev/cached/" + get_img_url(activity, size) } function activityTime() { diff --git a/pageUpdater.js b/pageUpdater.js index 67ddf71..36f200d 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -60,7 +60,7 @@ function onlyIfExists(string, check) { } } -function makeHtmlSafe(str="") { +function makeHtmlSafe(str) { return String(str).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); } @@ -163,14 +163,14 @@ function highlighter(json, full = true, linkParent = false) { var startContent = element.content.substring(spanStart - 1, termIndex) var endContent = element.content.substring(termIndex + termKey.length, spanEnd) - if (startContent.includes("(") && !endContent.includes(")")) { - spanEnd = element.content.indexOf(")", spanStart) + 1 - endContent = element.content.substring(termIndex + termKey.length, spanEnd) - } - else if (endContent.includes(")") && !startContent.includes("(")) { - spanStart = element.content.substring(0, spanStart).lastIndexOf("(") - startContent = element.content.substring(spanStart - 1, termIndex) - } + // if (startContent.includes("(") && !endContent.includes(")")) { + // spanEnd = element.content.indexOf(")", spanStart) + 1 + // endContent = element.content.substring(termIndex + termKey.length, spanEnd) + // } + // else if (endContent.includes(")") && !startContent.includes("(")) { + // spanStart = element.content.substring(0, spanStart).lastIndexOf("(") + // startContent = element.content.substring(spanStart - 1, termIndex) + // } var style = termProps.style || "" var classes = termProps.classes || "" diff --git a/static/index.html b/static/index.html index 5822a69..49c50ba 100644 --- a/static/index.html +++ b/static/index.html @@ -17,7 +17,7 @@ - Violet's Purgatory + Violet's EVIL Purgatory @@ -29,9 +29,10 @@ {WEATHER_MODIFIER} -

Welcome to Violet's PurgatoryCommit {COMMIT_COUNT}

+

Welcome to Violet's EVIL PurgatoryCommit {COMMIT_COUNT}

Make sure to check out this project on Forgejo!

+

I know, pretty spooky right


{Violet}

@@ -53,25 +54,22 @@
-

Hi, I'm Violet! I'm a 15 year old web developer, making dynamic websites with server-side rendering, so Javascript is never forced! All of my sites are all made with NodeJS, and are self-hosted.

- -

Links:

-
- -
+

Hi, I'm Violet! an EVIL 15 year old web and game developer. I make dynamic websites with server-side rendering, so no Javascript needed! I'm currently making games in the Godot Engine, and my dynamic sites in NodeJS.

+ +
{CUSTOM_STATUS}
-

{RANDOM_QUOTE}

+

*Insert sPoOoOkY images of ghosts beyond this point*

{ACTIVITIES}
diff --git a/static/root.css b/static/root.css index 8bb063e..ba911d8 100644 --- a/static/root.css +++ b/static/root.css @@ -38,10 +38,6 @@ body { justify-content: center; } -.linkContainer > .chip { - font-size: 1.5rem; -} - .animatedTitle { animation: mainText 2s cubic-bezier(0.075, 0.82, 0.165, 1); /* animation-delay: 1s; */ diff --git a/static/style.css b/static/style.css index 58afb91..98293f8 100644 --- a/static/style.css +++ b/static/style.css @@ -222,8 +222,6 @@ br { width: 40%; aspect-ratio: 1/1; object-fit: cover; - /* background: url("/imgs/notFound.png"); */ - /* background-size: cover; */ } .activity>img:not(.smallimg) {