ROI turns green (#22c55e) when it hits 100%+ breakeven
This commit is contained in:
@@ -2159,6 +2159,13 @@ function updateROI() {
|
||||
const remaining = Math.max(deposits - earned, 0);
|
||||
|
||||
document.getElementById('roiStatROI').querySelector('.roi-stat-value').textContent = roiPct.toFixed(1) + '%';
|
||||
// Green when past breakeven
|
||||
const roiEl = document.getElementById('roiStatROI').querySelector('.roi-stat-value');
|
||||
if (roiPct >= 100) {
|
||||
roiEl.style.color = '#22c55e';
|
||||
} else {
|
||||
roiEl.style.color = '';
|
||||
}
|
||||
document.getElementById('roiStatRecouped').querySelector('.roi-stat-value').textContent = '$' + recouped.toFixed(2);
|
||||
document.getElementById('roiStatRemaining').querySelector('.roi-stat-value').textContent = remaining > 0 ? '$' + remaining.toFixed(2) : '+$' + Math.abs(remaining).toFixed(2);
|
||||
document.getElementById('roiBarROI').style.width = Math.min(roiPct, 100) + '%';
|
||||
|
||||
Reference in New Issue
Block a user