Merge branch 'dev' into origin

This commit is contained in:
bingus_violet 2024-11-11 02:13:42 -06:00
commit b431feb36e
5 changed files with 32 additions and 45 deletions

View file

@ -3,27 +3,6 @@ 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("<", "&lt;").replaceAll(">", "&gt;")
}
@ -84,7 +63,7 @@ module.exports = {
}
function get_img(activity, size = "large_image") {
return "https://cache.violets-purgatory.dev/cached/" + get_img_url(activity, size)
return "https://cache.violets-purgatory.dev/cached/byID/" + activity.id + "?size=" + size + "&url=" + activity.assets[size]
}
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;');
}
@ -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 || ""

View file

@ -17,7 +17,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Violet's EVIL Purgatory</title>
<title>Violet's Purgatory</title>
<meta name="darkreader-lock">
@ -29,10 +29,9 @@
<body>
{WEATHER_MODIFIER}
<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>
<h1 class="animatedTitle">Welcome to <span class="mainTitle noHighlight">Violet's Purgatory</span><span class="note">Commit {COMMIT_COUNT}</span></h1>
<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 class="evil">I know, pretty spooky right</p>
<hr>
<div id="card">
<h2>{Violet}</h2>
@ -54,22 +53,25 @@
<hr>
<div>
<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">
<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>
<h2>Links:</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 class="customStatus">
{CUSTOM_STATUS}
</div>
</div>
</div>
<p>{RANDOM_QUOTE}</p>
<p>*Insert sPoOoOkY images of ghosts beyond this point*</p>
<div id="activityHtml">
{ACTIVITIES}
</div>

View file

@ -38,6 +38,10 @@ 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; */

View file

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