fix missing av decoration, missed when moving to js
All checks were successful
Code quality checks / biome (push) Successful in 7s
All checks were successful
Code quality checks / biome (push) Successful in 7s
This commit is contained in:
parent
bf52c02122
commit
9d6b9e40a7
3 changed files with 19 additions and 4 deletions
|
@ -177,10 +177,10 @@ main {
|
|||
|
||||
.decoration {
|
||||
position: absolute;
|
||||
top: -18px;
|
||||
left: -18px;
|
||||
width: 164px;
|
||||
height: 164px;
|
||||
top: -13px;
|
||||
left: -16px;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -535,6 +535,7 @@ async function updatePresence(initialData) {
|
|||
|
||||
const avatarWrapper = document.querySelector(".avatar-wrapper");
|
||||
const avatarImg = avatarWrapper?.querySelector(".avatar");
|
||||
const decorationImg = avatarWrapper?.querySelector(".decoration");
|
||||
const usernameEl = document.querySelector(".username");
|
||||
|
||||
if (!data.discord_user) {
|
||||
|
@ -566,6 +567,19 @@ async function updatePresence(initialData) {
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
decorationImg &&
|
||||
data.discord_user?.avatar_decoration_data &&
|
||||
data.discord_user.avatar_decoration_data.asset
|
||||
) {
|
||||
const newDecorationUrl = `https://cdn.discordapp.com/avatar-decoration-presets/${data.discord_user.avatar_decoration_data.asset}`;
|
||||
decorationImg.src = newDecorationUrl;
|
||||
decorationImg.classList.remove("hidden");
|
||||
} else if (decorationImg) {
|
||||
decorationImg.src = "";
|
||||
decorationImg.classList.add("hidden");
|
||||
}
|
||||
|
||||
if (usernameEl) {
|
||||
const username =
|
||||
data.discord_user.global_name || data.discord_user.username;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
<div class="avatar-status-wrapper">
|
||||
<div class="avatar-wrapper">
|
||||
<img class="avatar hidden"/>
|
||||
<img class="decoration hidden"/>
|
||||
<div class="status-indicator offline hidden"></div>
|
||||
</div>
|
||||
<div class="user-info">
|
||||
|
|
Loading…
Add table
Reference in a new issue