From 47c295ec1006c962dd9202f345b36b69a396b910 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 25 Jul 2026 16:01:17 +0000 Subject: [PATCH] Limit dough ball weight range to 150-400g --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 605c3ad..8a3470b 100644 --- a/index.html +++ b/index.html @@ -346,7 +346,7 @@ footer b{color:var(--txt)}
@@ -608,11 +608,14 @@ const DEFAULT = { bake:null }; let S = Object.assign({}, DEFAULT); +const BALL_MIN = 150; +const BALL_MAX = 400; /* ============================================================ RECHENKERN ============================================================ */ const clamp = (x,a,b)=>Math.min(b,Math.max(a,x)); +const clampBall = x => clamp(Number.isFinite(+x) ? +x : DEFAULT.ball, BALL_MIN, BALL_MAX); const rate = T => Math.pow(2.5,(T-20)/10); // Q10 = 2.5 /* Eine Garephase mit Temperaturwechsel. tc = Stunden, bis der Teigkern @@ -853,7 +856,7 @@ function initUI(){ }); chips($("styles"), STYLES, "style", k=>{ const st=STYLES[k]; - S.ball=st.ball; S.hyd=st.hyd; S.salt=st.salt; S.oil=st.oil; S.sugar=st.sugar; S.mode=st.mode; + S.ball=clampBall(st.ball); S.hyd=st.hyd; S.salt=st.salt; S.oil=st.oil; S.sugar=st.sugar; S.mode=st.mode; if (S.uxMode==="simple") S.mode="w"; }); chips($("modes"), MODES, "mode"); @@ -902,6 +905,7 @@ function initUI(){ function syncInputs(){ document.body.dataset.ux = S.uxMode; + S.ball = clampBall(S.ball); if (S.uxMode==="simple" && S.mode!=="w") S.mode="w"; RANGES.forEach(id=>{ $(id).value=S[id]; }); $("ballsOut").textContent=S.balls; @@ -1107,6 +1111,7 @@ function readHash(){ }); if (!STYLES[S.style]) S.style="napo"; if (!UX_MODES[S.uxMode]) S.uxMode="simple"; + S.ball = clampBall(S.ball); if (!PLANS[S.plan]) S.plan="free"; if (p.has("method")){ // alte Links: method=room|cold S.seq = p.get("method")==="room" ? "room" : "warmcold";