Uncap ROI display — shows over 100%, labels switch to pure profit past breakeven
This commit is contained in:
+11
-5
@@ -1346,7 +1346,7 @@
|
||||
<input type="number" id="roiDeposits" placeholder="e.g. 450" step="10" min="0">
|
||||
</div>
|
||||
<div class="roi-field">
|
||||
<label>Total Earned All Time</label>
|
||||
<label>Total Earnings (all-time, incl. pending)</label>
|
||||
<input type="number" id="roiTotalEarned" placeholder="e.g. 371.33" step="0.01" min="0">
|
||||
</div>
|
||||
<div class="roi-field">
|
||||
@@ -2152,15 +2152,17 @@ function updateROI() {
|
||||
l7x3: { cycles: 999, profitPer: 2520.00, nextLabel: null, needsCapital: 0 },
|
||||
};
|
||||
|
||||
// ROI stats
|
||||
const roiPct = deposits > 0 ? Math.min((earned / deposits) * 100, 100) : 0;
|
||||
// ROI stats — no cap, show over 100% when earned > deposited
|
||||
const roiPct = deposits > 0 ? (earned / deposits) * 100 : 0;
|
||||
const recouped = Math.min(earned, deposits);
|
||||
const remaining = Math.max(deposits - earned, 0);
|
||||
|
||||
document.getElementById('roiStatROI').querySelector('.roi-stat-value').textContent = roiPct.toFixed(1) + '%';
|
||||
document.getElementById('roiStatRecouped').querySelector('.roi-stat-value').textContent = '$' + recouped.toFixed(2);
|
||||
document.getElementById('roiStatRemaining').querySelector('.roi-stat-value').textContent = '$' + remaining.toFixed(2);
|
||||
document.getElementById('roiBarROI').style.width = roiPct + '%';
|
||||
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) + '%';
|
||||
// Update label to reflect profit mode
|
||||
document.getElementById('roiStatRemaining').querySelector('.roi-stat-label').textContent = remaining > 0 ? 'To Breakeven' : 'Pure Profit';
|
||||
|
||||
// Phase progress
|
||||
const pd = PHASE_DATA[phase];
|
||||
@@ -2219,6 +2221,10 @@ function updateROI() {
|
||||
{ icon: '🔘', label: '75% ROI Recouped', sub: '$337.50', earned: earned >= 337.50 },
|
||||
{ icon: '💰', label: '100% ROI — Breakeven', sub: `$${deposits.toFixed(2)}`, earned: earned >= deposits },
|
||||
];
|
||||
// Add over-100% profit milestone if they're past breakeven
|
||||
if (roiPct > 100) {
|
||||
allMilestones.push({ icon: '📈', label: `Profit: ${(roiPct - 100).toFixed(1)}% Beyond Breakeven`, sub: `+$${(earned - deposits).toFixed(2)} pure profit`, earned: true });
|
||||
}
|
||||
|
||||
if (phase === 'l7x3') {
|
||||
allMilestones.push({ icon: '🏆', label: '3× L7 Endgame Reached', sub: '$2,520/cycle passive', earned: true });
|
||||
|
||||
Reference in New Issue
Block a user