-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
445 lines (420 loc) · 17.6 KB
/
index.html
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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<html lang="fi">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/main.css">
<style>
</style>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/lodash.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="http://goessner.net/download/prj/jsonxml/xml2json.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
</script>
<script src="js/app.js"></script>
<style>
.numeric, .right {
text-align: right;
}
.col-md-2 input {
width: 50%;
}
.col-md-4 input {
width: 23%;
}
.col-md-6 input {
width: 25%;
}
div span {
line-height: 29px;
}
.right {
text-align: right;
}
.editable {
color: red;
}
.optional {
color: green;
}
.automatic {
font-weight: bold;
box-shadow: none !important;
}
.grain {
background-color: #eee;
}
.mash {
background-color: #ddd;
}
.boil {
background-color: #eee;
}
.fermenting {
background-color: #ddd;
}
.bottling {
background-color: #eee;
}
.stats {
background-color: #ddd;
}
input {
background-color: transparent;
}
</style>
</head>
<body ng-app="app">
<div ng-controller="beerCtrl">
<div class="" id="main-content">
<div class="container">
<div class="card">
<div class="card-image bg-primary">
<span class="card-title">Brew</span>
</div>
<div class="card-content">
<div class="row">
<div class="right col-md-6 ">
</div>
<div class=" col-md-2">
</div>
</div>
<div class="row">
<div class="right col-md-10 col-md-offset-1">
<table class="table table-striped table-condensed cf">
<thead class="cf">
<tr>
<th>Type</th>
<th>Amount</th>
<th>%</th>
<th>Potential</th>
<th>Colour</th>
<th>Diastatic power</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="grain in recipe.grains">
<td class="right">
<select ng-options="thisGrain.F_G_NAME + ' (' +thisGrain.F_G_ORIGIN + ')' for thisGrain in grainList|orderBy: 'F_G_NAME'" ng-model="grain.grainObj" ng-change="grainChange(grain)">
</select>
</td>
<td class="right"><input type="text" ng-model="grain.weight" ng-change="recalculateRecipe();" size="6" class="right" > kg</td>
<td class="right">{{ grain.weightPercentage }} %</td>
<td class="right">{{ grain.potential }}</td>
<td class="right">{{ grain.colour }} EBC</td>
<td class="right">{{ grain.diastatic }} °L</td>
</tr>
</tbody>
<tfoot>
<tr>
<th></th>
<th class="right">{{ recipe.grainWeight}} kg</th>
<th></th>
<th class="right">{{ recipe.grainPotential}}</th>
<th class="right" id="colour">{{ recipe.colour}} EBC</th>
<th class="right">{{ recipe.grainDiastatic}} °L
<span ng-show="recipe.grainDiastatic>40">, good</span>
<span ng-show="recipe.grainDiastatic<40">, too low!</span></th>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-4">
<label><input type="radio" ng-model="recipe.calculationType" value="plan">Plan your recipe (calculates gravities)</label><br>
<label><input type="radio" ng-model="recipe.calculationType" value="brew">Brew it! (calculates volumes etc)</label>
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Mash water volume:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric editable" numeric ng-model="recipe.mashVol"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric editable" ng-model="recipe.temp.mashVol"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Mash volume required:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.mashVolRequired"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric optional" ng-model="recipe.temp.maxMashTemp"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Mash thickness:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.mashThickness"
ng-change="recalculateRecipe()"> l/kg
</div>
<div>
<span ng-show="recipe.mashThickness<2.5">(thick)</span>
<span ng-show="recipe.mashThickness>=2.5 && recipe.mashThickness<=3.5">(medium)</span>
<span ng-show="recipe.mashThickness>3.5 && recipe.mashThickness<=4.5">(thin)</span>
<span ng-show="recipe.mashThickness>4.5">(very thin)</span>
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Sparge water volume:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric editable" ng-model="recipe.spargeVol"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric editable" ng-model="recipe.temp.spargeVol"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Weight of used grain:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric" ng-model="recipe.usedGrainWeight"
ng-class="{editable: recipe.calculationType=='brew', automatic: recipe.calculationType!='brew'}"
ng-change="recalculateRecipe()"> kg
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Grain absorption:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.grainAbsorption"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]{1,3}" class="numeric " ng-model="recipe.grainAbsorptionPercentage"
ng-class="{editable: recipe.calculationType!='brew', automatic: recipe.calculationType=='brew'}"
ng-change="recalculateRecipe()"> l/kg
</div>
<div class=" col-md-4">
<input type="text" pattern="[0-9]{1,3}" class="numeric optional" ng-model="recipe.endOfRunningSG"
ng-change="recalculateRecipe()"> SG @ 16°C (End of running)
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Wort volume into kettle:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.wortVol"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric optional" ng-model="recipe.temp.wortVol"
ng-change="recalculateRecipe()"> °C
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]{1,3}" class="numeric "
ng-class="{editable: recipe.calculationType=='brew', automatic: recipe.calculationType!='brew'}"
ng-model="recipe.wortVolSG"
ng-change="recalculateRecipe()"> SG @ 16°C
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Mash efficiency:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric " ng-model="recipe.mashEfficiency"
ng-class="{editable: recipe.calculationType!='brew', automatic: recipe.calculationType=='brew'}"
ng-change="recalculateRecipe()"> %
</div>
</div>
<div class="row mash">
<div class="right col-md-6 ">
<label>
Sugars extracted/in grain/unextracted:
</label>
<input type="text" pattern="[0-9]{1,3}" class="numeric automatic" ng-model="recipe.sugarsExtracted"
ng-change="recalculateRecipe()"> kg
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]{1,3}" class="numeric automatic" ng-model="recipe.sugarsLeft"
ng-change="recalculateRecipe()"> kg
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]{1,3}" class="numeric automatic" ng-model="recipe.sugarsUnextracted"
ng-change="recalculateRecipe()"> kg
</div>
</div>
<div class="row boil">
<div class="right col-md-6 ">
<label>
Kettle top up:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric" ng-model="recipe.kettleTopUp"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric" ng-model="recipe.temp.kettleTopUp"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row boil">
<div class="right col-md-6 ">
<label>
Volume before boil:
</label><input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.volBefBoil"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric" ng-model="recipe.temp.volBefBoil"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row boil">
<div class="right col-md-6 ">
<label>
Evaporation rate: </label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.evaporationRate"
ng-class="{editable: recipe.calculationType!='brew', automatic: recipe.calculationType=='brew'}"
ng-change="recalculateRecipe()"> %/h
</div>
<div class=" col-md-2">
x <input type="text" pattern="[0-9]{1,3}" class="numeric editable" ng-model="recipe.boilTime"
ng-change="recalculateRecipe()"> min
</div>
</div>
<div class="row boil">
<div class="right col-md-6 ">
<label>
Volume at end of boil:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.volAfterBoil"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric optional" ng-model="recipe.temp.volAfterBoil"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row fermenting">
<div class="right col-md-6 ">
<label>
Into fermenter:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.intoFermenter"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric optional" ng-model="recipe.temp.intoFermenter"
ng-change="recalculateRecipe()"> °C
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]{1,3}" class="numeric " ng-model="recipe.intoFermenterSG"
ng-class="{editable: recipe.calculationType=='brew', automatic: recipe.calculationType!='brew'}"
ng-change="recalculateRecipe()"> OG @ 16°C
</div>
</div>
<div class="row bottling">
<div class="right col-md-6 ">
<label>
Bottling/fermentator loss:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric editable" ng-model="recipe.bottlingLoss"
ng-change="recalculateRecipe()"> l
</div>
</div>
<div class="row bottling">
<div class="right col-md-6 ">
<label>
Carbonation (sugar solution) volume:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric editable" ng-model="recipe.carbonationVol"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric editable" ng-model="recipe.temp.carbonationVol"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row bottling">
<div class="right col-md-6 ">
<label>
Bottling volume:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.bottlingVol"
ng-change="recalculateRecipe()"> l
</div>
<div class=" col-md-2">
@ <input type="text" pattern="[0-9]{1,3}" class="numeric editable" ng-model="recipe.temp.bottlingVol"
ng-change="recalculateRecipe()"> °C
</div>
</div>
<div class="row bottling">
<div class="right col-md-6 ">
<label>
Final gravity:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric " ng-model="recipe.finalGravity"
ng-class="{editable: recipe.calculationType=='brew', automatic: recipe.calculationType!='brew'}"
ng-change="recalculateRecipe()"> FG
</div>
</div>
<div class="row stats">
<div class="right col-md-6 ">
<label>
Apparent & real attenuation:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric " ng-model="recipe.apparentAttenuation"
ng-class="{editable: recipe.calculationType!='brew', automatic: recipe.calculationType=='brew'}"
ng-change="recalculateRecipe()"> %
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.realAttenuation"
ng-change="recalculateRecipe()"> %
</div>
</div>
<div class="row stats">
<div class="right col-md-6 ">
<label>
Alcohol & calories:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.abv"
ng-change="recalculateRecipe()"> %
</div>
<div class=" col-md-2">
<input type="text" pattern="[0-9]{1,3}" class="numeric automatic" ng-model="recipe.calories"
ng-change="recalculateRecipe()"> kCal/100g
</div>
</div>
<div class="row stats">
<div class="right col-md-6 ">
<label>
Remaining sugars:
</label>
<input type="text" pattern="[0-9]+.[0-9]{2}" class="numeric automatic" ng-model="recipe.remainingSugars"
ng-change="recalculateRecipe()"> g/dl
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
</div>
</body>