From 5a8e1e8db21d3ee4c3a34ab3bb8542d4f4b6bc4f Mon Sep 17 00:00:00 2001 From: Bingus_Violet Date: Mon, 20 Nov 2023 18:50:02 -0600 Subject: [PATCH] better img support for activities --- index.js | 3 +++ static/style.css | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/index.js b/index.js index 3eb67fa..aef9c17 100644 --- a/index.js +++ b/index.js @@ -117,6 +117,8 @@ function pageUpdate() { return 'https://' + image.substr(image.indexOf('https/') + 6, image.length) } else if (image.includes("spotify")) { return 'https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length) + } else { + return `https://cdn.discordapp.com/app-assets/${activity.application_id}/${image}.png` } } } @@ -159,6 +161,7 @@ function pageUpdate() { ` } else { + console.log(get_img()) addedHTML += `

diff --git a/static/style.css b/static/style.css index 37dd0fa..84e3d7f 100644 --- a/static/style.css +++ b/static/style.css @@ -80,6 +80,13 @@ a { width: 100%; } +.activity > img { + width: 128px; + height: 128px; + aspect-ratio: 1/1; + object-fit: cover; +} + a:hover { color: white; transition: 0.5s all cubic-bezier(0.075, 0.82, 0.165, 1);