akhaliq HF Staff commited on
Commit
54b9db0
·
verified ·
1 Parent(s): 9e2743f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +1464 -19
index.html CHANGED
@@ -1,19 +1,1464 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>TaskFlow - Apple Style Todo App</title>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ :root {
11
+ /* Apple-inspired color system */
12
+ --apple-blue: #007AFF;
13
+ --apple-green: #34C759;
14
+ --apple-orange: #FF9500;
15
+ --apple-red: #FF3B30;
16
+ --apple-purple: #AF52DE;
17
+ --apple-pink: #FF2D55;
18
+ --apple-gray: #8E8E93;
19
+ --apple-gray2: #AEAEB2;
20
+ --apple-gray3: #C7C7CC;
21
+ --apple-gray4: #D1D1D6;
22
+ --apple-gray5: #E5E5EA;
23
+ --apple-gray6: #F2F2F7;
24
+
25
+ /* System backgrounds */
26
+ --bg-primary: #FFFFFF;
27
+ --bg-secondary: #F2F2F7;
28
+ --bg-tertiary: #FFFFFF;
29
+ --bg-glass: rgba(255, 255, 255, 0.8);
30
+ --bg-glass-dark: rgba(255, 255, 255, 0.1);
31
+
32
+ /* Text colors */
33
+ --text-primary: #000000;
34
+ --text-secondary: #3C3C43;
35
+ --text-tertiary: #3C3C4399;
36
+ --text-quaternary: #3C3C4333;
37
+
38
+ /* Borders and separators */
39
+ --border-color: #C6C6C8;
40
+ --separator-color: #C6C6C84D;
41
+
42
+ /* Shadows */
43
+ --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
44
+ --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
45
+ --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
46
+ --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
47
+ --shadow-floating: 0 8px 16px rgba(0, 0, 0, 0.08);
48
+
49
+ /* Transitions */
50
+ --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
51
+ --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
52
+ --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
53
+
54
+ /* Priority colors */
55
+ --priority-low: var(--apple-green);
56
+ --priority-medium: var(--apple-orange);
57
+ --priority-high: var(--apple-red);
58
+ }
59
+
60
+ [data-theme="dark"] {
61
+ --bg-primary: #000000;
62
+ --bg-secondary: #1C1C1E;
63
+ --bg-tertiary: #2C2C2E;
64
+ --bg-glass: rgba(28, 28, 30, 0.8);
65
+ --bg-glass-dark: rgba(44, 44, 46, 0.8);
66
+
67
+ --text-primary: #FFFFFF;
68
+ --text-secondary: #EBEBF5;
69
+ --text-tertiary: #EBEBF599;
70
+ --text-quaternary: #EBEBF533;
71
+
72
+ --border-color: #38383A;
73
+ --separator-color: #38383A4D;
74
+ }
75
+
76
+ * {
77
+ margin: 0;
78
+ padding: 0;
79
+ box-sizing: border-box;
80
+ }
81
+
82
+ body {
83
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
84
+ background: var(--bg-secondary);
85
+ min-height: 100vh;
86
+ color: var(--text-primary);
87
+ transition: background-color var(--transition-base);
88
+ -webkit-font-smoothing: antialiased;
89
+ -moz-osx-font-smoothing: grayscale;
90
+ }
91
+
92
+ .container {
93
+ max-width: 1200px;
94
+ margin: 0 auto;
95
+ padding: 20px;
96
+ }
97
+
98
+ /* Header Section */
99
+ header {
100
+ background: var(--bg-glass);
101
+ backdrop-filter: saturate(180%) blur(20px);
102
+ -webkit-backdrop-filter: saturate(180%) blur(20px);
103
+ border-radius: 18px;
104
+ padding: 32px;
105
+ margin-bottom: 24px;
106
+ box-shadow: var(--shadow-floating);
107
+ animation: slideDown var(--transition-slow) ease-out;
108
+ border: 1px solid var(--separator-color);
109
+ }
110
+
111
+ .header-content {
112
+ display: flex;
113
+ justify-content: space-between;
114
+ align-items: center;
115
+ flex-wrap: wrap;
116
+ gap: 20px;
117
+ }
118
+
119
+ .logo {
120
+ display: flex;
121
+ align-items: center;
122
+ gap: 12px;
123
+ font-size: 28px;
124
+ font-weight: 600;
125
+ color: var(--text-primary);
126
+ letter-spacing: -0.5px;
127
+ }
128
+
129
+ .logo i {
130
+ font-size: 32px;
131
+ background: var(--apple-blue);
132
+ -webkit-background-clip: text;
133
+ -webkit-text-fill-color: transparent;
134
+ background-clip: text;
135
+ }
136
+
137
+ .header-actions {
138
+ display: flex;
139
+ gap: 12px;
140
+ align-items: center;
141
+ }
142
+
143
+ .theme-toggle {
144
+ width: 44px;
145
+ height: 44px;
146
+ border-radius: 50%;
147
+ background: var(--bg-tertiary);
148
+ border: none;
149
+ cursor: pointer;
150
+ transition: all var(--transition-fast);
151
+ display: flex;
152
+ align-items: center;
153
+ justify-content: center;
154
+ font-size: 18px;
155
+ color: var(--text-secondary);
156
+ box-shadow: var(--shadow-sm);
157
+ }
158
+
159
+ .theme-toggle:hover {
160
+ transform: scale(1.05);
161
+ background: var(--apple-blue);
162
+ color: white;
163
+ }
164
+
165
+ .theme-toggle:active {
166
+ transform: scale(0.95);
167
+ }
168
+
169
+ .stats-container {
170
+ display: grid;
171
+ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
172
+ gap: 16px;
173
+ margin-top: 24px;
174
+ }
175
+
176
+ .stat-card {
177
+ background: var(--bg-tertiary);
178
+ padding: 20px;
179
+ border-radius: 16px;
180
+ text-align: center;
181
+ transition: all var(--transition-fast);
182
+ border: 1px solid var(--separator-color);
183
+ }
184
+
185
+ .stat-card:hover {
186
+ transform: translateY(-2px);
187
+ box-shadow: var(--shadow-md);
188
+ }
189
+
190
+ .stat-number {
191
+ font-size: 32px;
192
+ font-weight: 600;
193
+ color: var(--apple-blue);
194
+ letter-spacing: -1px;
195
+ }
196
+
197
+ .stat-label {
198
+ font-size: 13px;
199
+ color: var(--text-tertiary);
200
+ margin-top: 4px;
201
+ font-weight: 500;
202
+ text-transform: uppercase;
203
+ letter-spacing: 0.5px;
204
+ }
205
+
206
+ /* Main Layout */
207
+ .main-content {
208
+ display: grid;
209
+ grid-template-columns: 320px 1fr;
210
+ gap: 24px;
211
+ animation: fadeIn var(--transition-slow) ease-out;
212
+ }
213
+
214
+ /* Sidebar */
215
+ .sidebar {
216
+ background: var(--bg-glass);
217
+ backdrop-filter: saturate(180%) blur(20px);
218
+ -webkit-backdrop-filter: saturate(180%) blur(20px);
219
+ border-radius: 18px;
220
+ padding: 24px;
221
+ box-shadow: var(--shadow-floating);
222
+ height: fit-content;
223
+ position: sticky;
224
+ top: 20px;
225
+ border: 1px solid var(--separator-color);
226
+ }
227
+
228
+ .add-task-form h3 {
229
+ font-size: 20px;
230
+ font-weight: 600;
231
+ margin-bottom: 20px;
232
+ color: var(--text-primary);
233
+ letter-spacing: -0.3px;
234
+ }
235
+
236
+ .form-group {
237
+ margin-bottom: 20px;
238
+ }
239
+
240
+ .form-label {
241
+ display: block;
242
+ margin-bottom: 8px;
243
+ font-weight: 500;
244
+ color: var(--text-secondary);
245
+ font-size: 13px;
246
+ text-transform: uppercase;
247
+ letter-spacing: 0.5px;
248
+ }
249
+
250
+ .form-input,
251
+ .form-select,
252
+ .form-textarea {
253
+ width: 100%;
254
+ padding: 12px 16px;
255
+ border: 1px solid var(--border-color);
256
+ border-radius: 12px;
257
+ background: var(--bg-primary);
258
+ color: var(--text-primary);
259
+ font-size: 16px;
260
+ transition: all var(--transition-fast);
261
+ font-family: inherit;
262
+ }
263
+
264
+ .form-input:focus,
265
+ .form-select:focus,
266
+ .form-textarea:focus {
267
+ outline: none;
268
+ border-color: var(--apple-blue);
269
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
270
+ }
271
+
272
+ .form-textarea {
273
+ resize: vertical;
274
+ min-height: 80px;
275
+ line-height: 1.5;
276
+ }
277
+
278
+ /* Priority Selector */
279
+ .priority-selector {
280
+ display: flex;
281
+ gap: 8px;
282
+ }
283
+
284
+ .priority-btn {
285
+ flex: 1;
286
+ padding: 10px;
287
+ border: 1px solid var(--border-color);
288
+ border-radius: 10px;
289
+ background: var(--bg-primary);
290
+ cursor: pointer;
291
+ transition: all var(--transition-fast);
292
+ font-weight: 500;
293
+ font-size: 14px;
294
+ color: var(--text-secondary);
295
+ }
296
+
297
+ .priority-btn:hover {
298
+ transform: translateY(-1px);
299
+ box-shadow: var(--shadow-sm);
300
+ }
301
+
302
+ .priority-btn:active {
303
+ transform: translateY(0);
304
+ }
305
+
306
+ .priority-btn.active {
307
+ color: white;
308
+ border-color: transparent;
309
+ font-weight: 600;
310
+ }
311
+
312
+ .priority-btn.low.active {
313
+ background: var(--priority-low);
314
+ }
315
+
316
+ .priority-btn.medium.active {
317
+ background: var(--priority-medium);
318
+ }
319
+
320
+ .priority-btn.high.active {
321
+ background: var(--priority-high);
322
+ }
323
+
324
+ /* Category Tags */
325
+ .category-tags {
326
+ display: flex;
327
+ flex-wrap: wrap;
328
+ gap: 8px;
329
+ }
330
+
331
+ .category-tag {
332
+ padding: 8px 16px;
333
+ border-radius: 20px;
334
+ background: var(--bg-primary);
335
+ border: 1px solid var(--border-color);
336
+ cursor: pointer;
337
+ transition: all var(--transition-fast);
338
+ font-size: 14px;
339
+ font-weight: 500;
340
+ color: var(--text-secondary);
341
+ }
342
+
343
+ .category-tag:hover {
344
+ transform: translateY(-1px);
345
+ box-shadow: var(--shadow-sm);
346
+ }
347
+
348
+ .category-tag.active {
349
+ background: var(--apple-blue);
350
+ color: white;
351
+ border-color: var(--apple-blue);
352
+ }
353
+
354
+ /* Buttons */
355
+ .btn {
356
+ padding: 12px 24px;
357
+ border: none;
358
+ border-radius: 12px;
359
+ font-size: 16px;
360
+ font-weight: 600;
361
+ cursor: pointer;
362
+ transition: all var(--transition-fast);
363
+ display: inline-flex;
364
+ align-items: center;
365
+ gap: 8px;
366
+ font-family: inherit;
367
+ letter-spacing: -0.3px;
368
+ }
369
+
370
+ .btn-primary {
371
+ background: var(--apple-blue);
372
+ color: white;
373
+ width: 100%;
374
+ justify-content: center;
375
+ box-shadow: var(--shadow-sm);
376
+ }
377
+
378
+ .btn-primary:hover {
379
+ transform: translateY(-2px);
380
+ box-shadow: var(--shadow-md);
381
+ background: #0056CC;
382
+ }
383
+
384
+ .btn-primary:active {
385
+ transform: translateY(0);
386
+ box-shadow: var(--shadow-sm);
387
+ }
388
+
389
+ /* Content Area */
390
+ .content-area {
391
+ background: var(--bg-glass);
392
+ backdrop-filter: saturate(180%) blur(20px);
393
+ -webkit-backdrop-filter: saturate(180%) blur(20px);
394
+ border-radius: 18px;
395
+ padding: 24px;
396
+ box-shadow: var(--shadow-floating);
397
+ border: 1px solid var(--separator-color);
398
+ }
399
+
400
+ /* Search and Filter Bar */
401
+ .search-filter-bar {
402
+ display: flex;
403
+ gap: 16px;
404
+ margin-bottom: 24px;
405
+ flex-wrap: wrap;
406
+ }
407
+
408
+ .search-box {
409
+ flex: 1;
410
+ min-width: 200px;
411
+ position: relative;
412
+ }
413
+
414
+ .search-input {
415
+ width: 100%;
416
+ padding: 12px 16px 12px 44px;
417
+ border: 1px solid var(--border-color);
418
+ border-radius: 12px;
419
+ background: var(--bg-primary);
420
+ color: var(--text-primary);
421
+ font-size: 16px;
422
+ transition: all var(--transition-fast);
423
+ font-family: inherit;
424
+ }
425
+
426
+ .search-input:focus {
427
+ outline: none;
428
+ border-color: var(--apple-blue);
429
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
430
+ }
431
+
432
+ .search-icon {
433
+ position: absolute;
434
+ left: 16px;
435
+ top: 50%;
436
+ transform: translateY(-50%);
437
+ color: var(--text-tertiary);
438
+ font-size: 16px;
439
+ }
440
+
441
+ .filter-tabs {
442
+ display: flex;
443
+ gap: 4px;
444
+ background: var(--bg-primary);
445
+ padding: 4px;
446
+ border-radius: 12px;
447
+ border: 1px solid var(--border-color);
448
+ }
449
+
450
+ .filter-tab {
451
+ padding: 8px 16px;
452
+ border: none;
453
+ background: transparent;
454
+ color: var(--text-secondary);
455
+ font-weight: 500;
456
+ cursor: pointer;
457
+ border-radius: 8px;
458
+ transition: all var(--transition-fast);
459
+ font-size: 14px;
460
+ font-family: inherit;
461
+ }
462
+
463
+ .filter-tab.active {
464
+ background: var(--apple-blue);
465
+ color: white;
466
+ box-shadow: var(--shadow-sm);
467
+ }
468
+
469
+ .sort-dropdown {
470
+ padding: 10px 16px;
471
+ border: 1px solid var(--border-color);
472
+ border-radius: 12px;
473
+ background: var(--bg-primary);
474
+ color: var(--text-primary);
475
+ cursor: pointer;
476
+ transition: all var(--transition-fast);
477
+ font-size: 14px;
478
+ font-family: inherit;
479
+ font-weight: 500;
480
+ }
481
+
482
+ .sort-dropdown:focus {
483
+ outline: none;
484
+ border-color: var(--apple-blue);
485
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
486
+ }
487
+
488
+ /* Todo List */
489
+ .todo-list {
490
+ list-style: none;
491
+ margin-top: 20px;
492
+ }
493
+
494
+ .todo-item {
495
+ background: var(--bg-primary);
496
+ border: 1px solid var(--separator-color);
497
+ border-radius: 16px;
498
+ padding: 20px;
499
+ margin-bottom: 12px;
500
+ display: flex;
501
+ align-items: flex-start;
502
+ gap: 16px;
503
+ transition: all var(--transition-fast);
504
+ cursor: move;
505
+ animation: slideIn var(--transition-base) ease-out;
506
+ }
507
+
508
+ .todo-item:hover {
509
+ transform: translateX(4px);
510
+ box-shadow: var(--shadow-md);
511
+ border-color: var(--border-color);
512
+ }
513
+
514
+ .todo-item.dragging {
515
+ opacity: 0.5;
516
+ transform: rotate(1deg);
517
+ box-shadow: var(--shadow-lg);
518
+ }
519
+
520
+ .todo-item.completed {
521
+ opacity: 0.6;
522
+ }
523
+
524
+ .todo-checkbox {
525
+ width: 24px;
526
+ height: 24px;
527
+ border: 2px solid var(--border-color);
528
+ border-radius: 50%;
529
+ cursor: pointer;
530
+ transition: all var(--transition-fast);
531
+ flex-shrink: 0;
532
+ display: flex;
533
+ align-items: center;
534
+ justify-content: center;
535
+ margin-top: 2px;
536
+ background: var(--bg-primary);
537
+ }
538
+
539
+ .todo-checkbox:hover {
540
+ border-color: var(--apple-blue);
541
+ transform: scale(1.1);
542
+ }
543
+
544
+ .todo-checkbox.checked {
545
+ background: var(--apple-blue);
546
+ border-color: var(--apple-blue);
547
+ }
548
+
549
+ .todo-checkbox.checked::after {
550
+ content: '✓';
551
+ color: white;
552
+ font-weight: 600;
553
+ font-size: 14px;
554
+ }
555
+
556
+ .todo-content {
557
+ flex: 1;
558
+ }
559
+
560
+ .todo-header {
561
+ display: flex;
562
+ align-items: center;
563
+ gap: 10px;
564
+ margin-bottom: 8px;
565
+ }
566
+
567
+ .todo-title {
568
+ font-size: 16px;
569
+ font-weight: 500;
570
+ color: var(--text-primary);
571
+ transition: all var(--transition-fast);
572
+ letter-spacing: -0.2px;
573
+ line-height: 1.4;
574
+ }
575
+
576
+ .todo-item.completed .todo-title {
577
+ text-decoration: line-through;
578
+ color: var(--text-tertiary);
579
+ }
580
+
581
+ .priority-indicator {
582
+ padding: 4px 10px;
583
+ border-radius: 12px;
584
+ font-size: 11px;
585
+ font-weight: 600;
586
+ text-transform: uppercase;
587
+ letter-spacing: 0.5px;
588
+ }
589
+
590
+ .priority-indicator.low {
591
+ background: var(--priority-low);
592
+ color: white;
593
+ }
594
+
595
+ .priority-indicator.medium {
596
+ background: var(--priority-medium);
597
+ color: white;
598
+ }
599
+
600
+ .priority-indicator.high {
601
+ background: var(--priority-high);
602
+ color: white;
603
+ }
604
+
605
+ .todo-description {
606
+ color: var(--text-tertiary);
607
+ font-size: 14px;
608
+ margin-bottom: 12px;
609
+ line-height: 1.5;
610
+ }
611
+
612
+ .todo-meta {
613
+ display: flex;
614
+ gap: 16px;
615
+ align-items: center;
616
+ flex-wrap: wrap;
617
+ }
618
+
619
+ .todo-date,
620
+ .todo-category {
621
+ display: flex;
622
+ align-items: center;
623
+ gap: 6px;
624
+ color: var(--text-tertiary);
625
+ font-size: 13px;
626
+ font-weight: 500;
627
+ }
628
+
629
+ .todo-actions {
630
+ display: flex;
631
+ gap: 8px;
632
+ }
633
+
634
+ .action-btn {
635
+ width: 36px;
636
+ height: 36px;
637
+ border: none;
638
+ border-radius: 50%;
639
+ background: var(--bg-secondary);
640
+ color: var(--text-secondary);
641
+ cursor: pointer;
642
+ transition: all var(--transition-fast);
643
+ display: flex;
644
+ align-items: center;
645
+ justify-content: center;
646
+ font-size: 14px;
647
+ }
648
+
649
+ .action-btn:hover {
650
+ transform: scale(1.1);
651
+ }
652
+
653
+ .action-btn:active {
654
+ transform: scale(0.95);
655
+ }
656
+
657
+ .action-btn.edit:hover {
658
+ background: var(--apple-blue);
659
+ color: white;
660
+ }
661
+
662
+ .action-btn.delete:hover {
663
+ background: var(--apple-red);
664
+ color: white;
665
+ }
666
+
667
+ /* Empty State */
668
+ .empty-state {
669
+ text-align: center;
670
+ padding: 80px 20px;
671
+ color: var(--text-tertiary);
672
+ }
673
+
674
+ .empty-state i {
675
+ font-size: 64px;
676
+ margin-bottom: 20px;
677
+ opacity: 0.3;
678
+ }
679
+
680
+ .empty-state h3 {
681
+ font-size: 20px;
682
+ margin-bottom: 8px;
683
+ font-weight: 600;
684
+ color: var(--text-secondary);
685
+ }
686
+
687
+ .empty-state p {
688
+ font-size: 14px;
689
+ }
690
+
691
+ /* Modal */
692
+ .modal {
693
+ display: none;
694
+ position: fixed;
695
+ top: 0;
696
+ left: 0;
697
+ right: 0;
698
+ bottom: 0;
699
+ background: rgba(0, 0, 0, 0.3);
700
+ backdrop-filter: blur(20px);
701
+ -webkit-backdrop-filter: blur(20px);
702
+ z-index: 1000;
703
+ animation: fadeIn var(--transition-base) ease-out;
704
+ }
705
+
706
+ .modal.active {
707
+ display: flex;
708
+ align-items: center;
709
+ justify-content: center;
710
+ }
711
+
712
+ .modal-content {
713
+ background: var(--bg-primary);
714
+ border-radius: 20px;
715
+ padding: 32px;
716
+ max-width: 500px;
717
+ width: 90%;
718
+ max-height: 90vh;
719
+ overflow-y: auto;
720
+ animation: slideUp var(--transition-base) ease-out;
721
+ box-shadow: var(--shadow-xl);
722
+ border: 1px solid var(--separator-color);
723
+ }
724
+
725
+ .modal-header {
726
+ display: flex;
727
+ justify-content: space-between;
728
+ align-items: center;
729
+ margin-bottom: 24px;
730
+ }
731
+
732
+ .modal-title {
733
+ font-size: 24px;
734
+ font-weight: 600;
735
+ color: var(--text-primary);
736
+ letter-spacing: -0.5px;
737
+ }
738
+
739
+ .modal-close {
740
+ width: 36px;
741
+ height: 36px;
742
+ border: none;
743
+ border-radius: 50%;
744
+ background: var(--bg-secondary);
745
+ color: var(--text-secondary);
746
+ cursor: pointer;
747
+ transition: all var(--transition-fast);
748
+ font-size: 16px;
749
+ display: flex;
750
+ align-items: center;
751
+ justify-content: center;
752
+ }
753
+
754
+ .modal-close:hover {
755
+ background: var(--apple-red);
756
+ color: white;
757
+ transform: rotate(90deg);
758
+ }
759
+
760
+ /* Toast */
761
+ .toast {
762
+ position: fixed;
763
+ bottom: 32px;
764
+ right: 32px;
765
+ background: var(--bg-primary);
766
+ padding: 16px 20px;
767
+ border-radius: 16px;
768
+ box-shadow: var(--shadow-xl);
769
+ display: flex;
770
+ align-items: center;
771
+ gap: 12px;
772
+ transform: translateX(400px);
773
+ transition: transform var(--transition-base) ease-out;
774
+ z-index: 2000;
775
+ border: 1px solid var(--separator-color);
776
+ backdrop-filter: saturate(180%) blur(20px);
777
+ -webkit-backdrop-filter: saturate(180%) blur(20px);
778
+ }
779
+
780
+ .toast.show {
781
+ transform: translateX(0);
782
+ }
783
+
784
+ .toast-icon {
785
+ font-size: 20px;
786
+ }
787
+
788
+ .toast.success .toast-icon {
789
+ color: var(--apple-green);
790
+ }
791
+
792
+ .toast.error .toast-icon {
793
+ color: var(--apple-red);
794
+ }
795
+
796
+ .toast.info .toast-icon {
797
+ color: var(--apple-blue);
798
+ }
799
+
800
+ .toast-message {
801
+ font-size: 14px;
802
+ font-weight: 500;
803
+ color: var(--text-primary);
804
+ }
805
+
806
+ /* Animations */
807
+ @keyframes slideDown {
808
+ from {
809
+ opacity: 0;
810
+ transform: translateY(-20px);
811
+ }
812
+
813
+ to {
814
+ opacity: 1;
815
+ transform: translateY(0);
816
+ }
817
+ }
818
+
819
+ @keyframes slideIn {
820
+ from {
821
+ opacity: 0;
822
+ transform: translateX(-20px);
823
+ }
824
+
825
+ to {
826
+ opacity: 1;
827
+ transform: translateX(0);
828
+ }
829
+ }
830
+
831
+ @keyframes slideUp {
832
+ from {
833
+ opacity: 0;
834
+ transform: translateY(20px);
835
+ }
836
+
837
+ to {
838
+ opacity: 1;
839
+ transform: translateY(0);
840
+ }
841
+ }
842
+
843
+ @keyframes fadeIn {
844
+ from {
845
+ opacity: 0;
846
+ }
847
+
848
+ to {
849
+ opacity: 1;
850
+ }
851
+ }
852
+
853
+ /* Built with link */
854
+ .built-with {
855
+ color: var(--apple-blue);
856
+ font-size: 14px;
857
+ text-decoration: none;
858
+ transition: opacity var(--transition-fast);
859
+ font-weight: 500;
860
+ }
861
+
862
+ .built-with:hover {
863
+ opacity: 0.7;
864
+ text-decoration: none;
865
+ }
866
+
867
+ /* Responsive Design */
868
+ @media (max-width: 768px) {
869
+ .main-content {
870
+ grid-template-columns: 1fr;
871
+ }
872
+
873
+ .sidebar {
874
+ position: static;
875
+ }
876
+
877
+ .header-content {
878
+ flex-direction: column;
879
+ text-align: center;
880
+ }
881
+
882
+ .stats-container {
883
+ grid-template-columns: repeat(2, 1fr);
884
+ }
885
+
886
+ .search-filter-bar {
887
+ flex-direction: column;
888
+ }
889
+
890
+ .filter-tabs {
891
+ width: 100%;
892
+ justify-content: space-between;
893
+ }
894
+
895
+ .todo-item {
896
+ flex-direction: column;
897
+ align-items: flex-start;
898
+ }
899
+
900
+ .todo-actions {
901
+ width: 100%;
902
+ justify-content: flex-end;
903
+ margin-top: 12px;
904
+ }
905
+
906
+ .modal-content {
907
+ padding: 24px;
908
+ }
909
+
910
+ .toast {
911
+ right: 20px;
912
+ left: 20px;
913
+ transform: translateY(100px);
914
+ }
915
+
916
+ .toast.show {
917
+ transform: translateY(0);
918
+ }
919
+ }
920
+
921
+ /* Scrollbar Styling */
922
+ ::-webkit-scrollbar {
923
+ width: 8px;
924
+ height: 8px;
925
+ }
926
+
927
+ ::-webkit-scrollbar-track {
928
+ background: transparent;
929
+ }
930
+
931
+ ::-webkit-scrollbar-thumb {
932
+ background: var(--border-color);
933
+ border-radius: 4px;
934
+ }
935
+
936
+ ::-webkit-scrollbar-thumb:hover {
937
+ background: var(--apple-gray2);
938
+ }
939
+
940
+ /* Dark mode scrollbar */
941
+ [data-theme="dark"] ::-webkit-scrollbar-thumb {
942
+ background: var(--apple-gray3);
943
+ }
944
+
945
+ [data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
946
+ background: var(--apple-gray2);
947
+ }
948
+ </style>
949
+ </head>
950
+
951
+ <body>
952
+ <div class="container">
953
+ <header>
954
+ <div class="header-content">
955
+ <div class="logo">
956
+ <i class="fas fa-check-circle"></i>
957
+ <span>TaskFlow</span>
958
+ </div>
959
+ <div class="header-actions">
960
+ <button class="theme-toggle" onclick="toggleTheme()">
961
+ <i class="fas fa-moon"></i>
962
+ </button>
963
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with">
964
+ Built with anycoder
965
+ </a>
966
+ </div>
967
+ </div>
968
+ <div class="stats-container">
969
+ <div class="stat-card">
970
+ <div class="stat-number" id="totalTasks">0</div>
971
+ <div class="stat-label">Total Tasks</div>
972
+ </div>
973
+ <div class="stat-card">
974
+ <div class="stat-number" id="completedTasks">0</div>
975
+ <div class="stat-label">Completed</div>
976
+ </div>
977
+ <div class="stat-card">
978
+ <div class="stat-number" id="pendingTasks">0</div>
979
+ <div class="stat-label">Pending</div>
980
+ </div>
981
+ <div class="stat-card">
982
+ <div class="stat-number" id="completionRate">0%</div>
983
+ <div class="stat-label">Completion Rate</div>
984
+ </div>
985
+ </div>
986
+ </header>
987
+
988
+ <main class="main-content">
989
+ <aside class="sidebar">
990
+ <form class="add-task-form" id="addTaskForm">
991
+ <h3>Add New Task</h3>
992
+
993
+ <div class="form-group">
994
+ <label class="form-label">Task Title</label>
995
+ <input type="text" class="form-input" id="taskTitle" placeholder="Enter task title..." required>
996
+ </div>
997
+
998
+ <div class="form-group">
999
+ <label class="form-label">Description</label>
1000
+ <textarea class="form-textarea" id="taskDescription" placeholder="Add description..."></textarea>
1001
+ </div>
1002
+
1003
+ <div class="form-group">
1004
+ <label class="form-label">Priority</label>
1005
+ <div class="priority-selector">
1006
+ <button type="button" class="priority-btn low" data-priority="low">Low</button>
1007
+ <button type="button" class="priority-btn medium active" data-priority="medium">Medium</button>
1008
+ <button type="button" class="priority-btn high" data-priority="high">High</button>
1009
+ </div>
1010
+ </div>
1011
+
1012
+ <div class="form-group">
1013
+ <label class="form-label">Due Date</label>
1014
+ <input type="date" class="form-input" id="taskDate">
1015
+ </div>
1016
+
1017
+ <div class="form-group">
1018
+ <label class="form-label">Category</label>
1019
+ <div class="category-tags">
1020
+ <span class="category-tag active" data-category="personal">Personal</span>
1021
+ <span class="category-tag" data-category="work">Work</span>
1022
+ <span class="category-tag" data-category="shopping">Shopping</span>
1023
+ <span class="category-tag" data-category="health">Health</span>
1024
+ <span class="category-tag" data-category="other">Other</span>
1025
+ </div>
1026
+ </div>
1027
+
1028
+ <button type="submit" class="btn btn-primary">
1029
+ <i class="fas fa-plus"></i>
1030
+ Add Task
1031
+ </button>
1032
+ </form>
1033
+
1034
+ <div style="margin-top: 24px;">
1035
+ <button class="btn btn-primary" onclick="clearCompleted()" style="background: var(--apple-red);">
1036
+ <i class="fas fa-trash"></i>
1037
+ Clear Completed
1038
+ </button>
1039
+ </div>
1040
+ </aside>
1041
+
1042
+ <section class="content-area">
1043
+ <div class="search-filter-bar">
1044
+ <div class="search-box">
1045
+ <i class="fas fa-search search-icon"></i>
1046
+ <input type="text" class="search-input" id="searchInput" placeholder="Search tasks...">
1047
+ </div>
1048
+
1049
+ <div class="filter-tabs">
1050
+ <button class="filter-tab active" data-filter="all">All</button>
1051
+ <button class="filter-tab" data-filter="active">Active</button>
1052
+ <button class="filter-tab" data-filter="completed">Completed</button>
1053
+ </div>
1054
+
1055
+ <select class="sort-dropdown" id="sortDropdown">
1056
+ <option value="newest">Newest First</option>
1057
+ <option value="oldest">Oldest First</option>
1058
+ <option value="priority">Priority</option>
1059
+ <option value="date">Due Date</option>
1060
+ </select>
1061
+ </div>
1062
+
1063
+ <ul class="todo-list" id="todoList">
1064
+ <!-- Tasks will be dynamically added here -->
1065
+ </ul>
1066
+
1067
+ <div class="empty-state" id="emptyState" style="display: none;">
1068
+ <i class="fas fa-clipboard-list"></i>
1069
+ <h3>No tasks yet</h3>
1070
+ <p>Start by adding your first task!</p>
1071
+ </div>
1072
+ </section>
1073
+ </main>
1074
+ </div>
1075
+
1076
+ <!-- Edit Modal -->
1077
+ <div class="modal" id="editModal">
1078
+ <div class="modal-content">
1079
+ <div class="modal-header">
1080
+ <h2 class="modal-title">Edit Task</h2>
1081
+ <button class="modal-close" onclick="closeEditModal()">
1082
+ <i class="fas fa-times"></i>
1083
+ </button>
1084
+ </div>
1085
+ <form id="editTaskForm">
1086
+ <input type="hidden" id="editTaskId">
1087
+
1088
+ <div class="form-group">
1089
+ <label class="form-label">Task Title</label>
1090
+ <input type="text" class="form-input" id="editTaskTitle" required>
1091
+ </div>
1092
+
1093
+ <div class="form-group">
1094
+ <label class="form-label">Description</label>
1095
+ <textarea class="form-textarea" id="editTaskDescription"></textarea>
1096
+ </div>
1097
+
1098
+ <div class="form-group">
1099
+ <label class="form-label">Priority</label>
1100
+ <div class="priority-selector" id="editPrioritySelector">
1101
+ <button type="button" class="priority-btn low" data-priority="low">Low</button>
1102
+ <button type="button" class="priority-btn medium" data-priority="medium">Medium</button>
1103
+ <button type="button" class="priority-btn high" data-priority="high">High</button>
1104
+ </div>
1105
+ </div>
1106
+
1107
+ <div class="form-group">
1108
+ <label class="form-label">Due Date</label>
1109
+ <input type="date" class="form-input" id="editTaskDate">
1110
+ </div>
1111
+
1112
+ <div class="form-group">
1113
+ <label class="form-label">Category</label>
1114
+ <div class="category-tags" id="editCategoryTags">
1115
+ <span class="category-tag" data-category="personal">Personal</span>
1116
+ <span class="category-tag" data-category="work">Work</span>
1117
+ <span class="category-tag" data-category="shopping">Shopping</span>
1118
+ <span class="category-tag" data-category="health">Health</span>
1119
+ <span class="category-tag" data-category="other">Other</span>
1120
+ </div>
1121
+ </div>
1122
+
1123
+ <button type="submit" class="btn btn-primary">
1124
+ <i class="fas fa-save"></i>
1125
+ Save Changes
1126
+ </button>
1127
+ </form>
1128
+ </div>
1129
+ </div>
1130
+
1131
+ <!-- Toast Notification -->
1132
+ <div class="toast" id="toast">
1133
+ <i class="toast-icon fas fa-check-circle"></i>
1134
+ <div class="toast-message" id="toastMessage">Task added successfully!</div>
1135
+ </div>
1136
+
1137
+ <script>
1138
+ // State Management
1139
+ let todos = JSON.parse(localStorage.getItem('todos')) || [];
1140
+ let currentFilter = 'all';
1141
+ let currentSort = 'newest';
1142
+ let selectedPriority = 'medium';
1143
+ let selectedCategory = 'personal';
1144
+ let editingTaskId = null;
1145
+
1146
+ // Initialize
1147
+ document.addEventListener('DOMContentLoaded', () => {
1148
+ initializeApp();
1149
+ renderTodos();
1150
+ updateStats();
1151
+ });
1152
+
1153
+ function initializeApp() {
1154
+ // Theme
1155
+ const savedTheme = localStorage.getItem('theme') || 'light';
1156
+ document.documentElement.setAttribute('data-theme', savedTheme);
1157
+ updateThemeIcon(savedTheme);
1158
+
1159
+ // Event Listeners
1160
+ document.getElementById('addTaskForm').addEventListener('submit', handleAddTask);
1161
+ document.getElementById('editTaskForm').addEventListener('submit', handleEditTask);
1162
+ document.getElementById('searchInput').addEventListener('input', handleSearch);
1163
+ document.getElementById('sortDropdown').addEventListener('change', handleSort);
1164
+
1165
+ // Priority buttons
1166
+ document.querySelectorAll('.priority-btn').forEach(btn => {
1167
+ btn.addEventListener('click', (e) => {
1168
+ if (e.target.closest('#editPrioritySelector')) {
1169
+ document.querySelectorAll('#editPrioritySelector .priority-btn').forEach(b => b.classList.remove('active'));
1170
+ e.target.classList.add('active');
1171
+ } else {
1172
+ document.querySelectorAll('.priority-selector:not(#editPrioritySelector) .priority-btn').forEach(b => b.classList.remove('active'));
1173
+ e.target.classList.add('active');
1174
+ selectedPriority = e.target.dataset.priority;
1175
+ }
1176
+ });
1177
+ });
1178
+
1179
+ // Category tags
1180
+ document.querySelectorAll('.category-tag').forEach(tag => {
1181
+ tag.addEventListener('click', (e) => {
1182
+ if (e.target.closest('#editCategoryTags')) {
1183
+ document.querySelectorAll('#editCategoryTags .category-tag').forEach(t => t.classList.remove('active'));
1184
+ e.target.classList.add('active');
1185
+ } else {
1186
+ document.querySelectorAll('.category-tags:not(#editCategoryTags) .category-tag').forEach(t => t.classList.remove('active'));
1187
+ e.target.classList.add('active');
1188
+ selectedCategory = e.target.dataset.category;
1189
+ }
1190
+ });
1191
+ });
1192
+
1193
+ // Filter tabs
1194
+ document.querySelectorAll('.filter-tab').forEach(tab => {
1195
+ tab.addEventListener('click', (e) => {
1196
+ document.querySelectorAll('.filter-tab').forEach(t => t.classList.remove('active'));
1197
+ e.target.classList.add('active');
1198
+ currentFilter = e.target.dataset.filter;
1199
+ renderTodos();
1200
+ });
1201
+ });
1202
+
1203
+ // Drag and Drop
1204
+ enableDragAndDrop();
1205
+
1206
+ // Keyboard shortcuts
1207
+ document.addEventListener('keydown', (e) => {
1208
+ if (e.ctrlKey && e.key === 'n') {
1209
+ e.preventDefault();
1210
+ document.getElementById('taskTitle').focus();
1211
+ }
1212
+ if (e.key === 'Escape') {
1213
+ closeEditModal();
1214
+ }
1215
+ });
1216
+ }
1217
+
1218
+ function handleAddTask(e) {
1219
+ e.preventDefault();
1220
+
1221
+ const title = document.getElementById('taskTitle').value.trim();
1222
+ const description = document.getElementById('taskDescription').value.trim();
1223
+ const date = document.getElementById('taskDate').value;
1224
+
1225
+ if (!title) return;
1226
+
1227
+ const newTodo = {
1228
+ id: Date.now(),
1229
+ title,
1230
+ description,
1231
+ priority: selectedPriority,
1232
+ date,
1233
+ category: selectedCategory,
1234
+ completed: false,
1235
+ createdAt: new Date().toISOString()
1236
+ };
1237
+
1238
+ todos.unshift(newTodo);
1239
+ saveTodos();
1240
+ renderTodos();
1241
+ updateStats();
1242
+
1243
+ // Reset form
1244
+ document.getElementById('addTaskForm').reset();
1245
+ document.querySelectorAll('.priority-selector:not(#editPrioritySelector) .priority-btn').forEach(b => b.classList.remove('active'));
1246
+ document.querySelector('.priority-selector:not(#editPrioritySelector) .priority-btn.medium').classList.add('active');
1247
+ selectedPriority = 'medium';
1248
+
1249
+ showToast('Task added successfully!', 'success');
1250
+ }
1251
+
1252
+ function handleEditTask(e) {
1253
+ e.preventDefault();
1254
+
1255
+ const id = parseInt(document.getElementById('editTaskId').value);
1256
+ const taskIndex = todos.findIndex(t => t.id === id);
1257
+
1258
+ if (taskIndex === -1) return;
1259
+
1260
+ todos[taskIndex] = {
1261
+ ...todos[taskIndex],
1262
+ title: document.getElementById('editTaskTitle').value.trim(),
1263
+ description: document.getElementById('editTaskDescription').value.trim(),
1264
+ priority: document.querySelector('#editPrioritySelector .priority-btn.active').dataset.priority,
1265
+ date: document.getElementById('editTaskDate').value,
1266
+ category: document.querySelector('#editCategoryTags .category-tag.active').dataset.category
1267
+ };
1268
+
1269
+ saveTodos();
1270
+ renderTodos();
1271
+ updateStats();
1272
+ closeEditModal();
1273
+ showToast('Task updated successfully!', 'success');
1274
+ }
1275
+
1276
+ function toggleTask(id) {
1277
+ const task = todos.find(t => t.id === id);
1278
+ if (task) {
1279
+ task.completed = !task.completed;
1280
+ saveTodos();
1281
+ renderTodos();
1282
+ updateStats();
1283
+ }
1284
+ }
1285
+
1286
+ function deleteTask(id) {
1287
+ todos = todos.filter(t => t.id !== id);
1288
+ saveTodos();
1289
+ renderTodos();
1290
+ updateStats();
1291
+ showToast('Task deleted!', 'info');
1292
+ }
1293
+
1294
+ function openEditModal(id) {
1295
+ const task = todos.find(t => t.id === id);
1296
+ if (!task) return;
1297
+
1298
+ editingTaskId = id;
1299
+ document.getElementById('editTaskId').value = id;
1300
+ document.getElementById('editTaskTitle').value = task.title;
1301
+ document.getElementById('editTaskDescription').value = task.description;
1302
+ document.getElementById('editTaskDate').value = task.date;
1303
+
1304
+ // Set priority
1305
+ document.querySelectorAll('#editPrioritySelector .priority-btn').forEach(btn => {
1306
+ btn.classList.toggle('active', btn.dataset.priority === task.priority);
1307
+ });
1308
+
1309
+ // Set category
1310
+ document.querySelectorAll('#editCategoryTags .category-tag').forEach(tag => {
1311
+ tag.classList.toggle('active', tag.dataset.category === task.category);
1312
+ });
1313
+
1314
+ document.getElementById('editModal').classList.add('active');
1315
+ }
1316
+
1317
+ function closeEditModal() {
1318
+ document.getElementById('editModal').classList.remove('active');
1319
+ editingTaskId = null;
1320
+ }
1321
+
1322
+ function clearCompleted() {
1323
+ const completedCount = todos.filter(t => t.completed).length;
1324
+ if (completedCount === 0) {
1325
+ showToast('No completed tasks to clear!', 'info');
1326
+ return;
1327
+ }
1328
+
1329
+ if (confirm(`Are you sure you want to delete ${completedCount} completed task(s)?`)) {
1330
+ todos = todos.filter(t => !t.completed);
1331
+ saveTodos();
1332
+ renderTodos();
1333
+ updateStats();
1334
+ showToast(`Cleared ${completedCount} completed task(s)!`, 'success');
1335
+ }
1336
+ }
1337
+
1338
+ function handleSearch(e) {
1339
+ const searchTerm = e.target.value.toLowerCase();
1340
+ renderTodos(searchTerm);
1341
+ }
1342
+
1343
+ function handleSort(e) {
1344
+ currentSort = e.target.value;
1345
+ renderTodos();
1346
+ }
1347
+
1348
+ function renderTodos(searchTerm = '') {
1349
+ const todoList = document.getElementById('todoList');
1350
+ const emptyState = document.getElementById('emptyState');
1351
+
1352
+ let filteredTodos = [...todos];
1353
+
1354
+ // Apply filter
1355
+ if (currentFilter === 'active') {
1356
+ filteredTodos = filteredTodos.filter(t => !t.completed);
1357
+ } else if (currentFilter === 'completed') {
1358
+ filteredTodos = filteredTodos.filter(t => t.completed);
1359
+ }
1360
+
1361
+ // Apply search
1362
+ if (searchTerm) {
1363
+ filteredTodos = filteredTodos.filter(t =>
1364
+ t.title.toLowerCase().includes(searchTerm) ||
1365
+ t.description.toLowerCase().includes(searchTerm) ||
1366
+ t.category.toLowerCase().includes(searchTerm)
1367
+ );
1368
+ }
1369
+
1370
+ // Apply sorting
1371
+ filteredTodos.sort((a, b) => {
1372
+ switch (currentSort) {
1373
+ case 'oldest':
1374
+ return new Date(a.createdAt) - new Date(b.createdAt);
1375
+ case 'priority':
1376
+ const priorityOrder = { high: 0, medium: 1, low: 2 };
1377
+ return priorityOrder[a.priority] - priorityOrder[b.priority];
1378
+ case 'date':
1379
+ if (!a.date) return 1;
1380
+ if (!b.date) return -1;
1381
+ return new Date(a.date) - new Date(b.date);
1382
+ default: // newest
1383
+ return new Date(b.createdAt) - new Date(a.createdAt);
1384
+ }
1385
+ });
1386
+
1387
+ // Render
1388
+ if (filteredTodos.length === 0) {
1389
+ todoList.innerHTML = '';
1390
+ emptyState.style.display = 'block';
1391
+ } else {
1392
+ emptyState.style.display = 'none';
1393
+ todoList.innerHTML = filteredTodos.map(todo => `
1394
+ <li class="todo-item ${todo.completed ? 'completed' : ''}" draggable="true" data-id="${todo.id}">
1395
+ <div class="todo-checkbox ${todo.completed ? 'checked' : ''}" onclick="toggleTask(${todo.id})"></div>
1396
+ <div class="todo-content">
1397
+ <div class="todo-header">
1398
+ <div class="todo-title">${escapeHtml(todo.title)}</div>
1399
+ <span class="priority-indicator ${todo.priority}">${todo.priority}</span>
1400
+ </div>
1401
+ ${todo.description ? `<div class="todo-description">${escapeHtml(todo.description)}</div>` : ''}
1402
+ <div class="todo-meta">
1403
+ ${todo.date ? `
1404
+ <div class="todo-date">
1405
+ <i class="far fa-calendar"></i>
1406
+ ${formatDate(todo.date)}
1407
+ </div>
1408
+ ` : ''}
1409
+ <div class="todo-category">
1410
+ <i class="fas fa-tag"></i>
1411
+ ${todo.category}
1412
+ </div>
1413
+ </div>
1414
+ </div>
1415
+ <div class="todo-actions">
1416
+ <button class="action-btn edit" onclick="openEditModal(${todo.id})">
1417
+ <i class="fas fa-edit"></i>
1418
+ </button>
1419
+ <button class="action-btn delete" onclick="deleteTask(${todo.id})">
1420
+ <i class="fas fa-trash"></i>
1421
+ </button>
1422
+ </div>
1423
+ </li>
1424
+ `).join('');
1425
+
1426
+ // Re-enable drag and drop
1427
+ enableDragAndDrop();
1428
+ }
1429
+ }
1430
+
1431
+ function enableDragAndDrop() {
1432
+ const items = document.querySelectorAll('.todo-item');
1433
+ let draggedItem = null;
1434
+
1435
+ items.forEach(item => {
1436
+ item.addEventListener('dragstart', (e) => {
1437
+ draggedItem = item;
1438
+ item.classList.add('dragging');
1439
+ });
1440
+
1441
+ item.addEventListener('dragend', (e) => {
1442
+ item.classList.remove('dragging');
1443
+ });
1444
+
1445
+ item.addEventListener('dragover', (e) => {
1446
+ e.preventDefault();
1447
+ const afterElement = getDragAfterElement(e.currentTarget.parentElement, e.clientY);
1448
+ if (afterElement == null) {
1449
+ e.currentTarget.parentElement.appendChild(draggedItem);
1450
+ } else {
1451
+ e.currentTarget.parentElement.insertBefore(draggedItem, afterElement);
1452
+ }
1453
+ });
1454
+
1455
+ item.addEventListener('drop', (e) => {
1456
+ e.preventDefault();
1457
+ // Reorder todos array based on new DOM order
1458
+ const newOrder = Array.from(document.querySelectorAll('.todo-item')).map(el =>
1459
+ parseInt(el.dataset.id)
1460
+ );
1461
+
1462
+ const reorderedTodos = [];
1463
+ newOrder.forEach(id => {
1464
+ const todo = todos.find(t => t