Add 1 files
Browse files- index.html +1109 -44
index.html
CHANGED
@@ -1,47 +1,1112 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
<
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"
|
6 |
-
<
|
|
|
7 |
<style>
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Taskly - Smart To-Do List</title>
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
8 |
<style>
|
9 |
+
:root {
|
10 |
+
--primary-color: #5e72e4;
|
11 |
+
--primary-dark: #3f51b5;
|
12 |
+
--accent-color: #ff4081;
|
13 |
+
--text-primary: #2d3748;
|
14 |
+
--text-secondary: #4a5568;
|
15 |
+
--bg-color: #f8f9fa;
|
16 |
+
--card-bg: #ffffff;
|
17 |
+
--border-color: #e2e8f0;
|
18 |
+
--success-color: #48bb78;
|
19 |
+
--warning-color: #ed8936;
|
20 |
+
--danger-color: #f56565;
|
21 |
+
--low-priority: #4299e1;
|
22 |
+
--medium-priority: #ed8936;
|
23 |
+
--high-priority: #f56565;
|
24 |
+
}
|
25 |
+
|
26 |
+
[data-theme="dark"] {
|
27 |
+
--primary-color: #667eea;
|
28 |
+
--primary-dark: #5a67d8;
|
29 |
+
--text-primary: #f7fafc;
|
30 |
+
--text-secondary: #cbd5e0;
|
31 |
+
--bg-color: #1a202c;
|
32 |
+
--card-bg: #2d3748;
|
33 |
+
--border-color: #4a5568;
|
34 |
+
}
|
35 |
+
|
36 |
+
* {
|
37 |
+
margin: 0;
|
38 |
+
padding: 0;
|
39 |
+
box-sizing: border-box;
|
40 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
41 |
+
}
|
42 |
+
|
43 |
+
body {
|
44 |
+
background-color: var(--bg-color);
|
45 |
+
color: var(--text-primary);
|
46 |
+
transition: all 0.3s ease;
|
47 |
+
}
|
48 |
+
|
49 |
+
.container {
|
50 |
+
max-width: 100%;
|
51 |
+
width: 100%;
|
52 |
+
height: 100vh;
|
53 |
+
max-height: 100vh;
|
54 |
+
position: relative;
|
55 |
+
overflow: hidden;
|
56 |
+
display: flex;
|
57 |
+
flex-direction: column;
|
58 |
+
}
|
59 |
+
|
60 |
+
/* Header Styles */
|
61 |
+
header {
|
62 |
+
display: flex;
|
63 |
+
justify-content: space-between;
|
64 |
+
align-items: center;
|
65 |
+
padding: 1rem 1.5rem;
|
66 |
+
background-color: var(--primary-color);
|
67 |
+
color: white;
|
68 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
69 |
+
z-index: 100;
|
70 |
+
}
|
71 |
+
|
72 |
+
.logo {
|
73 |
+
display: flex;
|
74 |
+
align-items: center;
|
75 |
+
gap: 0.5rem;
|
76 |
+
font-weight: 700;
|
77 |
+
font-size: 1.2rem;
|
78 |
+
}
|
79 |
+
|
80 |
+
.logo i {
|
81 |
+
font-size: 1.4rem;
|
82 |
+
}
|
83 |
+
|
84 |
+
.header-actions {
|
85 |
+
display: flex;
|
86 |
+
gap: 1rem;
|
87 |
+
align-items: center;
|
88 |
+
}
|
89 |
+
|
90 |
+
.theme-toggle, .user-avatar {
|
91 |
+
width: 35px;
|
92 |
+
height: 35px;
|
93 |
+
border-radius: 50%;
|
94 |
+
display: flex;
|
95 |
+
align-items: center;
|
96 |
+
justify-content: center;
|
97 |
+
background-color: rgba(255, 255, 255, 0.2);
|
98 |
+
cursor: pointer;
|
99 |
+
border: none;
|
100 |
+
color: white;
|
101 |
+
font-size: 1rem;
|
102 |
+
}
|
103 |
+
|
104 |
+
.user-avatar {
|
105 |
+
background-color: white;
|
106 |
+
color: var(--primary-color);
|
107 |
+
font-weight: bold;
|
108 |
+
}
|
109 |
+
|
110 |
+
/* Main Content */
|
111 |
+
.main-content {
|
112 |
+
flex: 1;
|
113 |
+
padding: 1rem;
|
114 |
+
overflow-y: auto;
|
115 |
+
padding-bottom: 80px;
|
116 |
+
}
|
117 |
+
|
118 |
+
/* Date Section */
|
119 |
+
.date-section {
|
120 |
+
display: flex;
|
121 |
+
justify-content: space-between;
|
122 |
+
align-items: center;
|
123 |
+
margin-bottom: 1.5rem;
|
124 |
+
}
|
125 |
+
|
126 |
+
.current-date h2 {
|
127 |
+
font-size: 1.5rem;
|
128 |
+
font-weight: 600;
|
129 |
+
}
|
130 |
+
|
131 |
+
.current-date p {
|
132 |
+
color: var(--text-secondary);
|
133 |
+
font-size: 0.9rem;
|
134 |
+
}
|
135 |
+
|
136 |
+
.calendar-btn {
|
137 |
+
background-color: var(--card-bg);
|
138 |
+
border: 1px solid var(--border-color);
|
139 |
+
padding: 0.7rem;
|
140 |
+
border-radius: 12px;
|
141 |
+
display: flex;
|
142 |
+
align-items: center;
|
143 |
+
justify-content: center;
|
144 |
+
cursor: pointer;
|
145 |
+
}
|
146 |
+
|
147 |
+
/* Stats Section */
|
148 |
+
.stats-section {
|
149 |
+
display: flex;
|
150 |
+
gap: 1rem;
|
151 |
+
margin-bottom: 1.5rem;
|
152 |
+
}
|
153 |
+
|
154 |
+
.stat-card {
|
155 |
+
flex: 1;
|
156 |
+
background-color: var(--card-bg);
|
157 |
+
border-radius: 12px;
|
158 |
+
padding: 1rem;
|
159 |
+
display: flex;
|
160 |
+
flex-direction: column;
|
161 |
+
align-items: center;
|
162 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
|
163 |
+
}
|
164 |
+
|
165 |
+
.stat-icon {
|
166 |
+
width: 40px;
|
167 |
+
height: 40px;
|
168 |
+
border-radius: 12px;
|
169 |
+
display: flex;
|
170 |
+
align-items: center;
|
171 |
+
justify-content: center;
|
172 |
+
margin-bottom: 0.5rem;
|
173 |
+
}
|
174 |
+
|
175 |
+
.completed .stat-icon {
|
176 |
+
background-color: rgba(73, 187, 120, 0.1);
|
177 |
+
color: var(--success-color);
|
178 |
+
}
|
179 |
+
|
180 |
+
.pending .stat-icon {
|
181 |
+
background-color: rgba(237, 137, 54, 0.1);
|
182 |
+
color: var(--warning-color);
|
183 |
+
}
|
184 |
+
|
185 |
+
.overdue .stat-icon {
|
186 |
+
background-color: rgba(245, 101, 101, 0.1);
|
187 |
+
color: var(--danger-color);
|
188 |
+
}
|
189 |
+
|
190 |
+
.stat-card h3 {
|
191 |
+
font-size: 1.1rem;
|
192 |
+
font-weight: 600;
|
193 |
+
margin-bottom: 0.3rem;
|
194 |
+
text-align: center;
|
195 |
+
}
|
196 |
+
|
197 |
+
.stat-card p {
|
198 |
+
font-size: 0.8rem;
|
199 |
+
color: var(--text-secondary);
|
200 |
+
text-align: center;
|
201 |
+
}
|
202 |
+
|
203 |
+
/* Add Task Section */
|
204 |
+
.add-task-container {
|
205 |
+
position: fixed;
|
206 |
+
bottom: 80px;
|
207 |
+
left: 50%;
|
208 |
+
transform: translateX(-50%);
|
209 |
+
width: calc(100% - 2rem);
|
210 |
+
z-index: 50;
|
211 |
+
}
|
212 |
+
|
213 |
+
.add-task-btn {
|
214 |
+
width: 100%;
|
215 |
+
display: flex;
|
216 |
+
align-items: center;
|
217 |
+
justify-content: center;
|
218 |
+
gap: 0.5rem;
|
219 |
+
padding: 1rem;
|
220 |
+
background-color: var(--primary-color);
|
221 |
+
border: none;
|
222 |
+
border-radius: 12px;
|
223 |
+
color: white;
|
224 |
+
font-size: 1rem;
|
225 |
+
cursor: pointer;
|
226 |
+
box-shadow: 0 4px 12px rgba(94, 114, 228, 0.3);
|
227 |
+
font-weight: 600;
|
228 |
+
}
|
229 |
+
|
230 |
+
/* Task List */
|
231 |
+
.tasks-container {
|
232 |
+
margin-bottom: 1rem;
|
233 |
+
}
|
234 |
+
|
235 |
+
.section-header {
|
236 |
+
display: flex;
|
237 |
+
justify-content: space-between;
|
238 |
+
align-items: center;
|
239 |
+
margin-bottom: 1rem;
|
240 |
+
}
|
241 |
+
|
242 |
+
.section-header h3 {
|
243 |
+
font-size: 1.1rem;
|
244 |
+
font-weight: 600;
|
245 |
+
}
|
246 |
+
|
247 |
+
.section-header span {
|
248 |
+
background-color: var(--border-color);
|
249 |
+
color: var(--text-secondary);
|
250 |
+
padding: 0.2rem 0.5rem;
|
251 |
+
border-radius: 10px;
|
252 |
+
font-size: 0.8rem;
|
253 |
+
}
|
254 |
+
|
255 |
+
.task-list {
|
256 |
+
display: flex;
|
257 |
+
flex-direction: column;
|
258 |
+
gap: 0.8rem;
|
259 |
+
}
|
260 |
+
|
261 |
+
.task-item {
|
262 |
+
background-color: var(--card-bg);
|
263 |
+
border: 1px solid var(--border-color);
|
264 |
+
border-radius: 12px;
|
265 |
+
padding: 1rem;
|
266 |
+
display: flex;
|
267 |
+
align-items: center;
|
268 |
+
gap: 1rem;
|
269 |
+
transition: all 0.2s ease;
|
270 |
+
position: relative;
|
271 |
+
overflow: hidden;
|
272 |
+
}
|
273 |
+
|
274 |
+
.task-item:hover {
|
275 |
+
transform: translateY(-2px);
|
276 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
277 |
+
}
|
278 |
+
|
279 |
+
.task-checkbox {
|
280 |
+
width: 20px;
|
281 |
+
height: 20px;
|
282 |
+
border-radius: 6px;
|
283 |
+
border: 2px solid var(--border-color);
|
284 |
+
appearance: none;
|
285 |
+
cursor: pointer;
|
286 |
+
flex-shrink: 0;
|
287 |
+
display: flex;
|
288 |
+
align-items: center;
|
289 |
+
justify-content: center;
|
290 |
+
}
|
291 |
+
|
292 |
+
.task-checkbox:checked {
|
293 |
+
background-color: var(--primary-color);
|
294 |
+
border-color: var(--primary-color);
|
295 |
+
}
|
296 |
+
|
297 |
+
.task-checkbox:checked::after {
|
298 |
+
content: "\f00c";
|
299 |
+
font-family: "Font Awesome 6 Free";
|
300 |
+
font-weight: 900;
|
301 |
+
color: white;
|
302 |
+
font-size: 0.7rem;
|
303 |
+
}
|
304 |
+
|
305 |
+
.task-content {
|
306 |
+
flex: 1;
|
307 |
+
overflow: hidden;
|
308 |
+
}
|
309 |
+
|
310 |
+
.task-title {
|
311 |
+
font-weight: 600;
|
312 |
+
margin-bottom: 0.2rem;
|
313 |
+
position: relative;
|
314 |
+
}
|
315 |
+
|
316 |
+
.task-title.completed {
|
317 |
+
text-decoration: line-through;
|
318 |
+
color: var(--text-secondary);
|
319 |
+
}
|
320 |
+
|
321 |
+
.task-details {
|
322 |
+
display: flex;
|
323 |
+
align-items: center;
|
324 |
+
gap: 0.7rem;
|
325 |
+
margin-top: 0.4rem;
|
326 |
+
}
|
327 |
+
|
328 |
+
.task-detail {
|
329 |
+
display: flex;
|
330 |
+
align-items: center;
|
331 |
+
gap: 0.3rem;
|
332 |
+
font-size: 0.8rem;
|
333 |
+
color: var(--text-secondary);
|
334 |
+
}
|
335 |
+
|
336 |
+
.task-detail i {
|
337 |
+
font-size: 0.8rem;
|
338 |
+
}
|
339 |
+
|
340 |
+
.task-priority {
|
341 |
+
width: 10px;
|
342 |
+
height: 10px;
|
343 |
+
border-radius: 50%;
|
344 |
+
display: inline-block;
|
345 |
+
}
|
346 |
+
|
347 |
+
.priority-low {
|
348 |
+
background-color: var(--low-priority);
|
349 |
+
}
|
350 |
+
|
351 |
+
.priority-medium {
|
352 |
+
background-color: var(--medium-priority);
|
353 |
+
}
|
354 |
+
|
355 |
+
.priority-high {
|
356 |
+
background-color: var(--high-priority);
|
357 |
+
}
|
358 |
+
|
359 |
+
.task-actions {
|
360 |
+
display: flex;
|
361 |
+
gap: 0.5rem;
|
362 |
+
align-items: center;
|
363 |
+
}
|
364 |
+
|
365 |
+
.task-action-btn {
|
366 |
+
background: none;
|
367 |
+
border: none;
|
368 |
+
color: var(--text-secondary);
|
369 |
+
cursor: pointer;
|
370 |
+
font-size: 1rem;
|
371 |
+
transition: all 0.2s ease;
|
372 |
+
}
|
373 |
+
|
374 |
+
.task-action-btn:hover {
|
375 |
+
color: var(--primary-color);
|
376 |
+
}
|
377 |
+
|
378 |
+
/* Bottom Navigation */
|
379 |
+
.bottom-nav {
|
380 |
+
position: fixed;
|
381 |
+
bottom: 0;
|
382 |
+
left: 0;
|
383 |
+
right: 0;
|
384 |
+
background-color: var(--card-bg);
|
385 |
+
display: flex;
|
386 |
+
justify-content: space-around;
|
387 |
+
padding: 0.8rem 0;
|
388 |
+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
|
389 |
+
z-index: 100;
|
390 |
+
}
|
391 |
+
|
392 |
+
.nav-item {
|
393 |
+
display: flex;
|
394 |
+
flex-direction: column;
|
395 |
+
align-items: center;
|
396 |
+
gap: 0.2rem;
|
397 |
+
color: var(--text-secondary);
|
398 |
+
text-decoration: none;
|
399 |
+
font-size: 0.9rem;
|
400 |
+
}
|
401 |
+
|
402 |
+
.nav-item.active {
|
403 |
+
color: var(--primary-color);
|
404 |
+
}
|
405 |
+
|
406 |
+
.nav-item i {
|
407 |
+
font-size: 1.2rem;
|
408 |
+
}
|
409 |
+
|
410 |
+
/* Task Modal */
|
411 |
+
.modal {
|
412 |
+
position: fixed;
|
413 |
+
top: 0;
|
414 |
+
left: 0;
|
415 |
+
right: 0;
|
416 |
+
bottom: 0;
|
417 |
+
background-color: rgba(0, 0, 0, 0.5);
|
418 |
+
display: flex;
|
419 |
+
justify-content: center;
|
420 |
+
align-items: center;
|
421 |
+
z-index: 200;
|
422 |
+
opacity: 0;
|
423 |
+
pointer-events: none;
|
424 |
+
transition: all 0.3s ease;
|
425 |
+
}
|
426 |
+
|
427 |
+
.modal.active {
|
428 |
+
opacity: 1;
|
429 |
+
pointer-events: all;
|
430 |
+
}
|
431 |
+
|
432 |
+
.modal-content {
|
433 |
+
background-color: var(--card-bg);
|
434 |
+
width: 90%;
|
435 |
+
max-width: 500px;
|
436 |
+
border-radius: 16px;
|
437 |
+
padding: 1.5rem;
|
438 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
439 |
+
transform: translateY(20px);
|
440 |
+
transition: all 0.3s ease;
|
441 |
+
max-height: 90vh;
|
442 |
+
overflow-y: auto;
|
443 |
+
}
|
444 |
+
|
445 |
+
.modal.active .modal-content {
|
446 |
+
transform: translateY(0);
|
447 |
+
}
|
448 |
+
|
449 |
+
.modal-header {
|
450 |
+
display: flex;
|
451 |
+
justify-content: space-between;
|
452 |
+
align-items: center;
|
453 |
+
margin-bottom: 1.5rem;
|
454 |
+
}
|
455 |
+
|
456 |
+
.modal-title {
|
457 |
+
font-size: 1.3rem;
|
458 |
+
font-weight: 600;
|
459 |
+
}
|
460 |
+
|
461 |
+
.modal-close {
|
462 |
+
background: none;
|
463 |
+
border: none;
|
464 |
+
font-size: 1.5rem;
|
465 |
+
color: var(--text-secondary);
|
466 |
+
cursor: pointer;
|
467 |
+
}
|
468 |
+
|
469 |
+
.form-group {
|
470 |
+
margin-bottom: 1.2rem;
|
471 |
+
}
|
472 |
+
|
473 |
+
.form-group label {
|
474 |
+
display: block;
|
475 |
+
margin-bottom: 0.5rem;
|
476 |
+
font-weight: 500;
|
477 |
+
}
|
478 |
+
|
479 |
+
.form-control {
|
480 |
+
width: 100%;
|
481 |
+
padding: 0.8rem;
|
482 |
+
border: 1px solid var(--border-color);
|
483 |
+
border-radius: 10px;
|
484 |
+
background-color: var(--card-bg);
|
485 |
+
color: var(--text-primary);
|
486 |
+
font-size: 1rem;
|
487 |
+
}
|
488 |
+
|
489 |
+
.form-control:focus {
|
490 |
+
outline: none;
|
491 |
+
border-color: var(--primary-color);
|
492 |
+
}
|
493 |
+
|
494 |
+
.priority-buttons {
|
495 |
+
display: flex;
|
496 |
+
gap: 0.5rem;
|
497 |
+
}
|
498 |
+
|
499 |
+
.priority-btn {
|
500 |
+
flex: 1;
|
501 |
+
padding: 0.5rem;
|
502 |
+
border-radius: 8px;
|
503 |
+
border: 1px solid var(--border-color);
|
504 |
+
background-color: transparent;
|
505 |
+
display: flex;
|
506 |
+
align-items: center;
|
507 |
+
justify-content: center;
|
508 |
+
gap: 0.3rem;
|
509 |
+
cursor: pointer;
|
510 |
+
font-size: 0.9rem;
|
511 |
+
color: var(--text-secondary);
|
512 |
+
}
|
513 |
+
|
514 |
+
.priority-btn.active {
|
515 |
+
border-color: var(--primary-color);
|
516 |
+
color: var(--primary-color);
|
517 |
+
background-color: rgba(94, 114, 228, 0.1);
|
518 |
+
}
|
519 |
+
|
520 |
+
.priority-dot {
|
521 |
+
width: 10px;
|
522 |
+
height: 10px;
|
523 |
+
border-radius: 50%;
|
524 |
+
}
|
525 |
+
|
526 |
+
.category-tags {
|
527 |
+
display: flex;
|
528 |
+
flex-wrap: wrap;
|
529 |
+
gap: 0.5rem;
|
530 |
+
margin-bottom: 0.5rem;
|
531 |
+
}
|
532 |
+
|
533 |
+
.category-tag {
|
534 |
+
padding: 0.3rem 0.8rem;
|
535 |
+
border-radius: 20px;
|
536 |
+
font-size: 0.8rem;
|
537 |
+
background-color: var(--border-color);
|
538 |
+
color: var(--text-secondary);
|
539 |
+
border: none;
|
540 |
+
cursor: pointer;
|
541 |
+
}
|
542 |
+
|
543 |
+
.category-tag.active {
|
544 |
+
background-color: var(--primary-color);
|
545 |
+
color: white;
|
546 |
+
}
|
547 |
+
|
548 |
+
.date-time-row {
|
549 |
+
display: flex;
|
550 |
+
gap: 0.8rem;
|
551 |
+
}
|
552 |
+
|
553 |
+
.date-time-row .form-group {
|
554 |
+
flex: 1;
|
555 |
+
}
|
556 |
+
|
557 |
+
.input-with-icon {
|
558 |
+
position: relative;
|
559 |
+
}
|
560 |
+
|
561 |
+
.input-with-icon i {
|
562 |
+
position: absolute;
|
563 |
+
right: 12px;
|
564 |
+
top: 50%;
|
565 |
+
transform: translateY(-50%);
|
566 |
+
color: var(--text-secondary);
|
567 |
+
}
|
568 |
+
|
569 |
+
.modal-footer {
|
570 |
+
display: flex;
|
571 |
+
gap: 1rem;
|
572 |
+
margin-top: 1.5rem;
|
573 |
+
}
|
574 |
+
|
575 |
+
.btn {
|
576 |
+
padding: 0.8rem 1.5rem;
|
577 |
+
border-radius: 10px;
|
578 |
+
font-weight: 500;
|
579 |
+
cursor: pointer;
|
580 |
+
font-size: 1rem;
|
581 |
+
border: none;
|
582 |
+
}
|
583 |
+
|
584 |
+
.btn-primary {
|
585 |
+
background-color: var(--primary-color);
|
586 |
+
color: white;
|
587 |
+
flex: 1;
|
588 |
+
}
|
589 |
+
|
590 |
+
.btn-outline {
|
591 |
+
background-color: transparent;
|
592 |
+
border: 1px solid var(--border-color);
|
593 |
+
color: var(--text-primary);
|
594 |
+
}
|
595 |
+
|
596 |
+
/* Animation */
|
597 |
+
@keyframes fadeIn {
|
598 |
+
from { opacity: 0; transform: translateY(10px); }
|
599 |
+
to { opacity: 1; transform: translateY(0); }
|
600 |
+
}
|
601 |
+
|
602 |
+
.task-item {
|
603 |
+
animation: fadeIn 0.3s ease forwards;
|
604 |
+
}
|
605 |
+
|
606 |
+
/* Responsive */
|
607 |
+
@media (min-width: 768px) {
|
608 |
+
.container {
|
609 |
+
max-width: 500px;
|
610 |
+
margin: 0 auto;
|
611 |
+
height: 90vh;
|
612 |
+
max-height: 900px;
|
613 |
+
margin-top: 5vh;
|
614 |
+
border-radius: 16px;
|
615 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
616 |
+
overflow: hidden;
|
617 |
+
}
|
618 |
+
|
619 |
+
.bottom-nav {
|
620 |
+
width: 500px;
|
621 |
+
left: 50%;
|
622 |
+
transform: translateX(-50%);
|
623 |
+
border-bottom-left-radius: 16px;
|
624 |
+
border-bottom-right-radius: 16px;
|
625 |
+
}
|
626 |
+
|
627 |
+
.add-task-container {
|
628 |
+
width: 460px;
|
629 |
+
}
|
630 |
+
}
|
631 |
</style>
|
632 |
+
</head>
|
633 |
+
<body>
|
634 |
+
<div class="container">
|
635 |
+
<header>
|
636 |
+
<div class="logo">
|
637 |
+
<i class="fas fa-tasks"></i>
|
638 |
+
<span>Taskly</span>
|
639 |
+
</div>
|
640 |
+
<div class="header-actions">
|
641 |
+
<button class="theme-toggle" id="themeToggle">
|
642 |
+
<i class="fas fa-moon"></i>
|
643 |
+
</button>
|
644 |
+
<button class="user-avatar">JS</button>
|
645 |
+
</div>
|
646 |
+
</header>
|
647 |
+
|
648 |
+
<main class="main-content">
|
649 |
+
<section class="date-section">
|
650 |
+
<div class="current-date">
|
651 |
+
<h2 id="currentDate">Today, June 15</h2>
|
652 |
+
<p id="currentTodos">You have 5 tasks to complete</p>
|
653 |
+
</div>
|
654 |
+
<button class="calendar-btn">
|
655 |
+
<i class="fas fa-calendar-alt"></i>
|
656 |
+
</button>
|
657 |
+
</section>
|
658 |
+
|
659 |
+
<section class="stats-section">
|
660 |
+
<div class="stat-card completed">
|
661 |
+
<div class="stat-icon">
|
662 |
+
<i class="fas fa-check"></i>
|
663 |
+
</div>
|
664 |
+
<h3>12</h3>
|
665 |
+
<p>Completed</p>
|
666 |
+
</div>
|
667 |
+
<div class="stat-card pending">
|
668 |
+
<div class="stat-icon">
|
669 |
+
<i class="fas fa-clock"></i>
|
670 |
+
</div>
|
671 |
+
<h3>5</h3>
|
672 |
+
<p>Pending</p>
|
673 |
+
</div>
|
674 |
+
<div class="stat-card overdue">
|
675 |
+
<div class="stat-icon">
|
676 |
+
<i class="fas fa-exclamation"></i>
|
677 |
+
</div>
|
678 |
+
<h3>2</h3>
|
679 |
+
<p>Overdue</p>
|
680 |
+
</div>
|
681 |
+
</section>
|
682 |
+
|
683 |
+
<section class="tasks-container">
|
684 |
+
<div class="section-header">
|
685 |
+
<h3>Today's Tasks</h3>
|
686 |
+
<span>5 tasks</span>
|
687 |
+
</div>
|
688 |
+
<div class="task-list" id="todayTasks">
|
689 |
+
<!-- Today's tasks will be added here by JavaScript -->
|
690 |
+
</div>
|
691 |
+
</section>
|
692 |
+
|
693 |
+
<section class="tasks-container">
|
694 |
+
<div class="section-header">
|
695 |
+
<h3>Upcoming</h3>
|
696 |
+
<span>3 tasks</span>
|
697 |
+
</div>
|
698 |
+
<div class="task-list" id="upcomingTasks">
|
699 |
+
<!-- Upcoming tasks will be added here by JavaScript -->
|
700 |
+
</div>
|
701 |
+
</section>
|
702 |
+
</main>
|
703 |
+
|
704 |
+
<div class="add-task-container">
|
705 |
+
<button class="add-task-btn" id="addTaskBtn">
|
706 |
+
<i class="fas fa-plus"></i>
|
707 |
+
<span>Add Task</span>
|
708 |
+
</button>
|
709 |
+
</div>
|
710 |
+
|
711 |
+
<nav class="bottom-nav">
|
712 |
+
<a href="#" class="nav-item active">
|
713 |
+
<i class="fas fa-home"></i>
|
714 |
+
<span>Home</span>
|
715 |
+
</a>
|
716 |
+
<a href="#" class="nav-item">
|
717 |
+
<i class="fas fa-calendar"></i>
|
718 |
+
<span>Calendar</span>
|
719 |
+
</a>
|
720 |
+
<a href="#" class="nav-item">
|
721 |
+
<i class="fas fa-chart-pie"></i>
|
722 |
+
<span>Stats</span>
|
723 |
+
</a>
|
724 |
+
<a href="#" class="nav-item">
|
725 |
+
<i class="fas fa-cog"></i>
|
726 |
+
<span>Settings</span>
|
727 |
+
</a>
|
728 |
+
</nav>
|
729 |
+
</div>
|
730 |
+
|
731 |
+
<!-- Add Task Modal -->
|
732 |
+
<div class="modal" id="taskModal">
|
733 |
+
<div class="modal-content">
|
734 |
+
<div class="modal-header">
|
735 |
+
<h2 class="modal-title">Add New Task</h2>
|
736 |
+
<button class="modal-close" id="closeModal">×</button>
|
737 |
+
</div>
|
738 |
+
<form id="taskForm">
|
739 |
+
<div class="form-group">
|
740 |
+
<label for="taskTitle">Task Title</label>
|
741 |
+
<input type="text" id="taskTitle" class="form-control" placeholder="Enter task title" required>
|
742 |
+
</div>
|
743 |
+
<div class="form-group">
|
744 |
+
<label for="taskDescription">Description</label>
|
745 |
+
<textarea id="taskDescription" class="form-control" rows="3" placeholder="Enter task description (optional)"></textarea>
|
746 |
+
</div>
|
747 |
+
<div class="form-group">
|
748 |
+
<label>Priority</label>
|
749 |
+
<div class="priority-buttons">
|
750 |
+
<button type="button" class="priority-btn" data-priority="low">
|
751 |
+
<span class="priority-dot priority-low"></span>
|
752 |
+
Low
|
753 |
+
</button>
|
754 |
+
<button type="button" class="priority-btn active" data-priority="medium">
|
755 |
+
<span class="priority-dot priority-medium"></span>
|
756 |
+
Medium
|
757 |
+
</button>
|
758 |
+
<button type="button" class="priority-btn" data-priority="high">
|
759 |
+
<span class="priority-dot priority-high"></span>
|
760 |
+
High
|
761 |
+
</button>
|
762 |
+
</div>
|
763 |
+
</div>
|
764 |
+
<div class="form-group">
|
765 |
+
<label>Category</label>
|
766 |
+
<div class="category-tags">
|
767 |
+
<button type="button" class="category-tag active" data-category="personal">Personal</button>
|
768 |
+
<button type="button" class="category-tag" data-category="work">Work</button>
|
769 |
+
<button type="button" class="category-tag" data-category="shopping">Shopping</button>
|
770 |
+
<button type="button" class="category-tag" data-category="health">Health</button>
|
771 |
+
<button type="button" class="category-tag" data-category="other">Other</button>
|
772 |
+
</div>
|
773 |
+
</div>
|
774 |
+
<div class="form-group">
|
775 |
+
<div class="date-time-row">
|
776 |
+
<div class="form-group">
|
777 |
+
<label for="taskDate">Date</label>
|
778 |
+
<div class="input-with-icon">
|
779 |
+
<input type="date" id="taskDate" class="form-control" required>
|
780 |
+
<i class="fas fa-calendar"></i>
|
781 |
+
</div>
|
782 |
+
</div>
|
783 |
+
<div class="form-group">
|
784 |
+
<label for="taskTime">Time</label>
|
785 |
+
<div class="input-with-icon">
|
786 |
+
<input type="time" id="taskTime" class="form-control">
|
787 |
+
<i class="fas fa-clock"></i>
|
788 |
+
</div>
|
789 |
+
</div>
|
790 |
+
</div>
|
791 |
+
</div>
|
792 |
+
<div class="modal-footer">
|
793 |
+
<button type="button" class="btn btn-outline" id="cancelTask">Cancel</button>
|
794 |
+
<button type="submit" class="btn btn-primary">Add Task</button>
|
795 |
+
</div>
|
796 |
+
</form>
|
797 |
+
</div>
|
798 |
+
</div>
|
799 |
+
|
800 |
+
<script>
|
801 |
+
// Sample tasks data
|
802 |
+
const tasks = [
|
803 |
+
{
|
804 |
+
id: 1,
|
805 |
+
title: "Complete project presentation",
|
806 |
+
description: "Finish slides and rehearse presentation",
|
807 |
+
completed: false,
|
808 |
+
priority: "high",
|
809 |
+
category: "work",
|
810 |
+
date: new Date(),
|
811 |
+
time: "15:00"
|
812 |
+
},
|
813 |
+
{
|
814 |
+
id: 2,
|
815 |
+
title: "Buy groceries",
|
816 |
+
description: "Milk, eggs, bread, fruits",
|
817 |
+
completed: false,
|
818 |
+
priority: "medium",
|
819 |
+
category: "shopping",
|
820 |
+
date: new Date(),
|
821 |
+
time: null
|
822 |
+
},
|
823 |
+
{
|
824 |
+
id: 3,
|
825 |
+
title: "Morning workout",
|
826 |
+
description: "30 minutes of cardio",
|
827 |
+
completed: true,
|
828 |
+
priority: "low",
|
829 |
+
category: "health",
|
830 |
+
date: new Date(),
|
831 |
+
time: "07:00"
|
832 |
+
},
|
833 |
+
{
|
834 |
+
id: 4,
|
835 |
+
title: "Call mom",
|
836 |
+
description: "Wish her happy birthday",
|
837 |
+
completed: false,
|
838 |
+
priority: "medium",
|
839 |
+
category: "personal",
|
840 |
+
date: new Date(),
|
841 |
+
time: "18:00"
|
842 |
+
},
|
843 |
+
{
|
844 |
+
id: 5,
|
845 |
+
title: "Read 20 pages",
|
846 |
+
description: "Current book: Atomic Habits",
|
847 |
+
completed: false,
|
848 |
+
priority: "low",
|
849 |
+
category: "personal",
|
850 |
+
date: new Date(),
|
851 |
+
time: null
|
852 |
+
},
|
853 |
+
{
|
854 |
+
id: 6,
|
855 |
+
title: "Team meeting",
|
856 |
+
description: "Discuss Q3 goals",
|
857 |
+
completed: false,
|
858 |
+
priority: "high",
|
859 |
+
category: "work",
|
860 |
+
date: new Date(new Date().getTime() + 86400000),
|
861 |
+
time: "10:30"
|
862 |
+
},
|
863 |
+
{
|
864 |
+
id: 7,
|
865 |
+
title: "Dentist appointment",
|
866 |
+
description: "Annual checkup",
|
867 |
+
completed: false,
|
868 |
+
priority: "medium",
|
869 |
+
category: "health",
|
870 |
+
date: new Date(new Date().getTime() + 2 * 86400000),
|
871 |
+
time: "14:15"
|
872 |
+
}
|
873 |
+
];
|
874 |
+
|
875 |
+
// DOM Elements
|
876 |
+
const themeToggle = document.getElementById('themeToggle');
|
877 |
+
const addTaskBtn = document.getElementById('addTaskBtn');
|
878 |
+
const taskModal = document.getElementById('taskModal');
|
879 |
+
const closeModal = document.getElementById('closeModal');
|
880 |
+
const cancelTask = document.getElementById('cancelTask');
|
881 |
+
const taskForm = document.getElementById('taskForm');
|
882 |
+
const todayTasksContainer = document.getElementById('todayTasks');
|
883 |
+
const upcomingTasksContainer = document.getElementById('upcomingTasks');
|
884 |
+
const currentDateElement = document.getElementById('currentDate');
|
885 |
+
const currentTodosElement = document.getElementById('currentTodos');
|
886 |
+
const priorityButtons = document.querySelectorAll('.priority-btn');
|
887 |
+
const categoryButtons = document.querySelectorAll('.category-tag');
|
888 |
+
|
889 |
+
// Current date formatting
|
890 |
+
const options = { weekday: 'long', month: 'long', day: 'numeric' };
|
891 |
+
const today = new Date();
|
892 |
+
currentDateElement.textContent = today.toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric' });
|
893 |
+
|
894 |
+
// Filter tasks for today and upcoming
|
895 |
+
const todayTasks = tasks.filter(task => {
|
896 |
+
return task.date.toDateString() === today.toDateString();
|
897 |
+
});
|
898 |
+
|
899 |
+
const upcomingTasks = tasks.filter(task => {
|
900 |
+
return task.date > today && task.date.toDateString() !== today.toDateString();
|
901 |
+
});
|
902 |
+
|
903 |
+
// Update task count
|
904 |
+
currentTodosElement.textContent = `You have ${todayTasks.length} tasks to complete`;
|
905 |
+
|
906 |
+
// Theme toggle
|
907 |
+
themeToggle.addEventListener('click', () => {
|
908 |
+
document.body.setAttribute('data-theme',
|
909 |
+
document.body.getAttribute('data-theme') === 'dark' ? 'light' : 'dark');
|
910 |
+
|
911 |
+
const icon = themeToggle.querySelector('i');
|
912 |
+
if (document.body.getAttribute('data-theme') === 'dark') {
|
913 |
+
icon.classList.remove('fa-moon');
|
914 |
+
icon.classList.add('fa-sun');
|
915 |
+
} else {
|
916 |
+
icon.classList.remove('fa-sun');
|
917 |
+
icon.classList.add('fa-moon');
|
918 |
+
}
|
919 |
+
});
|
920 |
+
|
921 |
+
// Modal controls
|
922 |
+
addTaskBtn.addEventListener('click', () => {
|
923 |
+
taskModal.classList.add('active');
|
924 |
+
document.getElementById('taskTitle').focus();
|
925 |
+
});
|
926 |
+
|
927 |
+
closeModal.addEventListener('click', () => {
|
928 |
+
taskModal.classList.remove('active');
|
929 |
+
});
|
930 |
+
|
931 |
+
cancelTask.addEventListener('click', () => {
|
932 |
+
taskModal.classList.remove('active');
|
933 |
+
});
|
934 |
+
|
935 |
+
// Close modal when clicking outside
|
936 |
+
taskModal.addEventListener('click', (e) => {
|
937 |
+
if (e.target === taskModal) {
|
938 |
+
taskModal.classList.remove('active');
|
939 |
+
}
|
940 |
+
});
|
941 |
+
|
942 |
+
// Priority buttons
|
943 |
+
priorityButtons.forEach(button => {
|
944 |
+
button.addEventListener('click', () => {
|
945 |
+
priorityButtons.forEach(btn => btn.classList.remove('active'));
|
946 |
+
button.classList.add('active');
|
947 |
+
});
|
948 |
+
});
|
949 |
+
|
950 |
+
// Category buttons
|
951 |
+
categoryButtons.forEach(button => {
|
952 |
+
button.addEventListener('click', () => {
|
953 |
+
categoryButtons.forEach(btn => btn.classList.remove('active'));
|
954 |
+
button.classList.add('active');
|
955 |
+
});
|
956 |
+
});
|
957 |
+
|
958 |
+
// Render tasks
|
959 |
+
function renderTasks() {
|
960 |
+
// Clear containers
|
961 |
+
todayTasksContainer.innerHTML = '';
|
962 |
+
upcomingTasksContainer.innerHTML = '';
|
963 |
+
|
964 |
+
// Render today's tasks
|
965 |
+
todayTasks.forEach(task => {
|
966 |
+
const taskElement = createTaskElement(task);
|
967 |
+
todayTasksContainer.appendChild(taskElement);
|
968 |
+
});
|
969 |
+
|
970 |
+
// Render upcoming tasks
|
971 |
+
upcomingTasks.forEach(task => {
|
972 |
+
const taskElement = createTaskElement(task);
|
973 |
+
upcomingTasksContainer.appendChild(taskElement);
|
974 |
+
});
|
975 |
+
|
976 |
+
// Add event listeners to checkboxes
|
977 |
+
document.querySelectorAll('.task-checkbox').forEach(checkbox => {
|
978 |
+
checkbox.addEventListener('change', function() {
|
979 |
+
const taskId = parseInt(this.getAttribute('data-task-id'));
|
980 |
+
const taskItem = tasks.find(t => t.id === taskId);
|
981 |
+
if (taskItem) {
|
982 |
+
taskItem.completed = this.checked;
|
983 |
+
renderTasks();
|
984 |
+
// In a real app, you would update the task in your database here
|
985 |
+
}
|
986 |
+
});
|
987 |
+
});
|
988 |
+
|
989 |
+
// Add event listeners to action buttons
|
990 |
+
document.querySelectorAll('.task-action-btn').forEach(button => {
|
991 |
+
button.addEventListener('click', function() {
|
992 |
+
const action = this.getAttribute('data-action');
|
993 |
+
const taskId = parseInt(this.getAttribute('data-task-id'));
|
994 |
+
const taskItem = tasks.find(t => t.id === taskId);
|
995 |
+
|
996 |
+
if (action === 'delete' && confirm('Are you sure you want to delete this task?')) {
|
997 |
+
const taskIndex = tasks.findIndex(t => t.id === taskId);
|
998 |
+
if (taskIndex !== -1) {
|
999 |
+
tasks.splice(taskIndex, 1);
|
1000 |
+
renderTasks();
|
1001 |
+
// In a real app, you would delete the task from your database here
|
1002 |
+
}
|
1003 |
+
} else if (action === 'edit') {
|
1004 |
+
// In a real app, you would open an edit modal here
|
1005 |
+
alert('Edit functionality would be implemented here');
|
1006 |
+
}
|
1007 |
+
});
|
1008 |
+
});
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
function createTaskElement(task) {
|
1012 |
+
const taskElement = document.createElement('div');
|
1013 |
+
taskElement.className = `task-item ${task.completed ? 'completed' : ''}`;
|
1014 |
+
|
1015 |
+
let timeDisplay = '';
|
1016 |
+
if (task.time) {
|
1017 |
+
const [hours, minutes] = task.time.split(':');
|
1018 |
+
const time = new Date();
|
1019 |
+
time.setHours(parseInt(hours));
|
1020 |
+
time.setMinutes(parseInt(minutes));
|
1021 |
+
timeDisplay = time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
const taskDateOptions = { month: 'short', day: 'numeric' };
|
1025 |
+
const taskDateDisplay = task.date.toLocaleDateString('en-US', taskDateOptions);
|
1026 |
+
|
1027 |
+
taskElement.innerHTML = `
|
1028 |
+
<input type="checkbox" class="task-checkbox" data-task-id="${task.id}" ${task.completed ? 'checked' : ''}>
|
1029 |
+
<div class="task-content">
|
1030 |
+
<h3 class="task-title ${task.completed ? 'completed' : ''}">${task.title}</h3>
|
1031 |
+
${task.description ? `<p class="task-description">${task.description}</p>` : ''}
|
1032 |
+
<div class="task-details">
|
1033 |
+
<div class="task-detail">
|
1034 |
+
<span class="task-priority priority-${task.priority}"></span>
|
1035 |
+
${task.priority.charAt(0).toUpperCase() + task.priority.slice(1)}
|
1036 |
+
</div>
|
1037 |
+
<div class="task-detail">
|
1038 |
+
<i class="fas fa-tag"></i>
|
1039 |
+
${task.category.charAt(0).toUpperCase() + task.category.slice(1)}
|
1040 |
+
</div>
|
1041 |
+
${task.time ? `
|
1042 |
+
<div class="task-detail">
|
1043 |
+
<i class="fas fa-clock"></i>
|
1044 |
+
${timeDisplay}
|
1045 |
+
</div>
|
1046 |
+
` : ''}
|
1047 |
+
</div>
|
1048 |
+
</div>
|
1049 |
+
<div class="task-actions">
|
1050 |
+
<button class="task-action-btn" data-task-id="${task.id}" data-action="edit">
|
1051 |
+
<i class="fas fa-edit"></i>
|
1052 |
+
</button>
|
1053 |
+
<button class="task-action-btn" data-task-id="${task.id}" data-action="delete">
|
1054 |
+
<i class="fas fa-trash-alt"></i>
|
1055 |
+
</button>
|
1056 |
+
</div>
|
1057 |
+
`;
|
1058 |
+
|
1059 |
+
return taskElement;
|
1060 |
+
}
|
1061 |
+
|
1062 |
+
// Form submission
|
1063 |
+
taskForm.addEventListener('submit', (e) => {
|
1064 |
+
e.preventDefault();
|
1065 |
+
|
1066 |
+
// Get form values
|
1067 |
+
const title = document.getElementById('taskTitle').value;
|
1068 |
+
const description = document.getElementById('taskDescription').value;
|
1069 |
+
const priority = document.querySelector('.priority-btn.active').getAttribute('data-priority');
|
1070 |
+
const category = document.querySelector('.category-tag.active').getAttribute('data-category');
|
1071 |
+
const date = document.getElementById('taskDate').value;
|
1072 |
+
const time = document.getElementById('taskTime').value;
|
1073 |
+
|
1074 |
+
// Create new task
|
1075 |
+
const newTask = {
|
1076 |
+
id: tasks.length > 0 ? Math.max(...tasks.map(t => t.id)) + 1 : 1,
|
1077 |
+
title,
|
1078 |
+
description,
|
1079 |
+
completed: false,
|
1080 |
+
priority,
|
1081 |
+
category,
|
1082 |
+
date: new Date(date),
|
1083 |
+
time: time || null
|
1084 |
+
};
|
1085 |
+
|
1086 |
+
// Add to tasks array
|
1087 |
+
tasks.push(newTask);
|
1088 |
+
|
1089 |
+
// Re-render tasks
|
1090 |
+
renderTasks();
|
1091 |
+
|
1092 |
+
// Close modal and reset form
|
1093 |
+
taskModal.classList.remove('active');
|
1094 |
+
taskForm.reset();
|
1095 |
+
|
1096 |
+
// Reset priority to medium
|
1097 |
+
priorityButtons.forEach(btn => btn.classList.remove('active'));
|
1098 |
+
document.querySelector('.priority-btn[data-priority="medium"]').classList.add('active');
|
1099 |
+
|
1100 |
+
// Reset category to personal
|
1101 |
+
categoryButtons.forEach(btn => btn.classList.remove('active'));
|
1102 |
+
document.querySelector('.category-tag[data-category="personal"]').classList.add('active');
|
1103 |
+
});
|
1104 |
+
|
1105 |
+
// Set today's date as default for new tasks
|
1106 |
+
document.getElementById('taskDate').valueAsDate = new Date();
|
1107 |
+
|
1108 |
+
// Initial render
|
1109 |
+
renderTasks();
|
1110 |
+
</script>
|
1111 |
+
</body>
|
1112 |
+
</html>
|