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

@@ -890,36 +890,50 @@
.current-match-killfeed__weapon {
display: grid;
grid-template-rows: 25px auto;
grid-template-rows: auto auto;
align-items: center;
justify-content: center;
gap: 1px;
gap: 4px;
min-width: 92px;
min-height: 38px;
padding: 2px 5px;
min-height: 40px;
padding: 3px 5px;
border: 1px solid rgba(159, 168, 141, 0.18);
border-radius: 3px;
color: var(--text);
background: rgba(8, 10, 11, 0.74);
}
.current-match-killfeed__weapon-icon-frame {
display: grid;
place-items: center;
width: min(100%, 88px);
min-width: 0;
min-height: 28px;
padding: 3px 7px;
justify-self: center;
border: 1px solid rgba(81, 76, 62, 0.22);
border-radius: 6px;
background: linear-gradient(180deg, rgba(247, 242, 229, 0.96), rgba(226, 218, 198, 0.94));
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.4),
0 1px 3px rgba(0, 0, 0, 0.18);
}
.current-match-killfeed__weapon-icon {
display: block;
width: min(100%, 104px);
width: 100%;
height: 24px;
object-fit: contain;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.72));
object-position: center;
}
.current-match-killfeed__weapon-fallback {
display: grid;
width: 24px;
width: 100%;
min-width: 24px;
height: 24px;
justify-self: center;
place-items: center;
border: 1px solid rgba(210, 182, 118, 0.3);
border-radius: 3px;
color: var(--accent-warm);
color: rgba(49, 43, 31, 0.86);
font-size: 0.82rem;
font-weight: 800;
}

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>
`;
}