Add kill feed weapon icon background

This commit is contained in:
devRaGonSa
2026-06-10 08:44:36 +02:00
parent 5ce398ca54
commit 664f61db0f
3 changed files with 193 additions and 23 deletions

View File

@@ -543,20 +543,26 @@ function resolveKillFeedWeapon(value) {
function renderKillFeedWeaponIcon(weapon) {
if (!weapon.icon) {
return '<span class="current-match-killfeed__weapon-fallback" aria-hidden="true">?</span>';
return `
<span class="current-match-killfeed__weapon-icon-frame" aria-hidden="true">
<span class="current-match-killfeed__weapon-fallback">?</span>
</span>
`;
}
return `
<img
class="current-match-killfeed__weapon-icon"
src="${escapeHtml(weapon.icon)}"
alt=""
width="88"
height="32"
loading="lazy"
decoding="async"
onerror="this.hidden = true; this.nextElementSibling.hidden = false;"
/>
<span class="current-match-killfeed__weapon-fallback" aria-hidden="true" hidden>?</span>
<span class="current-match-killfeed__weapon-icon-frame" aria-hidden="true">
<img
class="current-match-killfeed__weapon-icon"
src="${escapeHtml(weapon.icon)}"
alt=""
width="88"
height="32"
loading="lazy"
decoding="async"
onerror="this.hidden = true; this.nextElementSibling.hidden = false;"
/>
<span class="current-match-killfeed__weapon-fallback" hidden>?</span>
</span>
`;
}