show cap message when down_pct hits start capital limit

This commit is contained in:
Johannes
2026-03-20 02:42:26 +01:00
parent f4e6c4101b
commit db4a25ece9
3 changed files with 13 additions and 2 deletions

2
ui.js
View File

@@ -304,10 +304,12 @@ const clamp_down_pct = () => {
const slider = document.getElementById('down_pct_slider');
const num = document.getElementById('down_pct');
const at_cap = +num.value >= max_pct - 0.05;
if (+num.value > max_pct) {
num.value = Math.round(max_pct * 10) / 10;
slider.value = num.value;
}
document.getElementById('down_pct_cap').classList.toggle('visible', at_cap);
};
// ===== Slider ↔ number sync =====