forked from raminhossaini/ramin-dough-calculator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
389 lines (317 loc) · 16.2 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!doctype html>
<head>
<?php
//Add analytics code here
include_once "gtag.txt";
?>
<meta name="author" content="Ramin Hossaini">
<meta name="description" content="A Pizza-dough calculator">
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="">
<!-- Bootstrap https://getbootstrap.com/docs/5.3/getting-started/introduction/ -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<!-- Jquery https://jquery.com/ -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- Flatpickr https://flatpickr.js.org/ -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<!-- dayJS https://day.js.org/en/ -->
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
<script>dayjs().format()</script>
<title>Ramin's Pizza-dough Calculator</title>
</head>
<body>
<div class="container">
<nav class="navbar bg-primary mb-3" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="/dough-calculator/">Ramin's Pizza-dough Calculator</a>
<span class="navbar-text"><a class="nav-link active" href="https://github.com/raminhossaini/ramin-dough-calculator/commits/main">Version 1.0.230902</a></span>
</span>
</div>
</nav>
<!-- <span>
<span class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="toggleTime" checked>
<label class="form-check-label" for="toggleTime"><i class="bi bi-clock" alttext="Toggle time controls"></i></label>
</span>
-->
<!-- DateTime Picker -->
<div class="row g-3 align-items-center timeModule">
<div class="col-auto">
<div class="input-group mb-3">
<span class="input-group-text">Planned Date to Eat</span>
<input type="text" id="inputDate" class="form-control" aria-label="" value="<?=date("Y-m-d");?>">
<span class="input-group-text"><i class='bi bi-calendar-week'></i></span>
</div>
</div>
<div class="col-auto">
<div class="input-group mb-3">
<span class="input-group-text">Time</i></span>
<input type="text" id="inputTime" class="form-control" aria-label="" value="<?=date("H")+25;?>">
<span class="input-group-text"><i class='bi bi-clock'></i></span>
</div>
</div>
</div>
<div class="row g-3 align-items-center">
<!-- Portions -->
<div class="col-auto">
<div class="input-group mb-3">
<span class="input-group-text">Portions</span>
<input type="text" id="inputPortions" class="form-control" aria-label="" value="2">
<span class="input-group-text">number of balls</span>
</div>
</div>
<!-- Portion size -->
<div class="col-auto">
<div class="input-group mb-3">
<span class="input-group-text">Portion Size</span>
<input type="text" id="inputPortionSize" class="form-control" aria-label="" value="260">
<span class="input-group-text">g</span>
</div>
</div>
<!-- Hydration -->
<div class="col-auto">
<div class="input-group mb-3">
<span class="input-group-text">Hydration</span>
<input type="text" id="inputHydration" class="form-control" aria-label="" value="70">
<span class="input-group-text">%</span>
</div>
</div>
<div class="row">
<div class="col">
<div class="alert alert-warning" id="portion-warning" role="alert">
The poolish amount of 300:300 is ideal for portions up to 12. For more portions, I recommend splitting the recipe in 2 or more!
</div>
</div>
</div> <!-- row -->
<div class="row">
<h2 class="">Final Result:</h2>
<!-- Total Dough Weight -->
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputTotalDoughWeight" class="form-control" value="" aria-describedby="" disabled readonly>
<label for="inputTotalDoughWeight" class="col-form-label">Total Dough Weight (g)</label>
</form>
</div>
<!-- Total Flour Weight -->
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputFlour" class="form-control" value="" aria-describedby="" disabled readonly>
<label for="inputFlour">Total Flour Weight (g)</label>
</form>
</div>
<!-- Total Water -->
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputWater" class="form-control" value="" aria-describedby="" disabled readonly>
<label for="inputWater">Total Water (g)</label>
</form>
</div>
<!-- Total Salt -->
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputSalt" class="form-control" value="" aria-describedby="" disabled readonly>
<label for="inputSalt">Total Salt (g)</label>
</form>
</div>
</div> <!-- row -->
<div class="row">
<h2 class="gy-5">Step 1 - Make the poolish:</h2>
<p class="timeModule" id="labelDateTimeToStart"></p>
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputPoolishFlour" class="form-control" value="100" aria-describedby="" disabled readonly>
<label for="inputPoolishFlour">Flour (g)</label>
</form>
</div>
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputPoolishWater" class="form-control" value="100" aria-describedby="" disabled readonly>
<label for="inputPoolishWater">Water (g)</label>
</form>
</div>
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputPoolishYeast" class="form-control" value="3" aria-describedby="" disabled readonly>
<label for="inputPoolishYeast">Instant Yeast (g)</label>
</form>
</div>
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputPoolishHoney" class="form-control" value="6" aria-describedby="" disabled readonly>
<label for="inputPoolishHoney">Honey (g)</label>
</form>
</div>
</div> <!-- row -->
<div class="row gy-1">
<div class="col">
<ul class="list-group">
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="poolish-step1">
<label class="form-check-label stretched-link" for="poolish-step1">Mix and let sit for 1 hour at room temperature.</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="poolish-step2">
<label class="form-check-label stretched-link" for="poolish-step2">Refrigerate for 16-24 hrs (until the time below, depending on when you started)</label>
</li>
</ul>
</div>
</div>
<div class="row">
<h2 class="gy-5">Step 2 - Final Mix:</h2>
<p class="timeModule" id="labelStep2DateTime"></p>
<ul class="list-group">
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="step2">
<label class="form-check-label stretched-link" for="step2">Add the following to your fermented poolish, and continue to the final steps</label>
</li>
</ul>
</div>
<div class="row gy-1">
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputRemainingFlour" class="form-control" value="194" aria-describedby="" disabled readonly>
<label for="inputRemainingFlour">Flour (g)</label>
</form>
</div>
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputRemainingWater" class="form-control" value="106" aria-describedby="" disabled readonly>
<label for="inputRemainingWater">Water (g)</label>
</form>
</div>
<div class="col-auto">
<form class="form-floating font-monospace">
<input type="text" id="inputRemainingSalt" class="form-control" value="9" aria-describedby="" disabled readonly>
<label for="inputRemainingSalt">Salt (g)</label>
</form>
</div>
</div> <!-- row -->
<div class="row">
<h2 class="gy-5">Final Steps:</h2>
<div class="col">
<ul class="list-group">
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step1">
<label class="form-check-label stretched-link" for="final-step1">Mix all together by hand or mixer</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step2">
<label class="form-check-label stretched-link" for="final-step2">Cover and let rest for 20-30 minutes (autolyse)</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step3">
<label class="form-check-label stretched-link" for="final-step3">Knead dough and form into ball. Don't worry if dough is still sticky at this stage.</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step4">
<label class="form-check-label stretched-link" for="final-step4"><p>Cover and let rest another 15-20 minutes.</p> <p>Dough will be easier to work with after this period.</p> <p>Dough should be smooth on the surface, bounce back when poked, and pass the windowpane test.</p></label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step5">
<label class="form-check-label stretched-link" for="final-step5">Split by portion weight and form into balls</label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step6">
<label class="form-check-label stretched-link" for="final-step6"><p>Place on tray and cover with cling-film or cover container with lid.</p> <p>Let rest 1 - 2 hours until dough doubles in size.</p> <p>This could vary depending on your room temperature.</p></label>
</li>
<li class="list-group-item">
<input class="form-check-input me-1" type="checkbox" value="" id="final-step7">
<label class="form-check-label stretched-link" for="final-step7">Form pizza bases and bake!</label>
</li>
</ul>
</div>
</div>
<nav class="navbar navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="https://www.ramin-hossaini.com/2022/06/poolish-pizza-dough-calculator/">Made in good faith by Ramin Hossaini</a>
<span class="navbar-text"><a href="https://www.ramin-hossaini.com/contact/">Contact</a></span>
</div>
</nav>
</div> <!-- container -->
<script>
function refresh_data() {
var portionSize = parseInt($("#inputPortionSize").val());
var portions = parseInt($("#inputPortions").val());
var hydration = parseInt($("#inputHydration").val());
var totalDoughWeight = Math.round( portions * portionSize ); //Dough weight is PORTIONS * PORTION-SIZE
var flourWeight = Math.round( totalDoughWeight / ((hydration/100)+1) ); //Flour weight is TOTAL-DOUGH-WEIGHT / ((HYDRATION / 100) + 1)
var waterWeight = Math.round((hydration / 100) * flourWeight); //Water is HYDRATION /100 * flourWeight
var saltWeight = Math.round( 0.03 * flourWeight); //Salt is 3% of Flour weight
// Time calculations. Working backwards from time to eat
var dateTimeString = $("#inputDate").val() + " " + $("#inputTime").val();
var eatDateTime = dayjs(dateTimeString);
//work backwards
// The last steps should be started 2-3 hours before the eating time
var step2DateTime = dayjs(eatDateTime).subtract(2, 'hour');
var step2StartTime = dayjs(step2DateTime).format("ddd, DD-MMM-YYYY HH:mm");
var step2EarliestDateTime = dayjs(eatDateTime).subtract(3, 'hour');
var step2EarliestStartTime = dayjs(step2EarliestDateTime).format("ddd, DD-MMM-YYYY HH:mm");
$("#labelStep2DateTime").html("<i class='bi bi-clock'></i> Recommended time to start: <b>" + step2EarliestStartTime + "</b> and <b>" + step2StartTime + "</b>");
//Next step is to calculate the 16 + 1 hour ferment
var latestStartDateTime = dayjs(eatDateTime).subtract(17+3, 'hour').format("ddd, DD-MMM-YYYY HH:mm");
//And lastly the longest ferment of 24 + 1 hours
var earliestStartDateTime = dayjs(eatDateTime).subtract(25+3, 'hour').format("ddd, DD-MMM-YYYY HH:mm");
//set date & time to start
$("#labelDateTimeToStart").html("<i class='bi bi-clock'></i> Recommended time to start: Between <b>" + earliestStartDateTime + "</b> and <b>" + latestStartDateTime + "</b>");
//Show a warning if making more than 12 portions
if (portions > 12) {
$("#portion-warning").show();
}
else {
$("#portion-warning").hide();
}
$("#inputTotalDoughWeight").val(totalDoughWeight);
$("#inputFlour").val(flourWeight);
$("#inputWater").val(waterWeight);
$("#inputSalt").val(saltWeight);
if (waterWeight < 401) {
$("#inputPoolishFlour").val("100");
$("#inputPoolishWater").val("100");
$("#inputPoolishYeast").val("3");
$("#inputPoolishHoney").val("2");
}
else if (waterWeight > 400 && waterWeight < 2501) {
$("#inputPoolishFlour").val("300");
$("#inputPoolishWater").val("300");
$("#inputPoolishYeast").val("6");
$("#inputPoolishHoney").val("6");
}
var poolishFlourWeight = parseInt($("#inputPoolishFlour").val());
var poolishWaterWeight = parseInt($("#inputPoolishWater").val());
var poolishYeastWeight = parseInt($("#inputPoolishYeast").val());
var remainingFlour = Math.round( flourWeight - poolishFlourWeight );
var remainingWater = Math.round( waterWeight - poolishWaterWeight );
var remainingSalt = Math.round( saltWeight );
$("#inputRemainingFlour").val(remainingFlour);
$("#inputRemainingWater").val(remainingWater);
$("#inputRemainingSalt").val(remainingSalt);
}
//Refresh when key is pressed
$( "input" ).keyup(function() {
refresh_data();
});
$( "input" ).change(function() {
refresh_data();
});
$("#toggleTime").click(function () {
$(".timeModule").toggle();
});
//Initial refresh of numbers when page loads
$( document ).ready(function() {
$("#inputDate").flatpickr({
minDate: "today"
});
$("#inputTime").flatpickr({
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
time_24hr: true
});
refresh_data();
});
</script>
</body>
</html>