fix: simplify burden meter to pure inline styles

This commit is contained in:
Erik 2026-03-13 19:52:49 +01:00
parent bb89aaa6bc
commit a6e941eb01
2 changed files with 12 additions and 66 deletions

View file

@ -1384,27 +1384,16 @@ function renderInventoryState(state) {
const burdenDisplay = Math.floor(burdenPct); const burdenDisplay = Math.floor(burdenPct);
state.burdenLabel.textContent = `${burdenDisplay}%`; state.burdenLabel.textContent = `${burdenDisplay}%`;
state.burdenLabel.title = burdenUnits > 0 && encumbranceCapacity > 0 state.burdenLabel.title = burdenUnits > 0 && encumbranceCapacity > 0
? `${burdenUnits}/${encumbranceCapacity}` ? `${burdenUnits.toLocaleString()} / ${encumbranceCapacity.toLocaleString()}`
: ''; : '';
state.burdenLabel.style.color = '#ffffff'; // Fill height: map 0-200% burden onto 0-100% bar height
state.burdenLabel.style.zIndex = '3'; state.burdenFill.style.height = `${burdenPct / 2}%`;
state.burdenFill.style.height = `${Math.min(100, burdenPct)}%`; // Color by threshold
state.burdenFill.style.minHeight = burdenPct > 0 ? '3px' : '0';
state.burdenFill.className = 'inv-burden-fill';
state.burdenFill.style.backgroundColor = burdenPct > 150 state.burdenFill.style.backgroundColor = burdenPct > 150
? '#b7432c' ? '#b7432c'
: burdenPct > 100 : burdenPct > 100
? '#d8a431' ? '#d8a431'
: '#2e8b57'; : '#2e8b57';
state.burdenFill.style.opacity = '1';
state.burdenFill.style.borderTop = '1px solid rgba(255,255,255,0.18)';
if (burdenPct > 150) {
state.burdenFill.classList.add('is-danger');
} else if (burdenPct > 100) {
state.burdenFill.classList.add('is-warning');
} else {
state.burdenFill.classList.add('is-safe');
}
// 4. Sort containers for stable sidebar order (by unsigned item_id) // 4. Sort containers for stable sidebar order (by unsigned item_id)
containers.sort((a, b) => { containers.sort((a, b) => {

View file

@ -819,56 +819,32 @@ body.noselect, body.noselect * {
} }
.inv-burden-bar { .inv-burden-bar {
width: 16px; width: 14px;
height: 40px; height: 40px;
background: #060606; background: #111;
border: 1px solid var(--ac-border-light); border: 1px solid var(--ac-border-light);
position: relative; position: relative;
overflow: visible; overflow: hidden;
margin-bottom: 2px; margin-bottom: 2px;
margin-top: 12px;
flex-shrink: 0; flex-shrink: 0;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
} }
.inv-burden-fill { .inv-burden-fill {
width: 100%; width: 100%;
background: var(--ac-green);
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
height: 0%; height: 0%;
transition: height 0.3s ease; transition: height 0.3s ease, background-color 0.3s ease;
z-index: 1;
display: block;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.inv-burden-fill.is-safe {
background: var(--ac-green) !important;
}
.inv-burden-fill.is-warning {
background: #d8a431 !important;
}
.inv-burden-fill.is-danger {
background: #b7432c !important;
} }
.inv-burden-label { .inv-burden-label {
position: relative;
top: 0;
width: 60px;
left: 50%;
transform: translateX(-50%);
text-align: center; text-align: center;
font-size: 11px; font-size: 9px;
color: var(--ac-gold); color: #ccc;
z-index: 2; white-space: nowrap;
margin-top: 4px; margin-bottom: 2px;
margin-bottom: 4px;
} }
.inv-pack-list { .inv-pack-list {
@ -2415,26 +2391,7 @@ table.ts-allegiance td:first-child {
display: block; display: block;
} }
.inv-burden-bar {
width: 14px !important;
height: 40px !important;
margin-top: 20px !important;
}
.inv-burden-label {
position: relative !important;
top: 0 !important;
width: 60px !important;
left: 50% !important;
transform: translateX(-50%) !important;
text-align: center !important;
font-size: 9px !important;
color: #fff !important;
font-weight: normal !important;
line-height: 1.1 !important;
margin-top: 0 !important;
margin-bottom: 4px !important;
}
.inventory-count { .inventory-count {
display: block !important; display: block !important;