akhaliq HF Staff commited on
Commit
c2c74f9
·
verified ·
1 Parent(s): ad945a4

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +1415 -19
index.html CHANGED
@@ -1,19 +1,1415 @@
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>FlowTask - Advanced Todo Manager</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-blue: #007AFF;
12
+ --apple-blue-dark: #0051D5;
13
+ --apple-green: #34C759;
14
+ --apple-red: #FF3B30;
15
+ --apple-orange: #FF9500;
16
+ --apple-yellow: #FFCC00;
17
+ --apple-purple: #AF52DE;
18
+ --apple-gray: #8E8E93;
19
+ --apple-gray-light: #C7C7CC;
20
+ --apple-gray-ultralight: #F2F2F7;
21
+ --apple-background: #FFFFFF;
22
+ --apple-surface: #F9F9F9;
23
+ --apple-border: rgba(0, 0, 0, 0.1);
24
+ --apple-text-primary: #000000;
25
+ --apple-text-secondary: #3C3C43;
26
+ --apple-text-tertiary: #3C3C4399;
27
+ --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
28
+ --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07);
29
+ --shadow-heavy: 0 10px 15px rgba(0, 0, 0, 0.1);
30
+ --radius-small: 8px;
31
+ --radius-medium: 12px;
32
+ --radius-large: 20px;
33
+ --radius-xl: 28px;
34
+ --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
35
+ --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
36
+ }
37
+
38
+ [data-theme="dark"] {
39
+ --apple-blue: #0A84FF;
40
+ --apple-blue-dark: #409CFF;
41
+ --apple-green: #30D158;
42
+ --apple-red: #FF453A;
43
+ --apple-orange: #FF9F0A;
44
+ --apple-yellow: #FFD60A;
45
+ --apple-purple: #BF5AF2;
46
+ --apple-gray: #8E8E93;
47
+ --apple-gray-light: #48484A;
48
+ --apple-gray-ultralight: #1C1C1E;
49
+ --apple-background: #000000;
50
+ --apple-surface: #1C1C1E;
51
+ --apple-border: rgba(255, 255, 255, 0.08);
52
+ --apple-text-primary: #FFFFFF;
53
+ --apple-text-secondary: #EBEBF5;
54
+ --apple-text-tertiary: #EBEBF599;
55
+ --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.3);
56
+ --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.2);
57
+ --shadow-heavy: 0 10px 15px rgba(0, 0, 0, 0.3);
58
+ }
59
+
60
+ * {
61
+ margin: 0;
62
+ padding: 0;
63
+ box-sizing: border-box;
64
+ }
65
+
66
+ body {
67
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
68
+ background: var(--apple-surface);
69
+ min-height: 100vh;
70
+ color: var(--apple-text-primary);
71
+ transition: background-color var(--transition-medium);
72
+ -webkit-font-smoothing: antialiased;
73
+ -moz-osx-font-smoothing: grayscale;
74
+ }
75
+
76
+ .apple-bg {
77
+ position: fixed;
78
+ top: 0;
79
+ left: 0;
80
+ right: 0;
81
+ bottom: 0;
82
+ background: linear-gradient(135deg, var(--apple-surface) 0%, var(--apple-background) 100%);
83
+ z-index: -1;
84
+ }
85
+
86
+ [data-theme="dark"] .apple-bg {
87
+ background: linear-gradient(135deg, #000000 0%, #1C1C1E 100%);
88
+ }
89
+
90
+ .apple-blur {
91
+ position: fixed;
92
+ top: 0;
93
+ left: 0;
94
+ right: 0;
95
+ bottom: 0;
96
+ background: radial-gradient(ellipse at top, rgba(0, 122, 255, 0.1) 0%, transparent 50%);
97
+ z-index: -1;
98
+ opacity: 0.5;
99
+ }
100
+
101
+ [data-theme="dark"] .apple-blur {
102
+ background: radial-gradient(ellipse at top, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
103
+ }
104
+
105
+ .container {
106
+ max-width: 1200px;
107
+ margin: 0 auto;
108
+ padding: 20px;
109
+ }
110
+
111
+ header {
112
+ text-align: center;
113
+ padding: 40px 0;
114
+ position: relative;
115
+ }
116
+
117
+ .header-content {
118
+ display: inline-block;
119
+ backdrop-filter: blur(20px);
120
+ -webkit-backdrop-filter: blur(20px);
121
+ background: rgba(255, 255, 255, 0.7);
122
+ border-radius: var(--radius-xl);
123
+ padding: 30px 50px;
124
+ border: 1px solid var(--apple-border);
125
+ box-shadow: var(--shadow-medium);
126
+ }
127
+
128
+ [data-theme="dark"] .header-content {
129
+ background: rgba(28, 28, 30, 0.7);
130
+ }
131
+
132
+ h1 {
133
+ font-size: 2.5rem;
134
+ font-weight: 700;
135
+ margin-bottom: 8px;
136
+ letter-spacing: -0.02em;
137
+ background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
138
+ -webkit-background-clip: text;
139
+ -webkit-text-fill-color: transparent;
140
+ background-clip: text;
141
+ }
142
+
143
+ .subtitle {
144
+ font-size: 1rem;
145
+ color: var(--apple-text-secondary);
146
+ font-weight: 400;
147
+ margin-bottom: 20px;
148
+ }
149
+
150
+ .header-actions {
151
+ display: flex;
152
+ justify-content: center;
153
+ gap: 12px;
154
+ flex-wrap: wrap;
155
+ }
156
+
157
+ .apple-btn {
158
+ background: var(--apple-background);
159
+ border: 1px solid var(--apple-border);
160
+ color: var(--apple-text-primary);
161
+ padding: 10px 20px;
162
+ border-radius: var(--radius-large);
163
+ cursor: pointer;
164
+ transition: all var(--transition-fast);
165
+ font-size: 0.9rem;
166
+ font-weight: 500;
167
+ backdrop-filter: blur(10px);
168
+ -webkit-backdrop-filter: blur(10px);
169
+ display: inline-flex;
170
+ align-items: center;
171
+ gap: 8px;
172
+ }
173
+
174
+ .apple-btn:hover {
175
+ background: var(--apple-gray-ultralight);
176
+ transform: scale(1.02);
177
+ box-shadow: var(--shadow-medium);
178
+ }
179
+
180
+ [data-theme="dark"] .apple-btn:hover {
181
+ background: var(--apple-gray-light);
182
+ }
183
+
184
+ .main-content {
185
+ display: grid;
186
+ grid-template-columns: 1fr 380px;
187
+ gap: 30px;
188
+ margin-top: 40px;
189
+ }
190
+
191
+ @media (max-width: 1024px) {
192
+ .main-content {
193
+ grid-template-columns: 1fr;
194
+ }
195
+ }
196
+
197
+ .apple-card {
198
+ background: var(--apple-background);
199
+ border-radius: var(--radius-large);
200
+ padding: 30px;
201
+ box-shadow: var(--shadow-light);
202
+ border: 1px solid var(--apple-border);
203
+ backdrop-filter: blur(20px);
204
+ -webkit-backdrop-filter: blur(20px);
205
+ }
206
+
207
+ .input-group {
208
+ display: flex;
209
+ gap: 12px;
210
+ margin-bottom: 24px;
211
+ }
212
+
213
+ .apple-input {
214
+ flex: 1;
215
+ padding: 14px 20px;
216
+ border: 1px solid var(--apple-border);
217
+ border-radius: var(--radius-medium);
218
+ font-size: 1rem;
219
+ transition: all var(--transition-fast);
220
+ background: var(--apple-surface);
221
+ color: var(--apple-text-primary);
222
+ }
223
+
224
+ .apple-input:focus {
225
+ outline: none;
226
+ border-color: var(--apple-blue);
227
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
228
+ }
229
+
230
+ .apple-input::placeholder {
231
+ color: var(--apple-text-tertiary);
232
+ }
233
+
234
+ .input-options {
235
+ display: flex;
236
+ gap: 12px;
237
+ margin-bottom: 24px;
238
+ flex-wrap: wrap;
239
+ }
240
+
241
+ .apple-select {
242
+ padding: 10px 16px;
243
+ border: 1px solid var(--apple-border);
244
+ border-radius: var(--radius-small);
245
+ background: var(--apple-surface);
246
+ color: var(--apple-text-primary);
247
+ cursor: pointer;
248
+ transition: all var(--transition-fast);
249
+ font-size: 0.9rem;
250
+ }
251
+
252
+ .apple-select:focus {
253
+ outline: none;
254
+ border-color: var(--apple-blue);
255
+ }
256
+
257
+ .apple-btn-primary {
258
+ background: var(--apple-blue);
259
+ color: white;
260
+ border: none;
261
+ padding: 14px 28px;
262
+ border-radius: var(--radius-medium);
263
+ font-weight: 600;
264
+ transition: all var(--transition-fast);
265
+ display: inline-flex;
266
+ align-items: center;
267
+ gap: 8px;
268
+ cursor: pointer;
269
+ }
270
+
271
+ .apple-btn-primary:hover {
272
+ background: var(--apple-blue-dark);
273
+ transform: translateY(-1px);
274
+ box-shadow: var(--shadow-medium);
275
+ }
276
+
277
+ .apple-search {
278
+ position: relative;
279
+ margin-bottom: 24px;
280
+ }
281
+
282
+ .apple-search-input {
283
+ width: 100%;
284
+ padding: 12px 45px 12px 20px;
285
+ border: 1px solid var(--apple-border);
286
+ border-radius: var(--radius-medium);
287
+ background: var(--apple-surface);
288
+ color: var(--apple-text-primary);
289
+ transition: all var(--transition-fast);
290
+ }
291
+
292
+ .apple-search-input:focus {
293
+ outline: none;
294
+ border-color: var(--apple-blue);
295
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
296
+ }
297
+
298
+ .apple-search-icon {
299
+ position: absolute;
300
+ right: 15px;
301
+ top: 50%;
302
+ transform: translateY(-50%);
303
+ color: var(--apple-gray);
304
+ pointer-events: none;
305
+ }
306
+
307
+ .apple-tabs {
308
+ display: flex;
309
+ gap: 8px;
310
+ margin-bottom: 24px;
311
+ padding: 4px;
312
+ background: var(--apple-surface);
313
+ border-radius: var(--radius-medium);
314
+ }
315
+
316
+ .apple-tab {
317
+ flex: 1;
318
+ padding: 10px 16px;
319
+ background: transparent;
320
+ border: none;
321
+ color: var(--apple-text-secondary);
322
+ cursor: pointer;
323
+ transition: all var(--transition-fast);
324
+ font-weight: 500;
325
+ border-radius: var(--radius-small);
326
+ font-size: 0.9rem;
327
+ }
328
+
329
+ .apple-tab:hover {
330
+ background: var(--apple-gray-ultralight);
331
+ }
332
+
333
+ [data-theme="dark"] .apple-tab:hover {
334
+ background: var(--apple-gray-light);
335
+ }
336
+
337
+ .apple-tab.active {
338
+ background: var(--apple-background);
339
+ color: var(--apple-blue);
340
+ box-shadow: var(--shadow-light);
341
+ }
342
+
343
+ .todo-list {
344
+ list-style: none;
345
+ max-height: 500px;
346
+ overflow-y: auto;
347
+ padding-right: 5px;
348
+ }
349
+
350
+ .todo-list::-webkit-scrollbar {
351
+ width: 6px;
352
+ }
353
+
354
+ .todo-list::-webkit-scrollbar-track {
355
+ background: transparent;
356
+ }
357
+
358
+ .todo-list::-webkit-scrollbar-thumb {
359
+ background: var(--apple-gray-light);
360
+ border-radius: 10px;
361
+ }
362
+
363
+ .todo-item {
364
+ background: var(--apple-surface);
365
+ border: 1px solid var(--apple-border);
366
+ border-radius: var(--radius-medium);
367
+ padding: 16px;
368
+ margin-bottom: 12px;
369
+ display: flex;
370
+ align-items: center;
371
+ gap: 16px;
372
+ transition: all var(--transition-fast);
373
+ cursor: move;
374
+ position: relative;
375
+ }
376
+
377
+ .todo-item:hover {
378
+ transform: translateX(4px);
379
+ box-shadow: var(--shadow-medium);
380
+ border-color: var(--apple-gray-light);
381
+ }
382
+
383
+ .todo-item.dragging {
384
+ opacity: 0.5;
385
+ transform: rotate(2deg);
386
+ }
387
+
388
+ .todo-item.completed {
389
+ opacity: 0.6;
390
+ }
391
+
392
+ .todo-item.completed .todo-text {
393
+ text-decoration: line-through;
394
+ color: var(--apple-text-tertiary);
395
+ }
396
+
397
+ .apple-checkbox {
398
+ width: 22px;
399
+ height: 22px;
400
+ cursor: pointer;
401
+ accent-color: var(--apple-blue);
402
+ }
403
+
404
+ .todo-content {
405
+ flex: 1;
406
+ }
407
+
408
+ .todo-text {
409
+ font-size: 1rem;
410
+ margin-bottom: 6px;
411
+ color: var(--apple-text-primary);
412
+ font-weight: 400;
413
+ }
414
+
415
+ .todo-meta {
416
+ display: flex;
417
+ gap: 10px;
418
+ align-items: center;
419
+ font-size: 0.85rem;
420
+ color: var(--apple-text-tertiary);
421
+ }
422
+
423
+ .priority-badge {
424
+ padding: 3px 10px;
425
+ border-radius: var(--radius-small);
426
+ font-size: 0.75rem;
427
+ font-weight: 600;
428
+ text-transform: uppercase;
429
+ letter-spacing: 0.5px;
430
+ }
431
+
432
+ .priority-high {
433
+ background: rgba(255, 59, 48, 0.15);
434
+ color: var(--apple-red);
435
+ }
436
+
437
+ .priority-medium {
438
+ background: rgba(255, 149, 0, 0.15);
439
+ color: var(--apple-orange);
440
+ }
441
+
442
+ .priority-low {
443
+ background: rgba(0, 122, 255, 0.15);
444
+ color: var(--apple-blue);
445
+ }
446
+
447
+ .category-tag {
448
+ padding: 3px 10px;
449
+ border-radius: var(--radius-small);
450
+ font-size: 0.75rem;
451
+ background: rgba(175, 82, 222, 0.15);
452
+ color: var(--apple-purple);
453
+ font-weight: 500;
454
+ }
455
+
456
+ .todo-actions {
457
+ display: flex;
458
+ gap: 8px;
459
+ }
460
+
461
+ .action-btn {
462
+ width: 36px;
463
+ height: 36px;
464
+ border: none;
465
+ background: transparent;
466
+ color: var(--apple-gray);
467
+ cursor: pointer;
468
+ border-radius: var(--radius-small);
469
+ transition: all var(--transition-fast);
470
+ display: flex;
471
+ align-items: center;
472
+ justify-content: center;
473
+ }
474
+
475
+ .action-btn:hover {
476
+ background: var(--apple-gray-ultralight);
477
+ color: var(--apple-blue);
478
+ }
479
+
480
+ [data-theme="dark"] .action-btn:hover {
481
+ background: var(--apple-gray-light);
482
+ }
483
+
484
+ .action-btn.delete:hover {
485
+ color: var(--apple-red);
486
+ }
487
+
488
+ .sidebar {
489
+ display: flex;
490
+ flex-direction: column;
491
+ gap: 20px;
492
+ }
493
+
494
+ .stats-card {
495
+ background: var(--apple-background);
496
+ border-radius: var(--radius-large);
497
+ padding: 28px;
498
+ box-shadow: var(--shadow-light);
499
+ border: 1px solid var(--apple-border);
500
+ }
501
+
502
+ .stats-title {
503
+ font-size: 1.2rem;
504
+ font-weight: 600;
505
+ margin-bottom: 20px;
506
+ color: var(--apple-text-primary);
507
+ display: flex;
508
+ align-items: center;
509
+ gap: 8px;
510
+ }
511
+
512
+ .stat-item {
513
+ display: flex;
514
+ justify-content: space-between;
515
+ align-items: center;
516
+ margin-bottom: 16px;
517
+ padding-bottom: 16px;
518
+ border-bottom: 1px solid var(--apple-border);
519
+ }
520
+
521
+ .stat-item:last-child {
522
+ border-bottom: none;
523
+ margin-bottom: 0;
524
+ padding-bottom: 0;
525
+ }
526
+
527
+ .stat-label {
528
+ color: var(--apple-text-secondary);
529
+ font-size: 0.9rem;
530
+ font-weight: 400;
531
+ }
532
+
533
+ .stat-value {
534
+ font-size: 1.8rem;
535
+ font-weight: 700;
536
+ color: var(--apple-blue);
537
+ }
538
+
539
+ .progress-bar {
540
+ width: 100%;
541
+ height: 6px;
542
+ background: var(--apple-gray-ultralight);
543
+ border-radius: 10px;
544
+ overflow: hidden;
545
+ margin-top: 10px;
546
+ }
547
+
548
+ .progress-fill {
549
+ height: 100%;
550
+ background: linear-gradient(90deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
551
+ border-radius: 10px;
552
+ transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
553
+ }
554
+
555
+ .apple-btn-danger {
556
+ background: var(--apple-red);
557
+ color: white;
558
+ border: none;
559
+ padding: 14px 28px;
560
+ border-radius: var(--radius-medium);
561
+ font-weight: 600;
562
+ transition: all var(--transition-fast);
563
+ display: inline-flex;
564
+ align-items: center;
565
+ gap: 8px;
566
+ cursor: pointer;
567
+ width: 100%;
568
+ justify-content: center;
569
+ }
570
+
571
+ .apple-btn-danger:hover {
572
+ background: #E6362F;
573
+ transform: translateY(-1px);
574
+ box-shadow: var(--shadow-medium);
575
+ }
576
+
577
+ .empty-state {
578
+ text-align: center;
579
+ padding: 80px 20px;
580
+ color: var(--apple-text-tertiary);
581
+ }
582
+
583
+ .empty-icon {
584
+ font-size: 4rem;
585
+ margin-bottom: 20px;
586
+ opacity: 0.3;
587
+ color: var(--apple-gray);
588
+ }
589
+
590
+ .empty-state h3 {
591
+ font-size: 1.3rem;
592
+ font-weight: 600;
593
+ margin-bottom: 8px;
594
+ color: var(--apple-text-secondary);
595
+ }
596
+
597
+ .apple-toast {
598
+ position: fixed;
599
+ bottom: 30px;
600
+ right: 30px;
601
+ background: var(--apple-background);
602
+ padding: 16px 24px;
603
+ border-radius: var(--radius-large);
604
+ box-shadow: var(--shadow-heavy);
605
+ display: flex;
606
+ align-items: center;
607
+ gap: 12px;
608
+ transform: translateX(400px);
609
+ transition: transform var(--transition-medium);
610
+ z-index: 1000;
611
+ border: 1px solid var(--apple-border);
612
+ backdrop-filter: blur(20px);
613
+ -webkit-backdrop-filter: blur(20px);
614
+ }
615
+
616
+ .apple-toast.show {
617
+ transform: translateX(0);
618
+ }
619
+
620
+ .toast-icon {
621
+ font-size: 1.3rem;
622
+ }
623
+
624
+ .apple-toast.success .toast-icon {
625
+ color: var(--apple-green);
626
+ }
627
+
628
+ .apple-toast.error .toast-icon {
629
+ color: var(--apple-red);
630
+ }
631
+
632
+ .apple-modal {
633
+ position: fixed;
634
+ top: 0;
635
+ left: 0;
636
+ width: 100%;
637
+ height: 100%;
638
+ background: rgba(0, 0, 0, 0.3);
639
+ display: none;
640
+ align-items: center;
641
+ justify-content: center;
642
+ z-index: 2000;
643
+ backdrop-filter: blur(10px);
644
+ -webkit-backdrop-filter: blur(10px);
645
+ }
646
+
647
+ .apple-modal.active {
648
+ display: flex;
649
+ }
650
+
651
+ .modal-content {
652
+ background: var(--apple-background);
653
+ border-radius: var(--radius-xl);
654
+ padding: 32px;
655
+ max-width: 500px;
656
+ width: 90%;
657
+ box-shadow: var(--shadow-heavy);
658
+ border: 1px solid var(--apple-border);
659
+ animation: modalSlideIn var(--transition-medium);
660
+ }
661
+
662
+ .modal-header {
663
+ display: flex;
664
+ justify-content: space-between;
665
+ align-items: center;
666
+ margin-bottom: 24px;
667
+ }
668
+
669
+ .modal-title {
670
+ font-size: 1.5rem;
671
+ font-weight: 600;
672
+ color: var(--apple-text-primary);
673
+ }
674
+
675
+ .modal-close {
676
+ background: none;
677
+ border: none;
678
+ font-size: 1.5rem;
679
+ cursor: pointer;
680
+ color: var(--apple-gray);
681
+ transition: color var(--transition-fast);
682
+ width: 32px;
683
+ height: 32px;
684
+ border-radius: var(--radius-small);
685
+ display: flex;
686
+ align-items: center;
687
+ justify-content: center;
688
+ }
689
+
690
+ .modal-close:hover {
691
+ color: var(--apple-red);
692
+ background: var(--apple-gray-ultralight);
693
+ }
694
+
695
+ [data-theme="dark"] .modal-close:hover {
696
+ background: var(--apple-gray-light);
697
+ }
698
+
699
+ .modal-body {
700
+ margin-bottom: 24px;
701
+ }
702
+
703
+ .modal-input {
704
+ width: 100%;
705
+ padding: 14px;
706
+ border: 1px solid var(--apple-border);
707
+ border-radius: var(--radius-medium);
708
+ background: var(--apple-surface);
709
+ color: var(--apple-text-primary);
710
+ margin-bottom: 16px;
711
+ transition: all var(--transition-fast);
712
+ }
713
+
714
+ .modal-input:focus {
715
+ outline: none;
716
+ border-color: var(--apple-blue);
717
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
718
+ }
719
+
720
+ .modal-footer {
721
+ display: flex;
722
+ justify-content: flex-end;
723
+ gap: 12px;
724
+ }
725
+
726
+ .apple-btn-secondary {
727
+ background: var(--apple-gray-ultralight);
728
+ color: var(--apple-text-primary);
729
+ border: 1px solid var(--apple-border);
730
+ padding: 12px 24px;
731
+ border-radius: var(--radius-medium);
732
+ font-weight: 500;
733
+ transition: all var(--transition-fast);
734
+ cursor: pointer;
735
+ }
736
+
737
+ .apple-btn-secondary:hover {
738
+ background: var(--apple-gray-light);
739
+ color: var(--apple-text-primary);
740
+ }
741
+
742
+ [data-theme="dark"] .apple-btn-secondary {
743
+ background: var(--apple-gray-light);
744
+ }
745
+
746
+ [data-theme="dark"] .apple-btn-secondary:hover {
747
+ background: var(--apple-gray);
748
+ }
749
+
750
+ .built-with {
751
+ color: var(--apple-text-secondary);
752
+ text-decoration: none;
753
+ transition: all var(--transition-fast);
754
+ display: inline-block;
755
+ margin-top: 12px;
756
+ font-size: 0.9rem;
757
+ opacity: 0.8;
758
+ }
759
+
760
+ .built-with:hover {
761
+ opacity: 1;
762
+ color: var(--apple-blue);
763
+ }
764
+
765
+ @keyframes modalSlideIn {
766
+ from {
767
+ opacity: 0;
768
+ transform: scale(0.95) translateY(20px);
769
+ }
770
+
771
+ to {
772
+ opacity: 1;
773
+ transform: scale(1) translateY(0);
774
+ }
775
+ }
776
+
777
+ @media (max-width: 640px) {
778
+ h1 {
779
+ font-size: 2rem;
780
+ }
781
+
782
+ .header-content {
783
+ padding: 20px 30px;
784
+ }
785
+
786
+ .input-group {
787
+ flex-direction: column;
788
+ }
789
+
790
+ .apple-tabs {
791
+ overflow-x: auto;
792
+ }
793
+
794
+ .todo-item {
795
+ flex-wrap: wrap;
796
+ }
797
+
798
+ .todo-actions {
799
+ width: 100%;
800
+ justify-content: flex-end;
801
+ }
802
+
803
+ .apple-toast {
804
+ right: 20px;
805
+ left: 20px;
806
+ bottom: 20px;
807
+ }
808
+ }
809
+
810
+ /* Animations */
811
+ @keyframes slideDown {
812
+ from {
813
+ opacity: 0;
814
+ transform: translateY(-20px);
815
+ }
816
+
817
+ to {
818
+ opacity: 1;
819
+ transform: translateY(0);
820
+ }
821
+ }
822
+
823
+ @keyframes slideUp {
824
+ from {
825
+ opacity: 0;
826
+ transform: translateY(20px);
827
+ }
828
+
829
+ to {
830
+ opacity: 1;
831
+ transform: translateY(0);
832
+ }
833
+ }
834
+
835
+ @keyframes slideIn {
836
+ from {
837
+ opacity: 0;
838
+ transform: translateX(-10px);
839
+ }
840
+
841
+ to {
842
+ opacity: 1;
843
+ transform: translateX(0);
844
+ }
845
+ }
846
+ </style>
847
+ </head>
848
+
849
+ <body>
850
+ <div class="apple-bg"></div>
851
+ <div class="apple-blur"></div>
852
+
853
+ <header>
854
+ <div class="header-content">
855
+ <h1>FlowTask</h1>
856
+ <p class="subtitle">Organize your life with elegance</p>
857
+ <div class="header-actions">
858
+ <button class="apple-btn" onclick="toggleTheme()">
859
+ <i class="fas fa-moon"></i> <span id="themeText">Dark</span>
860
+ </button>
861
+ <button class="apple-btn" onclick="exportTodos()">
862
+ <i class="fas fa-download"></i> Export
863
+ </button>
864
+ <button class="apple-btn" onclick="document.getElementById('importFile').click()">
865
+ <i class="fas fa-upload"></i> Import
866
+ </button>
867
+ <input type="file" id="importFile" style="display: none;" accept=".json" onchange="importTodos(event)">
868
+ </div>
869
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with">
870
+ Built with anycoder
871
+ </a>
872
+ </div>
873
+ </header>
874
+
875
+ <div class="container">
876
+ <div class="main-content">
877
+ <section class="apple-card">
878
+ <div class="input-group">
879
+ <input type="text" class="apple-input" id="todoInput" placeholder="What needs to be done today?" onkeypress="handleKeyPress(event)">
880
+ <button class="apple-btn-primary" onclick="addTodo()">
881
+ <i class="fas fa-plus"></i> Add Task
882
+ </button>
883
+ </div>
884
+
885
+ <div class="input-options">
886
+ <select class="apple-select" id="prioritySelect">
887
+ <option value="low">Low</option>
888
+ <option value="medium" selected>Medium</option>
889
+ <option value="high">High</option>
890
+ </select>
891
+ <select class="apple-select" id="categorySelect">
892
+ <option value="personal">Personal</option>
893
+ <option value="work">Work</option>
894
+ <option value="shopping">Shopping</option>
895
+ <option value="health">Health</option>
896
+ <option value="education">Education</option>
897
+ <option value="other">Other</option>
898
+ </select>
899
+ <input type="date" class="apple-select" id="dueDateInput">
900
+ </div>
901
+
902
+ <div class="apple-search">
903
+ <input type="text" class="apple-search-input" id="searchInput" placeholder="Search tasks..." oninput="searchTodos()">
904
+ <i class="fas fa-search apple-search-icon"></i>
905
+ </div>
906
+
907
+ <div class="apple-tabs">
908
+ <button class="apple-tab active" onclick="filterTodos('all')">All Tasks</button>
909
+ <button class="apple-tab" onclick="filterTodos('active')">Active</button>
910
+ <button class="apple-tab" onclick="filterTodos('completed')">Completed</button>
911
+ <button class="apple-tab" onclick="filterTodos('today')">Due Today</button>
912
+ </div>
913
+
914
+ <ul class="todo-list" id="todoList"></ul>
915
+
916
+ <div class="empty-state" id="emptyState" style="display: none;">
917
+ <div class="empty-icon">
918
+ <i class="fas fa-clipboard-list"></i>
919
+ </div>
920
+ <h3>No tasks yet</h3>
921
+ <p>Start adding tasks to organize your day!</p>
922
+ </div>
923
+ </section>
924
+
925
+ <aside class="sidebar">
926
+ <div class="stats-card">
927
+ <h3 class="stats-title">📊 Statistics</h3>
928
+ <div class="stat-item">
929
+ <span class="stat-label">Total Tasks</span>
930
+ <span class="stat-value" id="totalTasks">0</span>
931
+ </div>
932
+ <div class="stat-item">
933
+ <span class="stat-label">Completed</span>
934
+ <span class="stat-value" id="completedTasks">0</span>
935
+ </div>
936
+ <div class="stat-item">
937
+ <span class="stat-label">Active</span>
938
+ <span class="stat-value" id="activeTasks">0</span>
939
+ </div>
940
+ <div class="stat-item">
941
+ <span class="stat-label">Progress</span>
942
+ <div style="flex: 1; margin-left: 20px;">
943
+ <div class="progress-bar">
944
+ <div class="progress-fill" id="progressFill" style="width: 0%"></div>
945
+ </div>
946
+ </div>
947
+ </div>
948
+ </div>
949
+
950
+ <div class="stats-card">
951
+ <h3 class="stats-title">🏆 Productivity</h3>
952
+ <div class="stat-item">
953
+ <span class="stat-label">Tasks Completed Today</span>
954
+ <span class="stat-value" id="todayCompleted">0</span>
955
+ </div>
956
+ <div class="stat-item">
957
+ <span class="stat-label">Streak Days</span>
958
+ <span class="stat-value" id="streakDays">0</span>
959
+ </div>
960
+ <div class="stat-item">
961
+ <span class="stat-label">Completion Rate</span>
962
+ <span class="stat-value" id="completionRate">0%</span>
963
+ </div>
964
+ </div>
965
+
966
+ <button class="apple-btn-danger" onclick="clearCompleted()">
967
+ <i class="fas fa-trash"></i> Clear Completed
968
+ </button>
969
+ </aside>
970
+ </div>
971
+ </div>
972
+
973
+ <div class="apple-toast" id="toast">
974
+ <i class="toast-icon fas"></i>
975
+ <span id="toastMessage"></span>
976
+ </div>
977
+
978
+ <div class="apple-modal" id="editModal">
979
+ <div class="modal-content">
980
+ <div class="modal-header">
981
+ <h2 class="modal-title">Edit Task</h2>
982
+ <button class="modal-close" onclick="closeEditModal()">
983
+ <i class="fas fa-times"></i>
984
+ </button>
985
+ </div>
986
+ <div class="modal-body">
987
+ <input type="text" class="modal-input" id="editInput" placeholder="Task description">
988
+ <select class="modal-input" id="editPriority">
989
+ <option value="low">Low Priority</option>
990
+ <option value="medium">Medium Priority</option>
991
+ <option value="high">High Priority</option>
992
+ </select>
993
+ <select class="modal-input" id="editCategory">
994
+ <option value="personal">Personal</option>
995
+ <option value="work">Work</option>
996
+ <option value="shopping">Shopping</option>
997
+ <option value="health">Health</option>
998
+ <option value="education">Education</option>
999
+ <option value="other">Other</option>
1000
+ </select>
1001
+ <input type="date" class="modal-input" id="editDueDate">
1002
+ </div>
1003
+ <div class="modal-footer">
1004
+ <button class="apple-btn-secondary" onclick="closeEditModal()">Cancel</button>
1005
+ <button class="apple-btn-primary" onclick="saveEdit()">
1006
+ <i class="fas fa-save"></i> Save Changes
1007
+ </button>
1008
+ </div>
1009
+ </div>
1010
+ </div>
1011
+
1012
+ <script>
1013
+ let todos = JSON.parse(localStorage.getItem('todos')) || [];
1014
+ let currentFilter = 'all';
1015
+ let editingTodo = null;
1016
+ let draggedItem = null;
1017
+
1018
+ // Initialize
1019
+ document.addEventListener('DOMContentLoaded', () => {
1020
+ renderTodos();
1021
+ updateStats();
1022
+
1023
+ // Set today's date as default
1024
+ const today = new Date().toISOString().split('T')[0];
1025
+ document.getElementById('dueDateInput').value = today;
1026
+
1027
+ // Check for saved theme
1028
+ const savedTheme = localStorage.getItem('theme') || 'light';
1029
+ document.documentElement.setAttribute('data-theme', savedTheme);
1030
+ updateThemeButton(savedTheme);
1031
+ });
1032
+
1033
+ function addTodo() {
1034
+ const input = document.getElementById('todoInput');
1035
+ const text = input.value.trim();
1036
+
1037
+ if (text === '') {
1038
+ showToast('Please enter a task', 'error');
1039
+ return;
1040
+ }
1041
+
1042
+ const todo = {
1043
+ id: Date.now(),
1044
+ text: text,
1045
+ completed: false,
1046
+ priority: document.getElementById('prioritySelect').value,
1047
+ category: document.getElementById('categorySelect').value,
1048
+ dueDate: document.getElementById('dueDateInput').value,
1049
+ createdAt: new Date().toISOString(),
1050
+ completedAt: null
1051
+ };
1052
+
1053
+ todos.unshift(todo);
1054
+ saveTodos();
1055
+ renderTodos();
1056
+ updateStats();
1057
+
1058
+ input.value = '';
1059
+ showToast('Task added successfully!', 'success');
1060
+
1061
+ // Reset date to today
1062
+ const today = new Date().toISOString().split('T')[0];
1063
+ document.getElementById('dueDateInput').value = today;
1064
+ }
1065
+
1066
+ function handleKeyPress(event) {
1067
+ if (event.key === 'Enter') {
1068
+ addTodo();
1069
+ }
1070
+ }
1071
+
1072
+ function toggleTodo(id) {
1073
+ const todo = todos.find(t => t.id === id);
1074
+ if (todo) {
1075
+ todo.completed = !todo.completed;
1076
+ todo.completedAt = todo.completed ? new Date().toISOString() : null;
1077
+ saveTodos();
1078
+ renderTodos();
1079
+ updateStats();
1080
+
1081
+ if (todo.completed) {
1082
+ showToast('Task completed! 🎉', 'success');
1083
+ updateStreak();
1084
+ }
1085
+ }
1086
+ }
1087
+
1088
+ function deleteTodo(id) {
1089
+ todos = todos.filter(t => t.id !== id);
1090
+ saveTodos();
1091
+ renderTodos();
1092
+ updateStats();
1093
+ showToast('Task deleted', 'success');
1094
+ }
1095
+
1096
+ function editTodo(id) {
1097
+ const todo = todos.find(t => t.id === id);
1098
+ if (todo) {
1099
+ editingTodo = todo;
1100
+ document.getElementById('editInput').value = todo.text;
1101
+ document.getElementById('editPriority').value = todo.priority;
1102
+ document.getElementById('editCategory').value = todo.category;
1103
+ document.getElementById('editDueDate').value = todo.dueDate;
1104
+ document.getElementById('editModal').classList.add('active');
1105
+ }
1106
+ }
1107
+
1108
+ function saveEdit() {
1109
+ if (editingTodo) {
1110
+ editingTodo.text = document.getElementById('editInput').value;
1111
+ editingTodo.priority = document.getElementById('editPriority').value;
1112
+ editingTodo.category = document.getElementById('editCategory').value;
1113
+ editingTodo.dueDate = document.getElementById('editDueDate').value;
1114
+
1115
+ saveTodos();
1116
+ renderTodos();
1117
+ updateStats();
1118
+ closeEditModal();
1119
+ showToast('Task updated successfully!', 'success');
1120
+ }
1121
+ }
1122
+
1123
+ function closeEditModal() {
1124
+ document.getElementById('editModal').classList.remove('active');
1125
+ editingTodo = null;
1126
+ }
1127
+
1128
+ function filterTodos(filter) {
1129
+ currentFilter = filter;
1130
+
1131
+ // Update active tab
1132
+ document.querySelectorAll('.apple-tab').forEach(tab => {
1133
+ tab.classList.remove('active');
1134
+ });
1135
+ event.target.classList.add('active');
1136
+
1137
+ renderTodos();
1138
+ }
1139
+
1140
+ function searchTodos() {
1141
+ renderTodos();
1142
+ }
1143
+
1144
+ function renderTodos() {
1145
+ const todoList = document.getElementById('todoList');
1146
+ const emptyState = document.getElementById('emptyState');
1147
+ const searchTerm = document.getElementById('searchInput').value.toLowerCase();
1148
+
1149
+ let filteredTodos = todos;
1150
+
1151
+ // Apply filter
1152
+ if (currentFilter === 'active') {
1153
+ filteredTodos = todos.filter(t => !t.completed);
1154
+ } else if (currentFilter === 'completed') {
1155
+ filteredTodos = todos.filter(t => t.completed);
1156
+ } else if (currentFilter === 'today') {
1157
+ const today = new Date().toISOString().split('T')[0];
1158
+ filteredTodos = todos.filter(t => t.dueDate === today);
1159
+ }
1160
+
1161
+ // Apply search
1162
+ if (searchTerm) {
1163
+ filteredTodos = filteredTodos.filter(t =>
1164
+ t.text.toLowerCase().includes(searchTerm) ||
1165
+ t.category.toLowerCase().includes(searchTerm)
1166
+ );
1167
+ }
1168
+
1169
+ if (filteredTodos.length === 0) {
1170
+ todoList.style.display = 'none';
1171
+ emptyState.style.display = 'block';
1172
+ return;
1173
+ }
1174
+
1175
+ todoList.style.display = 'block';
1176
+ emptyState.style.display = 'none';
1177
+
1178
+ todoList.innerHTML = filteredTodos.map(todo => {
1179
+ const isOverdue = new Date(todo.dueDate) < new Date() && !todo.completed;
1180
+ const dueDateFormatted = new Date(todo.dueDate).toLocaleDateString('en-US', {
1181
+ month: 'short',
1182
+ day: 'numeric'
1183
+ });
1184
+
1185
+ return `
1186
+ <li class="todo-item ${todo.completed ? 'completed' : ''}"
1187
+ draggable="true"
1188
+ ondragstart="handleDragStart(event, ${todo.id})"
1189
+ ondragover="handleDragOver(event)"
1190
+ ondrop="handleDrop(event, ${todo.id})"
1191
+ ondragend="handleDragEnd(event)">
1192
+ <input type="checkbox"
1193
+ class="apple-checkbox"
1194
+ ${todo.completed ? 'checked' : ''}
1195
+ onchange="toggleTodo(${todo.id})">
1196
+ <div class="todo-content">
1197
+ <div class="todo-text">${todo.text}</div>
1198
+ <div class="todo-meta">
1199
+ <span class="priority-badge priority-${todo.priority}">
1200
+ ${todo.priority}
1201
+ </span>
1202
+ <span class="category-tag">
1203
+ <i class="fas fa-tag"></i> ${todo.category}
1204
+ </span>
1205
+ <span style="color: ${isOverdue ? 'var(--apple-red)' : 'var(--apple-text-tertiary)'}">
1206
+ <i class="fas fa-calendar"></i> ${dueDateFormatted}
1207
+ ${isOverdue ? ' (Overdue)' : ''}
1208
+ </span>
1209
+ </div>
1210
+ </div>
1211
+ <div class="todo-actions">
1212
+ <button class="action-btn" onclick="editTodo(${todo.id})">
1213
+ <i class="fas fa-edit"></i>
1214
+ </button>
1215
+ <button class="action-btn delete" onclick="deleteTodo(${todo.id})">
1216
+ <i class="fas fa-trash"></i>
1217
+ </button>
1218
+ </div>
1219
+ </li>
1220
+ `;
1221
+ }).join('');
1222
+ }
1223
+
1224
+ function handleDragStart(event, id) {
1225
+ draggedItem = id;
1226
+ event.dataTransfer.effectAllowed = 'move';
1227
+ event.target.classList.add('dragging');
1228
+ }
1229
+
1230
+ function handleDragOver(event) {
1231
+ event.preventDefault();
1232
+ event.dataTransfer.dropEffect = 'move';
1233
+ }
1234
+
1235
+ function handleDrop(event, targetId) {
1236
+ event.preventDefault();
1237
+
1238
+ if (draggedItem !== targetId) {
1239
+ const draggedIndex = todos.findIndex(t => t.id === draggedItem);
1240
+ const targetIndex = todos.findIndex(t => t.id === targetId);
1241
+
1242
+ if (draggedIndex !== -1 && targetIndex !== -1) {
1243
+ const [removed] = todos.splice(draggedIndex, 1);
1244
+ todos.splice(targetIndex, 0, removed);
1245
+ saveTodos();
1246
+ renderTodos();
1247
+ }
1248
+ }
1249
+ }
1250
+
1251
+ function handleDragEnd(event) {
1252
+ event.target.classList.remove('dragging');
1253
+ draggedItem = null;
1254
+ }
1255
+
1256
+ function clearCompleted() {
1257
+ const completedCount = todos.filter(t => t.completed).length;
1258
+
1259
+ if (completedCount === 0) {
1260
+ showToast('No completed tasks to clear', 'error');
1261
+ return;
1262
+ }
1263
+
1264
+ todos = todos.filter(t => !t.completed);
1265
+ saveTodos();
1266
+ renderTodos();
1267
+ updateStats();
1268
+ showToast(`Cleared ${completedCount} completed tasks`, 'success');
1269
+ }
1270
+
1271
+ function updateStats() {
1272
+ const total = todos.length;
1273
+ const completed = todos.filter(t => t.completed).length;
1274
+ const active = total - completed;
1275
+ const today = new Date().toISOString().split('T')[0];
1276
+ const todayCompleted = todos.filter(t =>
1277
+ t.completed && t.completedAt && t.completedAt.split('T')[0] === today
1278
+ ).length;
1279
+
1280
+ document.getElementById('totalTasks').textContent = total;
1281
+ document.getElementById('completedTasks').textContent = completed;
1282
+ document.getElementById('activeTasks').textContent = active;
1283
+ document.getElementById('todayCompleted').textContent = todayCompleted;
1284
+
1285
+ const progress = total > 0 ? (completed / total * 100) : 0;
1286
+ document.getElementById('progressFill').style.width = `${progress}%`;
1287
+
1288
+ const completionRate = total > 0 ? Math.round(progress) : 0;
1289
+ document.getElementById('completionRate').textContent = `${completionRate}%`;
1290
+
1291
+ updateStreak();
1292
+ }
1293
+
1294
+ function updateStreak() {
1295
+ // Simple streak calculation - can be enhanced
1296
+ const today = new Date();
1297
+ let streak = 0;
1298
+
1299
+ for (let i = 0; i < 30; i++) {
1300
+ const checkDate = new Date(today);
1301
+ checkDate.setDate(today.getDate() - i);
1302
+ const dateStr = checkDate.toISOString().split('T')[0];
1303
+
1304
+ const hasCompletedOnDate = todos.some(t =>
1305
+ t.completedAt && t.completedAt.split('T')[0] === dateStr
1306
+ );
1307
+
1308
+ if (hasCompletedOnDate) {
1309
+ streak++;
1310
+ } else if (i > 0) {
1311
+ break;
1312
+ }
1313
+ }
1314
+
1315
+ document.getElementById('streakDays').textContent = streak;
1316
+ }
1317
+
1318
+ function toggleTheme() {
1319
+ const currentTheme = document.documentElement.getAttribute('data-theme');
1320
+ const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
1321
+
1322
+ document.documentElement.setAttribute('data-theme', newTheme);
1323
+ localStorage.setItem('theme', newTheme);
1324
+ updateThemeButton(newTheme);
1325
+ }
1326
+
1327
+ function updateThemeButton(theme) {
1328
+ const themeText = document.getElementById('themeText');
1329
+ const themeIcon = document.querySelector('.apple-btn i');
1330
+
1331
+ if (theme === 'dark') {
1332
+ themeText.textContent = 'Light';
1333
+ themeIcon.className = 'fas fa-sun';
1334
+ } else {
1335
+ themeText.textContent = 'Dark';
1336
+ themeIcon.className = 'fas fa-moon';
1337
+ }
1338
+ }
1339
+
1340
+ function exportTodos() {
1341
+ const dataStr = JSON.stringify(todos, null, 2);
1342
+ const dataBlob = new Blob([dataStr], { type: 'application/json' });
1343
+ const url = URL.createObjectURL(dataBlob);
1344
+ const link = document.createElement('a');
1345
+ link.href = url;
1346
+ link.download = `todos-${new Date().toISOString().split('T')[0]}.json`;
1347
+ link.click();
1348
+ URL.revokeObjectURL(url);
1349
+ showToast('Tasks exported successfully!', 'success');
1350
+ }
1351
+
1352
+ function importTodos(event) {
1353
+ const file = event.target.files[0];
1354
+ if (!file) return;
1355
+
1356
+ const reader = new FileReader();
1357
+ reader.onload = function(e) {
1358
+ try {
1359
+ const imported = JSON.parse(e.target.result);
1360
+ todos = [...todos, ...imported];
1361
+ saveTodos();
1362
+ renderTodos();
1363
+ updateStats();
1364
+ showToast('Tasks imported successfully!', 'success');
1365
+ } catch (error) {
1366
+ showToast('Invalid file format', 'error');
1367
+ }
1368
+ };
1369
+ reader.readAsText(file);
1370
+ event.target.value = '';
1371
+ }
1372
+
1373
+ function showToast(message, type = 'success') {
1374
+ const toast = document.getElementById('toast');
1375
+ const toastMessage = document.getElementById('toastMessage');
1376
+ const toastIcon = toast.querySelector('.toast-icon');
1377
+
1378
+ toastMessage.textContent = message;
1379
+ toast.className = `apple-toast ${type} show`;
1380
+
1381
+ if (type === 'success') {
1382
+ toastIcon.className = 'toast-icon fas fa-check-circle';
1383
+ } else if (type === 'error') {
1384
+ toastIcon.className = 'toast-icon fas fa-exclamation-circle';
1385
+ }
1386
+
1387
+ setTimeout(() => {
1388
+ toast.classList.remove('show');
1389
+ }, 3000);
1390
+ }
1391
+
1392
+ function saveTodos() {
1393
+ localStorage.setItem('todos', JSON.stringify(todos));
1394
+ }
1395
+
1396
+ // Keyboard shortcuts
1397
+ document.addEventListener('keydown', (e) => {
1398
+ if (e.ctrlKey || e.metaKey) {
1399
+ switch(e.key) {
1400
+ case 'k':
1401
+ e.preventDefault();
1402
+ document.getElementById('searchInput').focus();
1403
+ break;
1404
+ case 'n':
1405
+ e.preventDefault();
1406
+ document.getElementById('todoInput').focus();
1407
+ break;
1408
+ case 'd':
1409
+ e.preventDefault();
1410
+ toggleTheme();
1411
+ break;
1412
+ }
1413
+ }
1414
+ });
1415
+ </