wip: color resource rates red when draining, green when gaining, dim at zero
This commit is contained in:
10
game.js
10
game.js
@@ -1849,11 +1849,17 @@ function renderResources() {
|
||||
const el = document.getElementById(id);
|
||||
if (el) {
|
||||
el.textContent = fmt(val);
|
||||
// Show full spelled-out number on hover for educational value
|
||||
// Show full spelled-out number on hover for educational reference
|
||||
el.title = val >= 1000 ? spellf(Math.floor(val)) : '';
|
||||
}
|
||||
const rEl = document.getElementById(id + '-rate');
|
||||
if (rEl) rEl.textContent = (rate >= 0 ? '+' : '') + fmt(rate) + '/s';
|
||||
if (rEl) {
|
||||
rEl.textContent = (rate >= 0 ? '+' : '') + fmt(rate) + '/s';
|
||||
// Red when draining, green when gaining, dim when zero
|
||||
if (rate < 0) rEl.style.color = '#f44336';
|
||||
else if (rate > 0) rEl.style.color = '#4caf50';
|
||||
else rEl.style.color = '#555';
|
||||
}
|
||||
};
|
||||
|
||||
set('r-code', G.code, G.codeRate);
|
||||
|
||||
Reference in New Issue
Block a user