-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
269 lines (252 loc) · 8.27 KB
/
Copy pathindex.html
File metadata and controls
269 lines (252 loc) · 8.27 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Calorie Tracker Dashboard</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="ambient-shape ambient-shape-1"></div>
<div class="ambient-shape ambient-shape-2"></div>
<main class="app-shell">
<header class="hero">
<p class="eyebrow">Health Planning Web App</p>
<h1>Calorie Tracker</h1>
<p class="hero-copy">
Calculate your daily calorie target, track meals, and compare your real weight trend against your ideal plan.
</p>
</header>
<nav class="section-tabs" id="sectionTabs" role="tablist" aria-label="Tracker sections">
<button
id="tab-calculator"
class="tab-button is-active"
type="button"
role="tab"
aria-selected="true"
aria-controls="panel-calculator"
data-panel-target="calculator"
>
Calculator
</button>
<button
id="tab-food"
class="tab-button"
type="button"
role="tab"
aria-selected="false"
aria-controls="panel-food"
data-panel-target="food"
>
Food Log
</button>
<button
id="tab-weight"
class="tab-button"
type="button"
role="tab"
aria-selected="false"
aria-controls="panel-weight"
data-panel-target="weight"
>
Weight Dashboard
</button>
</nav>
<section class="summary-strip">
<article class="summary-pill">
<span>Target kcal</span>
<strong id="stripTargetKcal">-</strong>
</article>
<article class="summary-pill">
<span>Today eaten</span>
<strong id="stripTodayKcal">0</strong>
</article>
<article class="summary-pill">
<span>Latest weight</span>
<strong id="stripLatestWeight">-</strong>
</article>
</section>
<div class="panel-stack">
<section
class="card panel is-active"
id="panel-calculator"
data-panel="calculator"
role="tabpanel"
aria-labelledby="tab-calculator"
>
<h2>Daily Calorie Calculator</h2>
<p class="section-copy">
Uses the Mifflin-St Jeor formula for BMR, then adjusts for activity and goal.
</p>
<form id="calculatorForm" class="form-grid">
<label>
Age
<input id="age" name="age" type="number" min="10" max="100" required />
</label>
<label>
Sex
<select id="sex" name="sex">
<option value="female">Female</option>
<option value="male">Male</option>
</select>
</label>
<label>
Height (cm)
<input id="heightCm" name="heightCm" type="number" min="100" max="250" required />
</label>
<label>
Weight (kg)
<input id="weightKg" name="weightKg" type="number" min="30" max="300" step="0.1" required />
</label>
<label>
Activity Level
<select id="activityLevel" name="activityLevel">
<option value="sedentary">Sedentary</option>
<option value="light">Lightly Active</option>
<option value="moderate">Moderately Active</option>
<option value="very">Very Active</option>
<option value="athlete">Athlete / Very High</option>
</select>
</label>
<label>
Goal
<select id="goal" name="goal">
<option value="lose">Lose Weight</option>
<option value="maintain">Maintain Weight</option>
<option value="gain">Gain Weight</option>
</select>
</label>
<label>
Speed (kg/week)
<select id="paceKgPerWeek" name="paceKgPerWeek">
<option value="0.25">0.25 kg / week</option>
<option value="0.5" selected>0.5 kg / week</option>
<option value="0.75">0.75 kg / week</option>
<option value="1.0">1.0 kg / week</option>
</select>
</label>
<button type="submit" class="btn-primary">Calculate Target</button>
</form>
<div id="calorieResults" class="results-grid" aria-live="polite"></div>
<p id="calculatorNote" class="note"></p>
</section>
<section
class="card panel"
id="panel-food"
data-panel="food"
role="tabpanel"
aria-labelledby="tab-food"
hidden
>
<h2>Food Intake Tracker</h2>
<p class="section-copy">
Add daily food entries and monitor your calorie budget against the calculated target.
</p>
<form id="foodEntryForm" class="inline-form">
<label>
Date
<input id="foodDate" name="foodDate" type="date" required />
</label>
<label>
Food / Meal
<input id="foodName" name="foodName" type="text" maxlength="100" placeholder="Chicken salad" required />
</label>
<label>
Calories
<input id="foodCalories" name="foodCalories" type="number" min="1" max="5000" required />
</label>
<button type="submit" class="btn-secondary">Add Entry</button>
</form>
<div class="totals-row">
<article class="stat-chip">
<span>Calories today</span>
<strong id="dayTotal">0</strong>
</article>
<article class="stat-chip">
<span>Target</span>
<strong id="dayTarget">-</strong>
</article>
<article class="stat-chip">
<span>Remaining</span>
<strong id="dayRemaining">-</strong>
</article>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Date</th>
<th>Food</th>
<th>Calories</th>
<th>Action</th>
</tr>
</thead>
<tbody id="foodTableBody"></tbody>
</table>
</div>
</section>
<section
class="card panel"
id="panel-weight"
data-panel="weight"
role="tabpanel"
aria-labelledby="tab-weight"
hidden
>
<h2>Weight Dashboard</h2>
<p class="section-copy">
Log your weight and compare your real trend with the ideal line to your target.
</p>
<form id="weightPlanForm" class="inline-form plan-form">
<label>
Target weight (kg)
<input id="targetWeightKg" name="targetWeightKg" type="number" min="30" max="300" step="0.1" required />
</label>
<label>
Target date
<input id="targetDate" name="targetDate" type="date" required />
</label>
<button type="submit" class="btn-secondary">Save Ideal Line</button>
</form>
<form id="weightEntryForm" class="inline-form">
<label>
Entry date
<input id="weightDate" name="weightDate" type="date" required />
</label>
<label>
Weight (kg)
<input id="weightValueKg" name="weightValueKg" type="number" min="30" max="300" step="0.1" required />
</label>
<button type="submit" class="btn-secondary">Log Weight</button>
</form>
<div class="chart-wrap">
<canvas id="weightChart" aria-label="Weight trend versus ideal line"></canvas>
</div>
<div class="legend">
<span><i class="legend-line legend-real"></i>Real Weight</span>
<span><i class="legend-line legend-ideal"></i>Ideal Weight</span>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Date</th>
<th>Weight (kg)</th>
<th>Action</th>
</tr>
</thead>
<tbody id="weightTableBody"></tbody>
</table>
</div>
</section>
</div>
<footer class="footer-note">
For planning and education only. Speak with a healthcare professional for medical advice.
</footer>
</main>
<script src="script.js"></script>
</body>
</html>