No alt text for avatars

This commit is contained in:
Rory&
2025-12-20 03:25:18 +01:00
parent cd85782582
commit 64aebb7191
+9 -2
View File
@@ -114,14 +114,21 @@
const img = document.createElement("img");
img.src = member.avatar_url;
img.alt = member.username;
img.alt = "";
img.ariaHidden = "true";
img.width = 32;
img.height = 32;
img.style.borderRadius = "50%";
img.style.marginRight = "8px";
img.style.contentVisibility = "auto";
img.loading = "lazy";
img.decoding = "async";
img.style.contentVisibility = "auto";
img.onerror = function() {
console.log("Failed to load avatar for user " + member.username + ", using default.");
const domain = new URL(window.location.href).origin;
// noinspection JSUnresolvedReference - BigInt is a valid global
img.src = `${domain}/embed/avatar/${BigInt(member.id) % 6n}.png`;
};
memberItem.appendChild(img);
const nameSpan = document.createElement("span");