-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
763 lines (712 loc) · 33.6 KB
/
index.html
File metadata and controls
763 lines (712 loc) · 33.6 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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Task Planner</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
:root {
--primary-color: #6366f1;
--secondary-color: #8b5cf6;
--dark-bg: #1f2937;
--dark-text: #f3f4f6;
--light-bg: #f9fafb;
--light-text: #111827;
}
.dark {
background-color: var(--dark-bg);
color: var(--dark-text);
}
.light {
background-color: var(--light-bg);
color: var(--light-text);
}
.task-item {
transition: all 0.3s ease;
}
.task-item:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.priority-high {
border-left: 4px solid #ef4444;
}
.priority-medium {
border-left: 4px solid #f59e0b;
}
.priority-low {
border-left: 4px solid #10b981;
}
.completed {
opacity: 0.7;
text-decoration: line-through;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in {
animation: fadeIn 0.3s ease forwards;
}
</style>
</head>
<body class="min-h-screen transition-colors duration-300">
<div class="container mx-auto px-4 py-8 max-w-4xl">
<!-- Header Section -->
<header class="flex justify-between items-center mb-8">
<div class="flex items-center space-x-2">
<h1 class="text-3xl font-bold dark:text-white">Task Planner</h1>
</div>
<div class="flex items-center space-x-4">
<button
id="themeToggle"
class="p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"
/>
</svg>
</button>
<div class="relative">
<button id="userMenu" class="flex items-center space-x-2">
<img
src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxESEg8PDw8SDxAQDw8NDg0ODQ8PDw4PFREWFhUSFRUYHSggGCYmHRUVITEhJikrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi8mICUtLS0uLTUyNTYrLS0tKy8tLS4rMCwxLS0tLS0tLi0tLS0tLi0vLS0tLSstLS0rLS0tLf/AABEIAOEA4QMBEQACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAAAQQCAwUGB//EAEQQAAIBAwAFBQoMBQUBAAAAAAABAgMEEQUSEyExQVFhkdEUIjJSU3FygZKTBhYjMzRCVFV0sbKzgqGiwfAVYnPS4ST/xAAaAQEAAgMBAAAAAAAAAAAAAAAAAgMBBAUG/8QAOREBAAIBAQQFCQYGAwAAAAAAAAECAxEEEiExE0FRcZEUNF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ySA8dpTSDuKm7KpxyoR5+eT84FmypAdihECwgJAAAAACAAAAAAhgaKsAOZd0AMbDSkqPeSTnT5vrQ83YB6G2uYVFrU5KS6OK6GuQDcAAAAAAAAAq31/TorNSWOaK3yl5kB5PSWlKlw8eBTTyqa5emT5QJtLcDs21EC9CIGwAAAAAAAAAAAAAGMkBWrUsgc25tgOe4Tg9aEnCXPF4AvW/wAIqsd1SCqLxl3kuz8gL9L4SUH4WvD0oZX9OQLMNNWz4Vo/xa0fzQGxaVt/L0vex7QD0rb+Xp+8iwNVTTtsuNZP0Yzl+SAqVvhRRXgRnN+iorre/wDkBy7r4R157qaVJc676fW938gOaqUpNyk3KT4yk22/WwL9tagdW3oYAv04AbUgJAAAAAABAAAAAAAAGMkBoqUgKda2Ao1rMCpOzA0ytAMe5AI7kAyVoBshaAb6dn0AXKNoBeo0ALUIAbUgJAAAAAAAAAAAAAAAAAIaAwlADTOiBqlbAana9AGPcgEdyAZK0AzjagbY24G2NIDaogZYAkAAAAAAAAAAAAAAAAAAAIAYAhoDHVAaqAaqAaoE6oE4AkABIAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/9k="
alt="User profile picture of a smiling professional"
class="h-10 w-10 rounded-full"
/>
</button>
</div>
</div>
</header>
<!-- Stats Overview -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-8">
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 flex items-center"
>
<div class="p-3 rounded-full bg-indigo-100 dark:bg-indigo-900 mr-4">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 text-indigo-500 dark:text-indigo-300"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"
/>
</svg>
</div>
<div>
<p class="text-gray-500 dark:text-gray-400 text-sm">Total Tasks</p>
<h3 class="text-lg font-semibold dark:text-white" id="totalTasks">
0
</h3>
</div>
</div>
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 flex items-center"
>
<div class="p-3 rounded-full bg-green-100 dark:bg-green-900 mr-4">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 text-green-500 dark:text-green-300"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 13l4 4L19 7"
/>
</svg>
</div>
<div>
<p class="text-gray-500 dark:text-gray-400 text-sm">Completed</p>
<h3
class="text-lg font-semibold dark:text-white"
id="completedTasks"
>
0
</h3>
</div>
</div>
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 flex items-center"
>
<div class="p-3 rounded-full bg-yellow-100 dark:bg-yellow-900 mr-4">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 text-yellow-500 dark:text-yellow-300"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</div>
<div>
<p class="text-gray-500 dark:text-gray-400 text-sm">Pending</p>
<h3 class="text-lg font-semibold dark:text-white" id="pendingTasks">
0
</h3>
</div>
</div>
<div
class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 flex items-center"
>
<div class="p-3 rounded-full bg-red-100 dark:bg-red-900 mr-4">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 text-red-500 dark:text-red-300"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
/>
</svg>
</div>
<div>
<p class="text-gray-500 dark:text-gray-400 text-sm">Overdue</p>
<h3 class="text-lg font-semibold dark:text-white" id="overdueTasks">
0
</h3>
</div>
</div>
</div>
<!-- Add Task Form -->
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6 mb-8">
<h2 class="text-xl font-semibold mb-4 dark:text-white">Add New Task</h2>
<form id="addTaskForm" class="space-y-4">
<div>
<label
for="taskTitle"
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
>Task Title</label
>
<input
type="text"
id="taskTitle"
class="w-full px-4 py-2 border dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:text-white"
placeholder="What needs to be done?"
required
/>
</div>
<div>
<label
for="taskDescription"
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
>Description</label
>
<textarea
id="taskDescription"
rows="3"
class="w-full px-4 py-2 border dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:text-white"
placeholder="Add details..."
></textarea>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label
for="taskDueDate"
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
>Due Date</label
>
<input
type="date"
id="taskDueDate"
class="w-full px-4 py-2 border dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:text-white"
/>
</div>
<div>
<label
for="taskPriority"
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
>Priority</label
>
<select
id="taskPriority"
class="w-full px-4 py-2 border dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:text-white"
>
<option value="low">Low</option>
<option value="medium" selected>Medium</option>
<option value="high">High</option>
</select>
</div>
</div>
<div class="flex justify-end">
<button
type="submit"
class="px-6 py-2 bg-indigo-600 hover:bg-indigo-700 text-white font-medium rounded-lg transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
Add Task
</button>
</div>
</form>
</div>
<!-- Task List -->
<div class="mb-8">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold dark:text-white">Your Tasks</h2>
<div class="flex items-center space-x-2">
<button
id="filterAll"
class="px-3 py-1 text-sm bg-indigo-600 text-white rounded-full"
>
All
</button>
<button
id="filterPending"
class="px-3 py-1 text-sm bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full hover:bg-gray-300 dark:hover:bg-gray-600"
>
Pending
</button>
<button
id="filterCompleted"
class="px-3 py-1 text-sm bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-full hover:bg-gray-300 dark:hover:bg-gray-600"
>
Completed
</button>
</div>
</div>
<div id="taskList" class="space-y-3">
<!-- Tasks will be added here dynamically -->
<div
class="task-item bg-white dark:bg-gray-800 rounded-lg shadow p-5 animate-fade-in priority-medium"
>
<div class="flex items-start justify-between">
<div class="flex items-start space-x-4">
<button
class="complete-task p-2 rounded-full border border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5 text-gray-400"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 13l4 4L19 7"
/>
</svg>
</button>
<div>
<h3 class="font-medium dark:text-white">Example Task</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">
This is an example task to show the layout
</p>
<div class="flex items-center mt-2 space-x-4 text-xs">
<span class="text-yellow-500 dark:text-yellow-300"
>Medium</span
>
<span class="text-gray-400">Due: Tomorrow</span>
</div>
</div>
</div>
<div class="flex space-x-2">
<button
class="edit-task p-2 text-gray-500 hover:text-indigo-500 dark:hover:text-indigo-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"
/>
</svg>
</button>
<button
class="delete-task p-2 text-gray-500 hover:text-red-500 dark:hover:text-red-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
/>
</svg>
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Productivity Chart Placeholder -->
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6 mb-8">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold dark:text-white">
Productivity Overview
</h2>
<select
class="px-3 py-1 text-sm border dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:text-white"
>
<option>Last 7 days</option>
<option>Last 30 days</option>
<option>Last 90 days</option>
</select>
</div>
<div
class="h-64 bg-gray-100 dark:bg-gray-700 rounded-lg flex items-center justify-center"
>
<img
src="https://storage.googleapis.com/workspace-0f70711f-8b4e-4d94-86f1-2a93ccde5887/image/919497f5-47c9-42dc-adce-bdca76079096.png"
alt="Line chart visualization showing task completion rate over time with purple gradient"
class="w-full h-full object-contain"
/>
</div>
</div>
</div>
<script>
// Theme Toggle
const themeToggle = document.getElementById("themeToggle");
const body = document.body;
// Check for saved theme preference or use preferred color scheme
const prefersDark = window.matchMedia(
"(prefers-color-scheme: dark)"
).matches;
const savedTheme = localStorage.getItem("theme");
if (prefersDark) {
body.classList.add("dark");
}
// Toggle theme
themeToggle.addEventListener("click", () => {
body.classList.toggle("dark");
const isDark = body.classList.contains("dark");
localStorage.setItem("theme", isDark ? "dark" : "light");
});
// Task Management
let tasks = [];
// DOM Elements
const taskForm = document.getElementById("addTaskForm");
const taskList = document.getElementById("taskList");
const taskTitle = document.getElementById("taskTitle");
const taskDescription = document.getElementById("taskDescription");
const taskDueDate = document.getElementById("taskDueDate");
const taskPriority = document.getElementById("taskPriority");
// Stats Elements
const totalTasksElement = document.getElementById("totalTasks");
const completedTasksElement = document.getElementById("completedTasks");
const pendingTasksElement = document.getElementById("pendingTasks");
const overdueTasksElement = document.getElementById("overdueTasks");
// Filter Buttons
const filterAll = document.getElementById("filterAll");
const filterPending = document.getElementById("filterPending");
const filterCompleted = document.getElementById("filterCompleted");
// Load example task
tasks.push({
id: Date.now(),
title: "Example Task",
description: "This is an example task to show the layout",
dueDate: new Date(Date.now() + 86400000).toISOString().split("T")[0],
priority: "medium",
completed: false,
});
// Render tasks
function renderTasks(tasksToRender = tasks) {
taskList.innerHTML = "";
if (tasksToRender.length === 0) {
taskList.innerHTML = `
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-8 text-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
</svg>
<h3 class="mt-4 text-lg font-medium text-gray-900 dark:text-white">No tasks found</h3>
<p class="mt-2 text-gray-500 dark:text-gray-400">Add a new task to get started</p>
</div>
`;
return;
}
tasksToRender.forEach((task) => {
const taskElement = document.createElement("div");
taskElement.className = `task-item bg-white dark:bg-gray-800 rounded-lg shadow p-5 animate-fade-in priority-${
task.priority
} ${task.completed ? "completed" : ""}`;
const dueDate = new Date(task.dueDate);
const today = new Date();
today.setHours(0, 0, 0, 0);
const isOverdue = !task.completed && dueDate < today;
let dueText = "";
if (isOverdue) {
dueText = "Overdue";
} else if (task.dueDate === today.toISOString().split("T")[0]) {
dueText = "Today";
} else if (
task.dueDate ===
new Date(today.getTime() + 86400000).toISOString().split("T")[0]
) {
dueText = "Tomorrow";
} else {
dueText = `Due: ${dueDate.toLocaleDateString()}`;
}
taskElement.innerHTML = `
<div class="flex items-start justify-between">
<div class="flex items-start space-x-4">
<button class="complete-task p-2 rounded-full border ${
task.completed
? "bg-green-100 dark:bg-green-900 border-green-200 dark:border-green-700"
: "border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"
}" data-id="${task.id}">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 ${
task.completed
? "text-green-500 dark:text-green-300"
: "text-gray-400"
}" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
</button>
<div>
<h3 class="font-medium dark:text-white">${
task.title
}</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">${
task.description
}</p>
<div class="flex items-center mt-2 space-x-4 text-xs">
<span class="${
task.priority === "high"
? "text-red-500 dark:text-red-300"
: task.priority === "medium"
? "text-yellow-500 dark:text-yellow-300"
: "text-green-500 dark:text-green-300"
}">${
task.priority.charAt(0).toUpperCase() + task.priority.slice(1)
}</span>
<span class="${
isOverdue
? "text-red-500 dark:text-red-300"
: "text-gray-500 dark:text-gray-400"
}">${dueText}</span>
</div>
</div>
</div>
<div class="flex space-x-2">
<button class="edit-task p-2 text-gray-500 hover:text-indigo-500 dark:hover:text-indigo-300" data-id="${
task.id
}">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
</svg>
</button>
<button class="delete-task p-2 text-gray-500 hover:text-red-500 dark:hover:text-red-300" data-id="${
task.id
}">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
</button>
</div>
</div>
`;
taskList.appendChild(taskElement);
});
updateStats();
}
// Update statistics
function updateStats() {
totalTasksElement.textContent = tasks.length;
completedTasksElement.textContent = tasks.filter(
(task) => task.completed
).length;
pendingTasksElement.textContent = tasks.filter(
(task) => !task.completed
).length;
const today = new Date();
today.setHours(0, 0, 0, 0);
overdueTasksElement.textContent = tasks.filter((task) => {
const dueDate = new Date(task.dueDate);
return !task.completed && dueDate < today;
}).length;
}
// Add new task
taskForm.addEventListener("submit", function (e) {
e.preventDefault();
const newTask = {
id: Date.now(),
title: taskTitle.value.trim(),
description: taskDescription.value.trim(),
dueDate: taskDueDate.value || new Date().toISOString().split("T")[0],
priority: taskPriority.value,
completed: false,
};
tasks.unshift(newTask);
renderTasks();
// Reset form
taskTitle.value = "";
taskDescription.value = "";
taskDueDate.value = "";
taskPriority.value = "medium";
// Focus on title input
taskTitle.focus();
});
// Complete task
taskList.addEventListener("click", function (e) {
if (e.target.closest(".complete-task")) {
const taskId = parseInt(
e.target.closest(".complete-task").getAttribute("data-id")
);
const taskIndex = tasks.findIndex((task) => task.id === taskId);
if (taskIndex !== -1) {
tasks[taskIndex].completed = !tasks[taskIndex].completed;
renderTasks();
}
}
});
// Edit task
taskList.addEventListener("click", function (e) {
if (e.target.closest(".edit-task")) {
const taskId = parseInt(
e.target.closest(".edit-task").getAttribute("data-id")
);
const task = tasks.find((task) => task.id === taskId);
if (task) {
taskTitle.value = task.title;
taskDescription.value = task.description;
taskDueDate.value = task.dueDate;
taskPriority.value = task.priority;
// Remove task from list
tasks = tasks.filter((t) => t.id !== taskId);
renderTasks();
// Focus on title input
taskTitle.focus();
}
}
});
// Delete task
taskList.addEventListener("click", function (e) {
if (e.target.closest(".delete-task")) {
const taskId = parseInt(
e.target.closest(".delete-task").getAttribute("data-id")
);
if (confirm("Are you sure you want to delete this task?")) {
tasks = tasks.filter((task) => task.id !== taskId);
renderTasks();
}
}
});
// Filter tasks
filterAll.addEventListener("click", function () {
filterAll.classList.add("bg-indigo-600", "text-white");
filterAll.classList.remove(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
filterPending.classList.remove("bg-indigo-600", "text-white");
filterPending.classList.add(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
filterCompleted.classList.remove("bg-indigo-600", "text-white");
filterCompleted.classList.add(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
renderTasks();
});
filterPending.addEventListener("click", function () {
filterPending.classList.add("bg-indigo-600", "text-white");
filterPending.classList.remove(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
filterAll.classList.remove("bg-indigo-600", "text-white");
filterAll.classList.add(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
filterCompleted.classList.remove("bg-indigo-600", "text-white");
filterCompleted.classList.add(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
renderTasks(tasks.filter((task) => !task.completed));
});
filterCompleted.addEventListener("click", function () {
filterCompleted.classList.add("bg-indigo-600", "text-white");
filterCompleted.classList.remove(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
filterAll.classList.remove("bg-indigo-600", "text-white");
filterAll.classList.add(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
filterPending.classList.remove("bg-indigo-600", "text-white");
filterPending.classList.add(
"bg-gray-200",
"dark:bg-gray-700",
"text-gray-700",
"dark:text-gray-300"
);
renderTasks(tasks.filter((task) => task.completed));
});
// Initial render
renderTasks();
</script>
</body>
</html>