better img support for activities

This commit is contained in:
Bingus_Violet 2023-11-20 18:50:02 -06:00
parent effbcc34da
commit 5a8e1e8db2
2 changed files with 10 additions and 0 deletions

View file

@ -117,6 +117,8 @@ function pageUpdate() {
return 'https://' + image.substr(image.indexOf('https/') + 6, image.length) return 'https://' + image.substr(image.indexOf('https/') + 6, image.length)
} else if (image.includes("spotify")) { } else if (image.includes("spotify")) {
return 'https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length) 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() {
</div> </div>
` `
} else { } else {
console.log(get_img())
addedHTML += ` addedHTML += `
<div class="chip activity col-md-6 testing"> <div class="chip activity col-md-6 testing">
<p> <p>

View file

@ -80,6 +80,13 @@ a {
width: 100%; width: 100%;
} }
.activity > img {
width: 128px;
height: 128px;
aspect-ratio: 1/1;
object-fit: cover;
}
a:hover { a:hover {
color: white; color: white;
transition: 0.5s all cubic-bezier(0.075, 0.82, 0.165, 1); transition: 0.5s all cubic-bezier(0.075, 0.82, 0.165, 1);