-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexDE.html
296 lines (254 loc) · 15.2 KB
/
indexDE.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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Berechne den Nutri Score selbst"/>
<meta name="keywords" content="Nutri Score, Ernährung, Score, berechnen, rechnen"/>
<title>Nutri Score Rechner</title>
<meta name="theme-color" content="#323232">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="manifest.json">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#00587a">
<meta name="msapplication-TileColor" content="#00587a">
<meta name="theme-color" content="#ffffff">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,700;1,600&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="normalize.css">
<link rel="stylesheet" href="main.css">
<script src="https://unpkg.com/html5-qrcode"></script>
<script src="scoreCalculator.js"></script>
<script src="controls.js"></script>
<script src="scanner.js"></script>
<script src="nutriAPI.js"></script>
</head>
<body>
<header>
<h1 class="h1">Nutri Score Rechner</h1>
</header>
<main>
<nav>
<ul>
<li class="nav__item active" data-form="normal">🍲</li>
<li class="nav__item" data-form="cheese">🧀</li>
<li class="nav__item" data-form="water">💦</li>
<li>
<div class="language__switch">
<label for="lang"><a href="indexDE.html">DE</a></label>
<label class="switch">
<input type="checkbox" id="lang" class="de" onclick="changeLanguage()">
<span class="switcher"></span>
</label>
<label for="lang"><a href="index.html">EN</a></label>
</div>
</li>
</ul>
</nav>
<div class="calculator__wrapper">
<form action="" class="active form--normal" onsubmit="calculateScoreNormal(event)">
<h2 class="h2">Negative Komponenten</h2>
<label for="kj">Energie <span class="small">(KJ/100g)</span></label>
<input type="number" class="component__N" id="kj" name="kj" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="fat">Gesättigte Fettsäuren <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="fat" name="fat" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="sugar">Zucker <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="sugar" name="sugar" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="salt">Salz <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="salt" name="salt" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="1,00"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<hr>
<h2 class="h2">Positive Komponenten</h2>
<label for="extras">Obst, Gemüse, Hülsenfrüchte, Schalenfrüchte, Raps-, Nuss- und Olivenöle <span
class="small">(%)</span></label>
<input type="number" class="component__P" id="extras" name="extras" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0" max="80"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<label for="fibres">Ballaststoffe <span class="small">(g/100g)</span></label>
<input type="number" class="component__P" id="fibres" name="fibres" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<label for="proteins">Eiweiß <span class="small">(g/100g)</span></label>
<input type="number" class="component__P" id="proteins" name="proteins" required
pattern="[0-9]+([\.,][0-9]+)?" step="0.01"
title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<button>berechnen</button>
</form>
<form action="" class="form--cheese" onsubmit="calculateScoreCheese(event)">
<h2 class="h2">Negative Komponenten</h2>
<label for="kj__cheese">Energie <span class="small">(KJ/100g)</span></label>
<input type="number" class="component__N" id="kj__cheese" name="kj" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="fat__cheese">Gesättigte Fettsäuren <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="fat__cheese" name="fat" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="sugar__cheese">Zucker <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="sugar__cheese" name="sugar" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="salt__cheese">Selz <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="salt__cheese" name="salt" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="1,00"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<hr>
<h2 class="h2">Positive Komponenten</h2>
<label for="extras__cheese">Obst, Gemüse, Hülsenfrüchte, Schalenfrüchte, Raps-, Nuss- und Olivenöle <span
class="small">(%)</span></label>
<input type="number" class="component__P" id="extras__cheese" name="extras" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0" max="80"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<label for="fibres__cheese">Ballaststoffe <span class="small">(g/100g)</span></label>
<input type="number" class="component__P" id="fibres__cheese" name="fibres" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<label for="proteins__cheese">Eiweiß <span class="small">(g/100g)</span></label>
<input type="number" class="component__P" id="proteins__cheese" name="proteins" required
pattern="[0-9]+([\.,][0-9]+)?" step="0.01"
title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<button>berechnen</button>
</form>
<form action="" class="form--water" onsubmit="calculateScoreLiquid(event)">
<p>Für Wasser bleibt der Score immer bei A</p>
<h2 class="h2">Negative Komponenten</h2>
<label for="kj__water">Energie <span class="small">(KJ/100g)</span></label>
<input type="number" class="component__N water" id="kj__water" name="kj" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="fat__water">Gesättigte Fettsäuren <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="fat__water" name="fat" required pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="sugar__water">Zucker <span class="small">(g/100g)</span></label>
<input type="number" class="component__N water" id="sugar__water" name="sugar" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<label for="salt__water">Salz <span class="small">(g/100g)</span></label>
<input type="number" class="component__N" id="salt__water" name="salt" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="1,00"><span
class="point__container"><span
class="reachedPoints">0</span>/10</span><br>
<hr>
<h2 class="h2">Positive Components</h2>
<label for="extras__water">Obst, Gemüse, Hülsenfrüchte, Schalenfrüchte, Raps-, Nuss- und Olivenöle <span
class="small">(%)</span></label>
<input type="number" class="component__P water" id="extras__water" name="extras" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.1" title="This should be a number with up to 1 decimal places." min="0" max="80"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<label for="fibres__water">Ballaststoffe <span class="small">(g/100g)</span></label>
<input type="number" class="component__P" id="fibres__water" name="fibres" required
pattern="[0-9]+([\.,][0-9]+)?"
step="0.01" title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<label for="proteins__water">Eiweiß <span class="small">(g/100g)</span></label>
<input type="number" class="component__P" id="proteins__water" name="proteins" required
pattern="[0-9]+([\.,][0-9]+)?" step="0.01"
title="This should be a number with up to 2 decimal places." min="0" max="100"><span
class="point__container"><span
class="reachedPoints">0</span>/5</span><br>
<button>calculate</button>
</form>
<button type="button" class="button open" onclick="openForm(); initScanner();">
<img src="barcode-scanner.png" alt="scanner opener">
</button>
<div class="scan-popup" id="myForm">
<h1>Scanner</h1>
<div id="qr-reader" style="width:300px"></div>
<div id="qr-reader-results"></div>
<button type="button" class="button cancel" onclick="closeForm()">schließen</button>
</div>
<div id="chevron"></div>
<div id="resultPoints"></div>
<div id="resultScore"></div>
<label for="myRange">Score: </label>
<div class="slidecontainer">
<input type="range" min="-15" max="40" value="-15" class="slider" id="myRange" disabled>
<div class="container">
<div class="score a">A</div>
<div class="score b">B</div>
<div class="score c">C</div>
<div class="score d">D</div>
<div class="score e">E</div>
</div>
</div>
</div>
</main>
<footer class="footer">
<p>
Alle Informationen basieren auf den Informationen vom <a
href="https://www.bmel.de/DE/themen/ernaehrung/lebensmittel-kennzeichnung/freiwillige-angaben-und-label/nutri-score/naehrwertkennzeichnung-hilfestellungen.html"
lang="de">Bundesministerium
für Ernährung und Landwirtschaft</a>
</p>
<h3>Links: </h3>
<ul>
<li>
<a href="https://www.bmel.de/SharedDocs/Downloads/DE/_Ernaehrung/Lebensmittel-Kennzeichnung/markensatzung.pdf?__blob=publicationFile&v=3"
lang="de">Markensatzung</a>
</li>
<li>
<a href="https://www.bmel.de/SharedDocs/Downloads/DE/_Ernaehrung/Lebensmittel-Kennzeichnung/nutri-score-dt-excel-berechnungstabelle.xlsx?__blob=publicationFile&v=3"
lang="de">Excel
file for calculation</a></li>
<li>
<a href="https://www.flaticon.com/free-icons/barcode" title="barcode icons">Barcode icons created by DinosoftLabs - Flaticon</a>
</li>
<li>
<a href="https://openfoodfacts.github.io/api-documentation/" title="Food API">Nutrition/Food API</a>
</li>
</ul>
</footer>
<script src="upup.js"></script>
<script>
UpUp.start({
'content-url': 'offline.html',
'assets': [
'main.css', 'normalize.css', 'scoreCalculator.js', 'controls.js', 'scanner.js', 'nutriAPI.js',
'https://unpkg.com/html5-qrcode',
'https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,700;1,600&display=swap',
],
'service-worker-url': 'upup.sw.js'
});
</script>
</body>
</html>