-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (77 loc) · 2.57 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Food tracker</title>
</head>
<body>
<h1>Food tracker</h1>
<h2>Add food</h2>
<form id="add-food">
<div class="inputs">
<label for="food">Choose food:</label>
<select name="food" id="food">
<option value="pizza">Pizza</option>
<option value="pasta">Pasta</option>
<option value="burger">Burger</option>
<option value="soup">Soup</option>
<option value="salad">Salad</option>
<option value="apple">Apple</option>
<option value="peach">Peach</option>
<option value="cider">Cider</option>
</select>
</div>
<div class="inputs">
<label for="carbs">Carbs:</label>
<input
type="number"
id="carbs"
placeholder="0 g"
min="0"
step="1"
required
/>
</div>
<div class="inputs">
<label for="protein">Protein:</label>
<input
type="number"
id="protein"
placeholder="0 g"
min="0"
step="1"
required
/>
</div>
<div class="inputs">
<label for="fat">Fat:</label>
<input
type="number"
id="fat"
placeholder="0 g"
min="0"
step="1"
required
/>
</div>
<button type="submit">Add</button>
</form>
<h2>Stats</h2>
<div class="chart">
<canvas id="stats-chart" width="700" height="300"></canvas>
</div>
<h2>Log</h2>
<div class="total-calories">
<p>Total calories logged: <span id="calories-sum"></span> kcal</p>
</div>
<div id="stat-grid"></div>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/chart.js"
></script>
<script type="module" src="main.js"></script>
</body>
</html>