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'))) 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;")
} }
@ -84,7 +63,7 @@ module.exports = {
} }
function get_img(activity, size = "large_image") { 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() { 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 EVIL Purgatory</title> <title>Violet's Purgatory</title>
<meta name="darkreader-lock"> <meta name="darkreader-lock">
@ -29,10 +29,9 @@
<body> <body>
{WEATHER_MODIFIER} {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"> <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>
@ -54,7 +53,10 @@
<hr> <hr>
<div> <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> <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"> <div class="linkContainer">
<a class="chip" href="./socials/">Socials</a> <a class="chip" href="./socials/">Socials</a>
<a class="chip" href="./stats">Stats</a> <a class="chip" href="./stats">Stats</a>
@ -67,9 +69,9 @@
{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>
<div id="activityHtml"> <div id="activityHtml">
{ACTIVITIES} {ACTIVITIES}
</div> </div>

View file

@ -38,6 +38,10 @@ 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,6 +222,8 @@ 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) {