Limit dough ball weight range to 150-400g
This commit is contained in:
+7
-2
@@ -346,7 +346,7 @@ footer b{color:var(--txt)}
|
|||||||
<div id="modeW">
|
<div id="modeW">
|
||||||
<label class="ctl">
|
<label class="ctl">
|
||||||
<div class="ctl-top"><span class="ctl-l">Gewicht pro Teigling</span><span class="ctl-v" id="v-ball"></span></div>
|
<div class="ctl-top"><span class="ctl-l">Gewicht pro Teigling</span><span class="ctl-v" id="v-ball"></span></div>
|
||||||
<input type="range" id="ball" min="120" max="1200" step="5">
|
<input type="range" id="ball" min="150" max="400" step="5">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -608,11 +608,14 @@ const DEFAULT = {
|
|||||||
bake:null
|
bake:null
|
||||||
};
|
};
|
||||||
let S = Object.assign({}, DEFAULT);
|
let S = Object.assign({}, DEFAULT);
|
||||||
|
const BALL_MIN = 150;
|
||||||
|
const BALL_MAX = 400;
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
RECHENKERN
|
RECHENKERN
|
||||||
============================================================ */
|
============================================================ */
|
||||||
const clamp = (x,a,b)=>Math.min(b,Math.max(a,x));
|
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
|
const rate = T => Math.pow(2.5,(T-20)/10); // Q10 = 2.5
|
||||||
|
|
||||||
/* Eine Garephase mit Temperaturwechsel. tc = Stunden, bis der Teigkern
|
/* Eine Garephase mit Temperaturwechsel. tc = Stunden, bis der Teigkern
|
||||||
@@ -853,7 +856,7 @@ function initUI(){
|
|||||||
});
|
});
|
||||||
chips($("styles"), STYLES, "style", k=>{
|
chips($("styles"), STYLES, "style", k=>{
|
||||||
const st=STYLES[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";
|
if (S.uxMode==="simple") S.mode="w";
|
||||||
});
|
});
|
||||||
chips($("modes"), MODES, "mode");
|
chips($("modes"), MODES, "mode");
|
||||||
@@ -902,6 +905,7 @@ function initUI(){
|
|||||||
|
|
||||||
function syncInputs(){
|
function syncInputs(){
|
||||||
document.body.dataset.ux = S.uxMode;
|
document.body.dataset.ux = S.uxMode;
|
||||||
|
S.ball = clampBall(S.ball);
|
||||||
if (S.uxMode==="simple" && S.mode!=="w") S.mode="w";
|
if (S.uxMode==="simple" && S.mode!=="w") S.mode="w";
|
||||||
RANGES.forEach(id=>{ $(id).value=S[id]; });
|
RANGES.forEach(id=>{ $(id).value=S[id]; });
|
||||||
$("ballsOut").textContent=S.balls;
|
$("ballsOut").textContent=S.balls;
|
||||||
@@ -1107,6 +1111,7 @@ function readHash(){
|
|||||||
});
|
});
|
||||||
if (!STYLES[S.style]) S.style="napo";
|
if (!STYLES[S.style]) S.style="napo";
|
||||||
if (!UX_MODES[S.uxMode]) S.uxMode="simple";
|
if (!UX_MODES[S.uxMode]) S.uxMode="simple";
|
||||||
|
S.ball = clampBall(S.ball);
|
||||||
if (!PLANS[S.plan]) S.plan="free";
|
if (!PLANS[S.plan]) S.plan="free";
|
||||||
if (p.has("method")){ // alte Links: method=room|cold
|
if (p.has("method")){ // alte Links: method=room|cold
|
||||||
S.seq = p.get("method")==="room" ? "room" : "warmcold";
|
S.seq = p.get("method")==="room" ? "room" : "warmcold";
|
||||||
|
|||||||
Reference in New Issue
Block a user