-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
300 lines (277 loc) · 11 KB
/
index.html
File metadata and controls
300 lines (277 loc) · 11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Track your daily walking activity with Steps Tracker - a beautiful, offline-first step tracking app">
<meta name="theme-color" content="#6366f1">
<title>Steps Tracker</title>
<link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>👟</text></svg>">
<link rel="stylesheet" href="css/theme.css?v=9">
<link rel="stylesheet" href="css/base.css?v=9">
<link rel="stylesheet" href="css/layout.css?v=9">
<link rel="stylesheet" href="css/components.css?v=9">
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
</head>
<body>
<div class="bg-animation"></div>
<div class="app">
<!-- Sidebar Navigation -->
<aside class="sidebar">
<div class="sidebar-header">
<div class="logo">
<span class="logo-emoji">👟</span>
<span class="logo-text">Steps Tracker</span>
</div>
</div>
<ul class="nav-list">
<li class="nav-item active" data-route="/">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path
d="M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z" />
<path
d="M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z" />
<path d="M16 17h4" />
<path d="M4 13h4" />
</svg>
<span>Today</span>
</li>
<li class="nav-item" data-route="/history">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect width="18" height="18" x="3" y="4" rx="2" ry="2" />
<line x1="16" x2="16" y1="2" y2="6" />
<line x1="8" x2="8" y1="2" y2="6" />
<line x1="3" x2="21" y1="10" y2="10" />
</svg>
<span>History</span>
</li>
<li class="nav-item" data-route="/insights">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 3v18h18" />
<path d="m19 9-5 5-4-4-3 3" />
</svg>
<span>Insights</span>
</li>
<li class="nav-item" data-route="/records">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" x2="12" y1="20" y2="10" />
<line x1="18" x2="18" y1="20" y2="4" />
<line x1="6" x2="6" y1="20" y2="16" />
</svg>
<span>Records</span>
</li>
<li class="nav-item" data-route="/awards" id="nav-awards">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6" />
<path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18" />
<path d="M4 22h16" />
<path d="M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" />
<path d="M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" />
<path d="M18 2H6v7a6 6 0 0 0 12 0V2Z" />
</svg>
<span>Awards</span>
<span class="nav-badge" id="awards-badge"></span>
</li>
<li class="nav-item hidden" data-route="/leaderboard" id="nav-leaderboard">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 20V10" />
<path d="M12 20V4" />
<path d="M6 20v6" />
<rect x="18" y="10" width="4" height="10" rx="1" />
<rect x="2" y="13" width="4" height="7" rx="1" />
<rect x="10" y="6" width="4" height="14" rx="1" />
</svg>
<span>Leaderboard</span>
</li>
<li class="nav-item" data-route="/settings">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path
d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
<circle cx="12" cy="12" r="3" />
</svg>
<span>Settings</span>
</li>
</ul>
<div class="sidebar-footer">
<button class="btn btn-primary btn-block" id="fab-add">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14" />
<path d="M12 5v14" />
</svg>
Add Entry
</button>
</div>
</aside>
<!-- Main Content Area -->
<main class="main-content">
<!-- Today View -->
<section id="view-today" class="view active">
<header class="page-header">
<h1>Today</h1>
<span class="text-secondary" id="today-date"></span>
</header>
<div id="today-content">
<!-- Rendered by JS -->
</div>
</section>
<!-- History View -->
<section id="view-history" class="view">
<header class="page-header">
<h1>History</h1>
</header>
<div id="history-content">
<!-- Rendered by JS -->
</div>
</section>
<!-- Insights View -->
<section id="view-insights" class="view">
<header class="page-header">
<h1>Insights</h1>
</header>
<div id="insights-content">
<!-- Rendered by JS -->
</div>
</section>
<!-- Records View -->
<section id="view-records" class="view">
<header class="page-header">
<h1>Records</h1>
</header>
<div id="records-content">
<!-- Rendered by JS -->
</div>
</section>
<!-- Awards View -->
<section id="view-awards" class="view">
<header class="page-header">
<h1>Awards</h1>
</header>
<div id="awards-content">
<!-- Rendered by JS -->
</div>
</section>
<!-- Leaderboard View -->
<section id="view-leaderboard" class="view">
<header class="page-header">
<h1>Leaderboard <span class="spinner" id="leaderboard-spinner"
style="width: 16px; height: 16px; display: none;"></span></h1>
</header>
<div id="leaderboard-content">
<!-- Rendered by JS -->
</div>
</section>
<!-- Settings View -->
<section id="view-settings" class="view">
<header class="page-header">
<h1>Settings</h1>
</header>
<div id="settings-content">
<!-- Rendered by JS -->
</div>
</section>
</main>
<!-- Entry Modal -->
<div class="modal-overlay" id="entry-modal">
<div class="modal">
<header class="modal-header">
<h2 class="modal-title" id="entry-modal-title">Add Entry</h2>
<button class="modal-close" aria-label="Close modal">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</button>
</header>
<form id="entry-form">
<div class="modal-body">
<div class="form-group">
<label class="form-label">Date</label>
<div id="calendar-picker-container"></div>
<input type="hidden" id="entry-date" name="date" required>
</div>
<div class="form-group">
<label class="form-label" for="entry-steps">Steps</label>
<div class="number-input-wrapper">
<button type="button" class="number-input-btn" data-action="decrement"
data-target="entry-steps" data-step="1">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M5 12h14" />
</svg>
</button>
<input type="number" class="form-input" id="entry-steps" placeholder="0" min="0"
max="100000" required>
<button type="button" class="number-input-btn" data-action="increment"
data-target="entry-steps" data-step="1">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M5 12h14" />
<path d="M12 5v14" />
</svg>
</button>
</div>
</div>
<div class="form-group">
<label class="form-label" for="entry-time">Active Time (minutes)</label>
<div class="number-input-wrapper">
<button type="button" class="number-input-btn" data-action="decrement"
data-target="entry-time" data-step="1">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M5 12h14" />
</svg>
</button>
<input type="number" class="form-input" id="entry-time" placeholder="0" min="0"
max="1440">
<button type="button" class="number-input-btn" data-action="increment"
data-target="entry-time" data-step="1">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M5 12h14" />
<path d="M12 5v14" />
</svg>
</button>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger hidden" id="entry-delete-btn"
onclick="window.App.handle_entry_delete()">
Delete
</button>
<button type="submit" class="btn btn-primary">
Save Entry
</button>
</div>
</form>
</div>
</div>
</div>
<!-- App Script (bump version to bust cache) -->
<script type="module" src="js/app.js?v=9"></script>
<!-- Set today's date in header -->
<script>
document.getElementById("today-date").textContent = new Date().toLocaleDateString("en-US", {
weekday: "long",
month: "short",
day: "numeric"
});
</script>
</body>
</html>