Remove weapon icons from historical match detail
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
id: TASK-236
|
||||||
|
title: Remove weapon icons from historical match detail
|
||||||
|
status: done
|
||||||
|
type: frontend
|
||||||
|
team: Frontend Senior
|
||||||
|
supporting_teams:
|
||||||
|
- Analista
|
||||||
|
roadmap_item: foundation
|
||||||
|
priority: low
|
||||||
|
---
|
||||||
|
|
||||||
|
# TASK-236 - Remove weapon icons from historical match detail
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Remove weapon icon rendering from `historico-partida.html` while keeping the textual player-detail stats intact.
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
The historical match detail page was loading `current-match-weapon-icons.js` and rendering weapon images inside the expanded player panel for `Armas`, `Mas abatido` and `Muere por`. The requirement for this page is text-only historical detail.
|
||||||
|
|
||||||
|
## Files Read First
|
||||||
|
|
||||||
|
- `frontend/historico-partida.html`
|
||||||
|
- `frontend/assets/js/historico-partida.js`
|
||||||
|
- `frontend/assets/css/historico.css`
|
||||||
|
- `frontend/partida-actual.html`
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
1. Removed the `current-match-weapon-icons.js` script include from `frontend/historico-partida.html`.
|
||||||
|
2. Removed historical weapon icon rendering from `frontend/assets/js/historico-partida.js`.
|
||||||
|
3. Kept textual name and count rendering for weapon-related sections.
|
||||||
|
4. Removed now-unused historical weapon icon CSS from `frontend/assets/css/historico.css`.
|
||||||
|
5. Kept live current-match weapon icons untouched because they belong to `partida-actual.html`.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- `node --check frontend/assets/js/historico-partida.js`
|
||||||
|
- Confirmed `historico-partida.html` no longer loads `current-match-weapon-icons.js`.
|
||||||
|
- Confirmed the historical player detail still renders `Armas`, `Mas abatido` and `Muere por` as text-only lists.
|
||||||
|
- Confirmed no SVG, weapon asset, clan asset or physical image file was modified.
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
The historical match detail page no longer renders weapon images at any point, but it preserves the textual stats and expandable player detail workflow.
|
||||||
@@ -644,42 +644,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.historical-weapon-stat-list li {
|
.historical-weapon-stat-list li {
|
||||||
grid-template-columns: 78px minmax(0, 1fr) auto;
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.historical-weapon-stat-list__icon-frame {
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
width: 72px;
|
|
||||||
min-height: 28px;
|
|
||||||
padding: 3px 6px;
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
.historical-weapon-stat-list__icon {
|
|
||||||
width: 100%;
|
|
||||||
height: 22px;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
|
|
||||||
.historical-weapon-stat-list__fallback {
|
|
||||||
display: grid;
|
|
||||||
width: 100%;
|
|
||||||
height: 22px;
|
|
||||||
place-items: center;
|
|
||||||
color: rgba(49, 43, 31, 0.86);
|
|
||||||
font-size: 0.78rem;
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.historical-weapon-stat-list__fallback[hidden] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.historical-table-shell {
|
.historical-table-shell {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -629,7 +629,6 @@ function renderNamedCountSection(title, items) {
|
|||||||
const count = stat.count ?? stat.total ?? 0;
|
const count = stat.count ?? stat.total ?? 0;
|
||||||
return `
|
return `
|
||||||
<li>
|
<li>
|
||||||
${renderHistoricalWeaponIcon(name)}
|
|
||||||
<span>${escapeHtml(name)}</span>
|
<span>${escapeHtml(name)}</span>
|
||||||
<strong>${escapeHtml(formatNumber(count))}</strong>
|
<strong>${escapeHtml(formatNumber(count))}</strong>
|
||||||
</li>
|
</li>
|
||||||
@@ -641,47 +640,6 @@ function renderNamedCountSection(title, items) {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderHistoricalWeaponIcon(name) {
|
|
||||||
const weapon = resolveHistoricalWeapon(name);
|
|
||||||
if (!weapon.icon) {
|
|
||||||
return `
|
|
||||||
<span class="historical-weapon-stat-list__icon-frame" aria-hidden="true">
|
|
||||||
<span class="historical-weapon-stat-list__fallback">?</span>
|
|
||||||
</span>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
return `
|
|
||||||
<span class="historical-weapon-stat-list__icon-frame" aria-hidden="true">
|
|
||||||
<img
|
|
||||||
class="historical-weapon-stat-list__icon"
|
|
||||||
src="${escapeHtml(weapon.icon)}"
|
|
||||||
alt=""
|
|
||||||
width="72"
|
|
||||||
height="26"
|
|
||||||
loading="lazy"
|
|
||||||
decoding="async"
|
|
||||||
onerror="this.hidden = true; this.nextElementSibling.hidden = false;"
|
|
||||||
/>
|
|
||||||
<span class="historical-weapon-stat-list__fallback" hidden>?</span>
|
|
||||||
</span>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveHistoricalWeapon(value) {
|
|
||||||
const runtimeWeaponIcons = globalThis.HLL_VIETNAM_CURRENT_MATCH_WEAPON_ICONS;
|
|
||||||
if (runtimeWeaponIcons?.lookup) {
|
|
||||||
const runtimeKey = runtimeWeaponIcons.normalize(value);
|
|
||||||
return runtimeWeaponIcons.lookup[runtimeKey] || {
|
|
||||||
label: String(value || runtimeWeaponIcons.unknown.label),
|
|
||||||
icon: runtimeWeaponIcons.unknown.icon,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
label: String(value || "Arma desconocida"),
|
|
||||||
icon: "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderDirectMatchupsSection(matchups) {
|
function renderDirectMatchupsSection(matchups) {
|
||||||
if (!matchups.length) {
|
if (!matchups.length) {
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -160,7 +160,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./assets/js/config.js"></script>
|
<script src="./assets/js/config.js"></script>
|
||||||
<script src="./assets/js/current-match-weapon-icons.js"></script>
|
|
||||||
<script src="./assets/js/historico-partida.js"></script>
|
<script src="./assets/js/historico-partida.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user