Compare commits

..

1 commit
dev ... origin

Author SHA1 Message Date
809f30c77d Spooky 2024-10-08 16:27:31 -05:00
5 changed files with 45 additions and 32 deletions

View file

@ -3,6 +3,27 @@ const path = require("path"),
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json'))) 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="") { function makeCompat(string="") {
return string.replaceAll("<", "&lt;").replaceAll(">", "&gt;") return string.replaceAll("<", "&lt;").replaceAll(">", "&gt;")
} }
@ -63,7 +84,7 @@ module.exports = {
} }
function get_img(activity, size = "large_image") { 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() { function activityTime() {

View file

@ -60,7 +60,7 @@ function onlyIfExists(string, check) {
} }
} }
function makeHtmlSafe(str="") { function makeHtmlSafe(str) {
return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
} }
@ -163,14 +163,14 @@ function highlighter(json, full = true, linkParent = false) {
var startContent = element.content.substring(spanStart - 1, termIndex) var startContent = element.content.substring(spanStart - 1, termIndex)
var endContent = element.content.substring(termIndex + termKey.length, spanEnd) var endContent = element.content.substring(termIndex + termKey.length, spanEnd)
if (startContent.includes("(") && !endContent.includes(")")) { // if (startContent.includes("(") && !endContent.includes(")")) {
spanEnd = element.content.indexOf(")", spanStart) + 1 // spanEnd = element.content.indexOf(")", spanStart) + 1
endContent = element.content.substring(termIndex + termKey.length, spanEnd) // endContent = element.content.substring(termIndex + termKey.length, spanEnd)
} // }
else if (endContent.includes(")") && !startContent.includes("(")) { // else if (endContent.includes(")") && !startContent.includes("(")) {
spanStart = element.content.substring(0, spanStart).lastIndexOf("(") // spanStart = element.content.substring(0, spanStart).lastIndexOf("(")
startContent = element.content.substring(spanStart - 1, termIndex) // startContent = element.content.substring(spanStart - 1, termIndex)
} // }
var style = termProps.style || "" var style = termProps.style || ""
var classes = termProps.classes || "" var classes = termProps.classes || ""

View file

@ -17,7 +17,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Violet's Purgatory</title> <title>Violet's EVIL Purgatory</title>
<meta name="darkreader-lock"> <meta name="darkreader-lock">
@ -29,9 +29,10 @@
<body> <body>
{WEATHER_MODIFIER} {WEATHER_MODIFIER}
<h1 class="animatedTitle">Welcome to <span class="mainTitle noHighlight">Violet's Purgatory</span><span class="note">Commit {COMMIT_COUNT}</span></h1> <h1 class="animatedTitle">Welcome to <span class="mainTitle noHighlight">Violet's <span class="evil">EVIL</span> Purgatory</span><span class="note">Commit {COMMIT_COUNT}</span></h1>
<main class="animatedMain"> <main class="animatedMain">
<p>Make sure to check out this project on <a href="https://git.violets-purgatory.dev/bingus_violet/violets-purgatory">Forgejo</a>!</p> <p>Make sure to check out this project on <a href="https://git.violets-purgatory.dev/bingus_violet/violets-purgatory">Forgejo</a>!</p>
<p class="evil">I know, pretty spooky right</p>
<hr> <hr>
<div id="card"> <div id="card">
<h2>{Violet}</h2> <h2>{Violet}</h2>
@ -53,25 +54,22 @@
<hr> <hr>
<div> <div>
<p style="padding: 10px; padding-bottom: 5px;">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.</p> <p style="padding: 10px;">Hi, I'm Violet! a<span class="evil">n EVIL</span> 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.</p>
<div class="linkContainer">
<a class="chip" href="./socials/">Socials</a>
<a class="chip" href="./stats">Stats</a>
<a class="chip" href="./faq">Nerd FAQ</a>
<a class="chip" href="https://{BRANCH_SUB}violets-purgatory.dev">{BRANCH_NAME} site</a>
<a class="chip" href="./blog">Blog</a>
<a class="chip" href="https://fs.violets-purgatory.dev">FileShare</a>
</div>
<div class="customStatus"> <div class="customStatus">
{CUSTOM_STATUS} {CUSTOM_STATUS}
</div> </div>
</div> </div>
</div> </div>
<!-- <p>{RANDOM_QUOTE}</p> --> <p>{RANDOM_QUOTE}</p>
<p>*Insert sPoOoOkY images of ghosts beyond this point*</p>
<h2>Other pages:</h2>
<br>
<div class="linkContainer">
<a class="chip" href="./socials/">Socials</a>
<a class="chip" href="./stats">Stats</a>
<a class="chip" href="./faq">Nerd FAQ</a>
<a class="chip" href="https://{BRANCH_SUB}violets-purgatory.dev">{BRANCH_NAME} site</a>
<a class="chip" href="./blog">Blog</a>
<a class="chip" href="https://fs.violets-purgatory.dev">FileShare</a>
</div>
<div id="activityHtml"> <div id="activityHtml">
{ACTIVITIES} {ACTIVITIES}
</div> </div>

View file

@ -38,10 +38,6 @@ body {
justify-content: center; justify-content: center;
} }
.linkContainer > .chip {
font-size: 1.5rem;
}
.animatedTitle { .animatedTitle {
animation: mainText 2s cubic-bezier(0.075, 0.82, 0.165, 1); animation: mainText 2s cubic-bezier(0.075, 0.82, 0.165, 1);
/* animation-delay: 1s; */ /* animation-delay: 1s; */

View file

@ -222,8 +222,6 @@ br {
width: 40%; width: 40%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
object-fit: cover; object-fit: cover;
/* background: url("/imgs/notFound.png"); */
/* background-size: cover; */
} }
.activity>img:not(.smallimg) { .activity>img:not(.smallimg) {