-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
328 lines (312 loc) · 16.4 KB
/
Copy pathindex.html
File metadata and controls
328 lines (312 loc) · 16.4 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>Protocol Tracker</title>
<meta name="description" content="Your personal Coimbra Protocol companion. Your data stays on this device." />
<meta name="theme-color" content="#F4F0E6" />
<link rel="manifest" href="./manifest.webmanifest" />
<link rel="apple-touch-icon" href="./icons/apple-touch-icon-180.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="Protocol" />
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<!-- ============ LOCK (setup / unlock) ============ -->
<div id="lock" class="lock" hidden>
<div class="lockbox">
<div class="lock-logo">🩺</div>
<h1>Protocol Tracker</h1>
<p id="lock-sub" class="lock-sub"></p>
<input id="lock-pass" type="password" placeholder="Passphrase" autocomplete="current-password" />
<input id="lock-pass2" type="password" placeholder="Confirm passphrase" autocomplete="new-password" hidden />
<button id="lock-btn"></button>
<button id="lock-passkey" class="linkbtn" type="button" hidden>🔓 Unlock with Face ID / passkey</button>
<p id="lock-msg" class="lock-msg"></p>
<p id="lock-note" class="lock-note" hidden>🔒 Your records are encrypted on this device with this passphrase. There is <strong>no way to recover it</strong> if you forget it — so keep an encrypted backup.</p>
<button id="lock-back" class="linkbtn" type="button">← Back</button>
</div>
</div>
<!-- ============ HOME / LANDING ============ -->
<div id="home" class="screen hero" hidden>
<div class="hero-inner">
<div class="hero-logo">🩺</div>
<h1>Protocol Tracker</h1>
<p class="hero-tag">Your personal Coimbra Protocol companion — plan your day, take each supplement at the right time.</p>
<button id="home-login" class="big">Log in</button>
<p class="hero-note">🔒 Everything stays encrypted on <em>this device</em>. Nothing is sent anywhere.</p>
</div>
</div>
<!-- ============ ONBOARDING 1 — PROFILE ============ -->
<div id="onboard-profile" class="screen" hidden>
<main class="wrap">
<div class="steps"><span class="dot on"></span><span class="dot"></span><span class="lbl">Step 1 of 2 · About you</span></div>
<section class="card">
<h2>A few basics</h2>
<p class="hint">Just enough to make the app yours. This never leaves your device, and you can change it anytime.</p>
<label for="p-name">Your name</label>
<input id="p-name" placeholder="e.g. the patient" autocomplete="off" />
<div class="row">
<div style="flex:2">
<label for="p-weight">Weight <span class="opt">(optional)</span></label>
<input id="p-weight" type="number" inputmode="decimal" min="0" placeholder="e.g. 68" />
</div>
<div style="flex:1">
<label for="p-weight-unit">Unit</label>
<select id="p-weight-unit"><option value="kg">kg</option><option value="lb">lb</option></select>
</div>
</div>
<p class="hint">Vitamin D dosing on the protocol is often per‑kg — handy to have, but your doctor sets the dose, not the app.</p>
<label for="p-condition">Condition</label>
<select id="p-condition">
<option value="Multiple Sclerosis">Multiple Sclerosis</option>
<option value="Rheumatoid Arthritis">Rheumatoid Arthritis</option>
<option value="Psoriasis / Psoriatic Arthritis">Psoriasis / Psoriatic Arthritis</option>
<option value="Hashimoto's Thyroiditis">Hashimoto's Thyroiditis</option>
<option value="Crohn's / Colitis">Crohn's / Colitis</option>
<option value="Lupus (SLE)">Lupus (SLE)</option>
<option value="Vitiligo">Vitiligo</option>
<option value="Other autoimmune">Other autoimmune</option>
<option value="__custom">Something else…</option>
</select>
<input id="p-condition-custom" placeholder="Type your condition" hidden style="margin-top:8px" />
<label for="p-bedtime">Usual bedtime <span class="opt">(optional — just for a gentle late-start heads-up; never blocks you)</span></label>
<input id="p-bedtime" type="time" value="22:00" />
<div class="actions">
<button id="p-continue">Continue →</button>
</div>
</section>
</main>
</div>
<!-- ============ ONBOARDING 2 — SUPPLEMENTS ============ -->
<div id="onboard-supps" class="screen" hidden>
<main class="wrap">
<div class="steps"><span class="dot done"></span><span class="dot on"></span><span class="lbl">Step 2 of 2 · Your supplements</span></div>
<section class="card">
<h2>What do you take?</h2>
<p class="hint">Add each supplement <em>you</em> take, the way your doctor prescribed it. We don't suggest doses — you're in charge. Pick when you take it and we'll line up your day.</p>
<div id="supp-list" class="supp-list"></div>
<button id="supp-add-toggle" class="ghost full">+ Add a supplement</button>
</section>
<section id="supp-editor" class="card" hidden>
<h2 id="supp-editor-title">Add a supplement</h2>
<label for="supp-pick">Supplement</label>
<select id="supp-pick"></select>
<input id="supp-custom-name" placeholder="Supplement name" hidden style="margin-top:8px" />
<div id="supp-role" class="rolehint"></div>
<div class="row">
<div style="flex:2">
<label for="supp-form">Form</label>
<select id="supp-form"></select>
</div>
</div>
<div class="row">
<div style="flex:2">
<label for="supp-dose">Dose <span id="supp-unit" class="opt"></span></label>
<input id="supp-dose" type="number" inputmode="decimal" min="0" placeholder="amount" list="supp-dose-list" />
<datalist id="supp-dose-list"></datalist>
</div>
<div style="flex:1">
<label for="supp-doseunit">Unit</label>
<input id="supp-doseunit" placeholder="mg" />
</div>
</div>
<label>When do you take it? <span class="opt">(tap all that apply)</span></label>
<div id="supp-dayparts" class="chips"></div>
<div id="supp-hint" class="timinghint"></div>
<div class="actions">
<button id="supp-save">Add to my list</button>
<button id="supp-cancel" class="ghost">Cancel</button>
</div>
</section>
<div class="wrap" style="padding:0 0 24px">
<button id="supps-done" class="big" disabled>Go to my dashboard →</button>
<p class="hint" style="text-align:center">You can add, edit or remove supplements anytime.</p>
</div>
</main>
</div>
<!-- ============ DASHBOARD ============ -->
<div id="dashboard" class="screen" hidden>
<header>
<div class="wrap" style="padding:0">
<div class="head-row">
<h1>🩺 <span id="dash-greet">Today</span></h1>
<div class="btn-group">
<button id="dash-history" class="ghost mini" title="History">📅</button>
<button id="dash-lock" class="ghost mini">🔒 Lock</button>
</div>
</div>
<div class="badge"><span id="dash-date"></span> · <span id="dash-progress"></span></div>
</div>
</header>
<main class="wrap">
<section class="card">
<div class="dash-head">
<h2 style="margin:0" id="plan-title">Your day</h2>
<button id="dash-reset" class="linkbtn" type="button" title="Start the day over" hidden>↺ Reset day</button>
</div>
<div id="day-start" hidden>
<button id="day-start-btn" class="big">▶ Start my day</button>
<p class="hint" id="day-start-sub"></p>
<p id="day-bedtime-hint" class="bedtime-hint" hidden></p>
<div id="day-preview"></div>
</div>
<div id="progress-wrap" hidden><div id="progress-bar"><div id="progress-fill"></div></div></div>
<div id="day-plan"></div>
</section>
<section class="card" id="card-water">
<div class="dash-head">
<h2 style="margin:0">💧 Water</h2>
<span id="water-total" class="water-total"></span>
</div>
<div id="water-bar"><div id="water-fill"></div></div>
<div class="water-btns">
<button id="water-250" class="ghost">+250 ml</button>
<button id="water-500" class="ghost">+500 ml</button>
<button id="water-undo" class="linkbtn" type="button">undo</button>
</div>
</section>
<section class="card" id="card-symptom">
<div class="dash-head">
<h2 style="margin:0">How you feel</h2>
<button id="symptom-add" class="ghost mini">+ Log</button>
</div>
<div id="symptom-editor" hidden>
<label for="sym-label">Symptom</label>
<input id="sym-label" list="sym-suggest" placeholder="e.g. Fatigue, Tingling, Pain" autocomplete="off" />
<datalist id="sym-suggest">
<option value="Fatigue"></option><option value="Numbness / tingling"></option><option value="Pain"></option>
<option value="Spasticity"></option><option value="Muscle weakness"></option><option value="Balance / coordination"></option>
<option value="Vision"></option><option value="Brain fog"></option><option value="Bladder"></option>
<option value="Dizziness"></option><option value="Mood"></option><option value="Heat sensitivity"></option>
</datalist>
<label for="sym-sev">Severity: <span id="sym-sev-val">5</span>/10</label>
<input id="sym-sev" type="range" min="1" max="10" value="5" />
<label for="sym-note">Note <span class="opt">(optional)</span></label>
<input id="sym-note" placeholder="anything worth remembering" autocomplete="off" />
<div class="actions">
<button id="sym-save">Save</button>
<button id="sym-cancel" class="ghost">Cancel</button>
</div>
</div>
<div id="symptom-list"></div>
</section>
<section class="card" id="card-meal">
<div class="dash-head">
<h2 style="margin:0">🍽️ Meals</h2>
<button id="meal-add" class="ghost mini">+ Log</button>
</div>
<div id="meal-editor" hidden>
<label>Meal</label>
<div id="meal-kind" class="chips">
<button type="button" class="chip on" data-kind="Breakfast">Breakfast</button>
<button type="button" class="chip" data-kind="Lunch">Lunch</button>
<button type="button" class="chip" data-kind="Dinner">Dinner</button>
<button type="button" class="chip" data-kind="Snack">Snack</button>
</div>
<label for="meal-note">What / notes <span class="opt">(optional)</span></label>
<input id="meal-note" placeholder="e.g. oatmeal — no dairy" autocomplete="off" />
<div class="actions">
<button id="meal-save">Save</button>
<button id="meal-cancel" class="ghost">Cancel</button>
</div>
</div>
<div id="meal-list"></div>
</section>
<details class="card safety">
<summary>Protocol reminders</summary>
<div id="safety-list" style="margin-top:12px"></div>
<div id="safety-src" class="src-foot"></div>
</details>
<details class="card refs">
<summary>📖 Sources & references</summary>
<p class="hint" style="margin-top:12px">The app doesn't give medical advice — it surfaces facts from these Coimbra Protocol materials. Your protocol doctor's instructions always come first.</p>
<div id="refs-list" class="refs-list"></div>
<p id="refs-foot" class="refs-foot"></p>
</details>
<details class="card">
<summary>⚙️ Manage</summary>
<div class="manage">
<button id="go-edit-supps" class="ghost full">Edit my supplements</button>
<button id="go-edit-profile" class="ghost full">Edit my details</button>
<div id="ios-install-hint" hidden>
<hr class="sep" />
<h3 class="mini-h">Get dose reminders on iPhone</h3>
<p class="hint">Safari only delivers reminders once Protocol Tracker is on your Home Screen. Tap the <b>Share</b> icon, choose <b>Add to Home Screen</b>, then open the app from its new icon — the reminder switch will appear here.</p>
</div>
<div id="reminders-wrap" hidden>
<hr class="sep" />
<h3 class="mini-h">Dose reminders</h3>
<p class="hint">A gentle push notification at each dose time. The reminder is generic — no supplement names or health details ever leave your device.</p>
<button id="reminders-toggle" class="ghost full">🔔 Enable reminders</button>
<button id="reminders-test" class="ghost full" hidden>🔊 Test the reminder sound</button>
</div>
<div id="passkey-wrap" hidden>
<hr class="sep" />
<h3 class="mini-h">Face ID / passkey unlock</h3>
<p class="hint">Unlock with your device’s Face ID, Touch ID, or PIN instead of typing your passphrase. Your passphrase still works, and nothing new leaves this device.</p>
<div id="passkey-setup">
<label for="pk-pass">Confirm your passphrase to enable</label>
<input id="pk-pass" type="password" autocomplete="current-password" placeholder="passphrase" />
<button id="passkey-enable" class="ghost full">🔓 Enable Face ID / passkey unlock</button>
</div>
<p id="passkey-on" class="hint" hidden>✅ Face ID / passkey unlock is on. <button id="passkey-remove" class="linkbtn" type="button">Remove</button></p>
</div>
<hr class="sep" />
<h3 class="mini-h">Encrypted backup</h3>
<p class="hint">Save an encrypted copy you control, and restore it on any device with the passphrase. Nothing touches a server.</p>
<label for="f-pass">Backup passphrase (6+ chars)</label>
<input id="f-pass" type="password" placeholder="passphrase" autocomplete="new-password" />
<div class="actions">
<button id="export-btn">Export backup</button>
<label class="ghost filelabel" for="restore-input">Restore</label>
<input id="restore-input" type="file" accept=".ptbackup,application/json" hidden />
</div>
<p class="hint">PBKDF2‑SHA256 (200k) → AES‑GCM‑256, all in your browser.</p>
<p class="hint" style="text-align:center;margin-top:14px">Protocol Tracker <span id="app-version">·</span></p>
<div class="actions"><button id="update-btn" class="ghost">Check for update</button></div>
</div>
</details>
<p class="disclaimer" id="disclaimer"></p>
</main>
</div>
<!-- ============ HISTORY / CALENDAR ============ -->
<div id="history" class="screen" hidden>
<header>
<div class="wrap" style="padding:0">
<div class="head-row">
<h1>📅 History</h1>
<button id="hist-back" class="ghost mini">← Back</button>
</div>
<div class="badge">Tap any day for the full log</div>
</div>
</header>
<main class="wrap">
<div id="hist-cal-view">
<div class="cal-nav">
<button id="cal-prev" class="ghost mini" title="Previous month">‹</button>
<span id="cal-month"></span>
<button id="cal-next" class="ghost mini" title="Next month">›</button>
</div>
<div class="cal-dow"><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span><span>Sun</span></div>
<div id="cal-grid"></div>
<div class="cal-legend">
<span><i class="lg d-full"></i>all doses</span>
<span><i class="lg d-part"></i>partial</span>
<span><i class="lg sym"></i>symptom</span>
</div>
</div>
<div id="hist-day-view" hidden>
<button id="day-back" class="ghost mini">‹ Calendar</button>
<h2 id="day-title"></h2>
<div id="day-detail"></div>
</div>
</main>
</div>
<div id="toast" class="toast"></div>
<script src="./cap-notify.js"></script>
<script src="./app.js"></script>
</body>
</html>