This commit is contained in:
Clove 2026-06-18 15:59:37 +01:00
parent df7d2813ae
commit 3a7f4238ad
4 changed files with 29 additions and 2 deletions

View File

@ -2045,6 +2045,18 @@ body:has(.friends-wrap) .hub {
display: block;
}
/* avatar decoration / frame overlay (Discord cosmetic) */
.fc-deco {
position: absolute;
top: 50%;
left: 50%;
width: 76px;
height: 76px;
transform: translate(-50%, -50%);
pointer-events: none;
}
.fc-deco[hidden] { display: none; }
/* status dot — colour driven by data-status on the card */
.fc-status {
position: absolute;

View File

@ -216,7 +216,7 @@
<dl class="hw-list about-list">
<div class="hw-row">
<dt>AMD Purist</dt>
<dd>Team Red top to bottom — Ryzen on the CPU, Radeon on the GPU. No green in this rig.</dd>
<dd>Team Red top to bottom — Ryzen on the CPU, Radeon on the GPU. No green or blue in this rig.</dd>
</div>
<div class="hw-row">
<dt>Arch btw</dt>

View File

@ -169,6 +169,7 @@
'<div class="fc-main">' +
'<span class="fc-avatar">' +
'<img class="fc-pfp" src="' + esc(m.img) + '" alt="' + esc(m.name) + '" loading="eager">' +
'<img class="fc-deco" alt="" aria-hidden="true" hidden>' +
'<span class="fc-status" title="not connected to Lanyard"></span>' +
'</span>' +
'<span class="fc-id">' +
@ -185,6 +186,7 @@
return {
el: card,
pfp: card.querySelector(".fc-pfp"),
deco: card.querySelector(".fc-deco"),
statusDot: card.querySelector(".fc-status"),
user: card.querySelector(".fc-user"),
custom: card.querySelector(".fc-custom"),
@ -216,6 +218,17 @@
refs.el.dataset.status = status;
refs.statusDot.title = STATUS_TITLE[status] || "Offline";
if (u.avatar) refs.pfp.src = avatarUrl(u);
// avatar decoration (animated APNG) — loaded straight from Discord's
// CDN; the wsrv webp proxy fails on these and would drop the animation.
var deco = u.avatar_decoration_data;
if (refs.deco) {
if (deco && deco.asset) {
refs.deco.src = "https://cdn.discordapp.com/avatar-decoration-presets/" + deco.asset + ".png";
refs.deco.hidden = false;
} else {
refs.deco.hidden = true;
}
}
if (u.username) refs.user.textContent = "@" + u.username;
renderCustomStatus(refs, d.activities);
renderClanTag(refs, u.primary_guild);

View File

@ -515,7 +515,9 @@
avImg.src = avatarUrl(u);
const deco = u.avatar_decoration_data;
if (deco && deco.asset) {
avDeco.src = proxyImg(`https://cdn.discordapp.com/avatar-decoration-presets/${deco.asset}.png?size=160`);
// Load decorations straight from Discord's CDN: they're animated APNGs,
// and the wsrv webp proxy fails on them (and would drop the animation).
avDeco.src = `https://cdn.discordapp.com/avatar-decoration-presets/${deco.asset}.png`;
avDeco.hidden = false;
} else {
avDeco.hidden = true;