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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>TaskFlow - Modern Todo App</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 8 |
+
<style>
|
| 9 |
+
* {
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
box-sizing: border-box;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
:root {
|
| 16 |
+
--primary: #6366f1;
|
| 17 |
+
--primary-dark: #4f46e5;
|
| 18 |
+
--secondary: #8b5cf6;
|
| 19 |
+
--success: #10b981;
|
| 20 |
+
--warning: #f59e0b;
|
| 21 |
+
--danger: #ef4444;
|
| 22 |
+
--dark: #1f2937;
|
| 23 |
+
--light: #f3f4f6;
|
| 24 |
+
--white: #ffffff;
|
| 25 |
+
--gray: #6b7280;
|
| 26 |
+
--border: #e5e7eb;
|
| 27 |
+
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
|
| 28 |
+
--shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
|
| 29 |
+
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
[data-theme="dark"] {
|
| 33 |
+
--primary: #818cf8;
|
| 34 |
+
--primary-dark: #6366f1;
|
| 35 |
+
--secondary: #a78bfa;
|
| 36 |
+
--dark: #f3f4f6;
|
| 37 |
+
--light: #1f2937;
|
| 38 |
+
--white: #111827;
|
| 39 |
+
--gray: #9ca3af;
|
| 40 |
+
--border: #374151;
|
| 41 |
+
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
|
| 42 |
+
--shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
body {
|
| 46 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
| 47 |
+
background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
|
| 48 |
+
min-height: 100vh;
|
| 49 |
+
color: var(--dark);
|
| 50 |
+
transition: var(--transition);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.container {
|
| 54 |
+
max-width: 900px;
|
| 55 |
+
margin: 0 auto;
|
| 56 |
+
padding: 2rem;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
header {
|
| 60 |
+
text-align: center;
|
| 61 |
+
margin-bottom: 2rem;
|
| 62 |
+
animation: slideDown 0.5s ease-out;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.header-content {
|
| 66 |
+
display: flex;
|
| 67 |
+
justify-content: space-between;
|
| 68 |
+
align-items: center;
|
| 69 |
+
margin-bottom: 1rem;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
h1 {
|
| 73 |
+
color: var(--white);
|
| 74 |
+
font-size: 2.5rem;
|
| 75 |
+
font-weight: 700;
|
| 76 |
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
| 77 |
+
display: flex;
|
| 78 |
+
align-items: center;
|
| 79 |
+
gap: 0.5rem;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.logo {
|
| 83 |
+
width: 40px;
|
| 84 |
+
height: 40px;
|
| 85 |
+
background: var(--white);
|
| 86 |
+
border-radius: 10px;
|
| 87 |
+
display: flex;
|
| 88 |
+
align-items: center;
|
| 89 |
+
justify-content: center;
|
| 90 |
+
color: var(--primary);
|
| 91 |
+
font-size: 1.5rem;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.header-actions {
|
| 95 |
+
display: flex;
|
| 96 |
+
gap: 1rem;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.theme-toggle {
|
| 100 |
+
background: var(--white);
|
| 101 |
+
border: none;
|
| 102 |
+
width: 40px;
|
| 103 |
+
height: 40px;
|
| 104 |
+
border-radius: 50%;
|
| 105 |
+
cursor: pointer;
|
| 106 |
+
display: flex;
|
| 107 |
+
align-items: center;
|
| 108 |
+
justify-content: center;
|
| 109 |
+
font-size: 1.2rem;
|
| 110 |
+
color: var(--primary);
|
| 111 |
+
transition: var(--transition);
|
| 112 |
+
box-shadow: var(--shadow);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.theme-toggle:hover {
|
| 116 |
+
transform: scale(1.1);
|
| 117 |
+
box-shadow: var(--shadow-lg);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.main-card {
|
| 121 |
+
background: var(--white);
|
| 122 |
+
border-radius: 20px;
|
| 123 |
+
padding: 2rem;
|
| 124 |
+
box-shadow: var(--shadow-lg);
|
| 125 |
+
animation: fadeIn 0.6s ease-out;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
.stats {
|
| 129 |
+
display: grid;
|
| 130 |
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
| 131 |
+
gap: 1rem;
|
| 132 |
+
margin-bottom: 2rem;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.stat-card {
|
| 136 |
+
background: var(--light);
|
| 137 |
+
padding: 1rem;
|
| 138 |
+
border-radius: 10px;
|
| 139 |
+
text-align: center;
|
| 140 |
+
transition: var(--transition);
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
.stat-card:hover {
|
| 144 |
+
transform: translateY(-2px);
|
| 145 |
+
box-shadow: var(--shadow);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.stat-number {
|
| 149 |
+
font-size: 2rem;
|
| 150 |
+
font-weight: 700;
|
| 151 |
+
color: var(--primary);
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
.stat-label {
|
| 155 |
+
color: var(--gray);
|
| 156 |
+
font-size: 0.875rem;
|
| 157 |
+
margin-top: 0.25rem;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
.add-todo-section {
|
| 161 |
+
margin-bottom: 2rem;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
.add-todo-form {
|
| 165 |
+
display: grid;
|
| 166 |
+
gap: 1rem;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
.input-group {
|
| 170 |
+
display: flex;
|
| 171 |
+
gap: 0.5rem;
|
| 172 |
+
flex-wrap: wrap;
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
.input-field {
|
| 176 |
+
flex: 1;
|
| 177 |
+
min-width: 200px;
|
| 178 |
+
padding: 0.75rem 1rem;
|
| 179 |
+
border: 2px solid var(--border);
|
| 180 |
+
border-radius: 10px;
|
| 181 |
+
font-size: 1rem;
|
| 182 |
+
transition: var(--transition);
|
| 183 |
+
background: var(--light);
|
| 184 |
+
color: var(--dark);
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
.input-field:focus {
|
| 188 |
+
outline: none;
|
| 189 |
+
border-color: var(--primary);
|
| 190 |
+
background: var(--white);
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
.select-field {
|
| 194 |
+
padding: 0.75rem 1rem;
|
| 195 |
+
border: 2px solid var(--border);
|
| 196 |
+
border-radius: 10px;
|
| 197 |
+
font-size: 1rem;
|
| 198 |
+
background: var(--light);
|
| 199 |
+
color: var(--dark);
|
| 200 |
+
cursor: pointer;
|
| 201 |
+
transition: var(--transition);
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
.select-field:focus {
|
| 205 |
+
outline: none;
|
| 206 |
+
border-color: var(--primary);
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
.btn {
|
| 210 |
+
padding: 0.75rem 1.5rem;
|
| 211 |
+
border: none;
|
| 212 |
+
border-radius: 10px;
|
| 213 |
+
font-size: 1rem;
|
| 214 |
+
font-weight: 600;
|
| 215 |
+
cursor: pointer;
|
| 216 |
+
transition: var(--transition);
|
| 217 |
+
display: inline-flex;
|
| 218 |
+
align-items: center;
|
| 219 |
+
gap: 0.5rem;
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
.btn-primary {
|
| 223 |
+
background: var(--primary);
|
| 224 |
+
color: var(--white);
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
.btn-primary:hover {
|
| 228 |
+
background: var(--primary-dark);
|
| 229 |
+
transform: translateY(-2px);
|
| 230 |
+
box-shadow: var(--shadow-lg);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.btn-secondary {
|
| 234 |
+
background: var(--gray);
|
| 235 |
+
color: var(--white);
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
.btn-danger {
|
| 239 |
+
background: var(--danger);
|
| 240 |
+
color: var(--white);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
.btn-sm {
|
| 244 |
+
padding: 0.5rem 1rem;
|
| 245 |
+
font-size: 0.875rem;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
.filter-section {
|
| 249 |
+
display: flex;
|
| 250 |
+
gap: 0.5rem;
|
| 251 |
+
margin-bottom: 1.5rem;
|
| 252 |
+
flex-wrap: wrap;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
.filter-btn {
|
| 256 |
+
padding: 0.5rem 1rem;
|
| 257 |
+
border: 2px solid var(--border);
|
| 258 |
+
background: var(--white);
|
| 259 |
+
color: var(--gray);
|
| 260 |
+
border-radius: 20px;
|
| 261 |
+
cursor: pointer;
|
| 262 |
+
transition: var(--transition);
|
| 263 |
+
font-weight: 500;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
.filter-btn:hover {
|
| 267 |
+
border-color: var(--primary);
|
| 268 |
+
color: var(--primary);
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.filter-btn.active {
|
| 272 |
+
background: var(--primary);
|
| 273 |
+
color: var(--white);
|
| 274 |
+
border-color: var(--primary);
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
.search-box {
|
| 278 |
+
position: relative;
|
| 279 |
+
flex: 1;
|
| 280 |
+
max-width: 300px;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
.search-input {
|
| 284 |
+
width: 100%;
|
| 285 |
+
padding: 0.5rem 1rem 0.5rem 2.5rem;
|
| 286 |
+
border: 2px solid var(--border);
|
| 287 |
+
border-radius: 20px;
|
| 288 |
+
background: var(--light);
|
| 289 |
+
transition: var(--transition);
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
.search-input:focus {
|
| 293 |
+
outline: none;
|
| 294 |
+
border-color: var(--primary);
|
| 295 |
+
background: var(--white);
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
.search-icon {
|
| 299 |
+
position: absolute;
|
| 300 |
+
left: 0.75rem;
|
| 301 |
+
top: 50%;
|
| 302 |
+
transform: translateY(-50%);
|
| 303 |
+
color: var(--gray);
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
.todos-container {
|
| 307 |
+
max-height: 500px;
|
| 308 |
+
overflow-y: auto;
|
| 309 |
+
padding-right: 0.5rem;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
.todos-container::-webkit-scrollbar {
|
| 313 |
+
width: 8px;
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
.todos-container::-webkit-scrollbar-track {
|
| 317 |
+
background: var(--light);
|
| 318 |
+
border-radius: 10px;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
.todos-container::-webkit-scrollbar-thumb {
|
| 322 |
+
background: var(--gray);
|
| 323 |
+
border-radius: 10px;
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
.todo-item {
|
| 327 |
+
background: var(--light);
|
| 328 |
+
border-radius: 10px;
|
| 329 |
+
padding: 1rem;
|
| 330 |
+
margin-bottom: 0.75rem;
|
| 331 |
+
display: flex;
|
| 332 |
+
align-items: center;
|
| 333 |
+
gap: 1rem;
|
| 334 |
+
transition: var(--transition);
|
| 335 |
+
animation: slideIn 0.3s ease-out;
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
.todo-item:hover {
|
| 339 |
+
transform: translateX(5px);
|
| 340 |
+
box-shadow: var(--shadow);
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
.todo-item.completed {
|
| 344 |
+
opacity: 0.6;
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
.todo-item.completed .todo-text {
|
| 348 |
+
text-decoration: line-through;
|
| 349 |
+
color: var(--gray);
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
.todo-checkbox {
|
| 353 |
+
width: 24px;
|
| 354 |
+
height: 24px;
|
| 355 |
+
border: 2px solid var(--primary);
|
| 356 |
+
border-radius: 50%;
|
| 357 |
+
cursor: pointer;
|
| 358 |
+
display: flex;
|
| 359 |
+
align-items: center;
|
| 360 |
+
justify-content: center;
|
| 361 |
+
transition: var(--transition);
|
| 362 |
+
flex-shrink: 0;
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
.todo-checkbox:hover {
|
| 366 |
+
background: var(--primary);
|
| 367 |
+
color: var(--white);
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
.todo-checkbox.checked {
|
| 371 |
+
background: var(--primary);
|
| 372 |
+
color: var(--white);
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.todo-content {
|
| 376 |
+
flex: 1;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.todo-header {
|
| 380 |
+
display: flex;
|
| 381 |
+
align-items: center;
|
| 382 |
+
gap: 0.5rem;
|
| 383 |
+
margin-bottom: 0.25rem;
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
.todo-text {
|
| 387 |
+
font-size: 1rem;
|
| 388 |
+
color: var(--dark);
|
| 389 |
+
flex: 1;
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
.todo-category {
|
| 393 |
+
padding: 0.25rem 0.5rem;
|
| 394 |
+
border-radius: 5px;
|
| 395 |
+
font-size: 0.75rem;
|
| 396 |
+
font-weight: 600;
|
| 397 |
+
text-transform: uppercase;
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
.category-work {
|
| 401 |
+
background: var(--primary);
|
| 402 |
+
color: var(--white);
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
.category-personal {
|
| 406 |
+
background: var(--success);
|
| 407 |
+
color: var(--white);
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
.category-shopping {
|
| 411 |
+
background: var(--warning);
|
| 412 |
+
color: var(--white);
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
.category-health {
|
| 416 |
+
background: var(--danger);
|
| 417 |
+
color: var(--white);
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
.priority-badge {
|
| 421 |
+
padding: 0.25rem 0.5rem;
|
| 422 |
+
border-radius: 5px;
|
| 423 |
+
font-size: 0.75rem;
|
| 424 |
+
font-weight: 600;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.priority-high {
|
| 428 |
+
background: var(--danger);
|
| 429 |
+
color: var(--white);
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
.priority-medium {
|
| 433 |
+
background: var(--warning);
|
| 434 |
+
color: var(--white);
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
.priority-low {
|
| 438 |
+
background: var(--success);
|
| 439 |
+
color: var(--white);
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
.todo-meta {
|
| 443 |
+
display: flex;
|
| 444 |
+
align-items: center;
|
| 445 |
+
gap: 1rem;
|
| 446 |
+
font-size: 0.875rem;
|
| 447 |
+
color: var(--gray);
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
.todo-actions {
|
| 451 |
+
display: flex;
|
| 452 |
+
gap: 0.5rem;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
.action-btn {
|
| 456 |
+
width: 32px;
|
| 457 |
+
height: 32px;
|
| 458 |
+
border: none;
|
| 459 |
+
background: var(--white);
|
| 460 |
+
color: var(--gray);
|
| 461 |
+
border-radius: 8px;
|
| 462 |
+
cursor: pointer;
|
| 463 |
+
display: flex;
|
| 464 |
+
align-items: center;
|
| 465 |
+
justify-content: center;
|
| 466 |
+
transition: var(--transition);
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
.action-btn:hover {
|
| 470 |
+
color: var(--primary);
|
| 471 |
+
transform: scale(1.1);
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
.action-btn.delete:hover {
|
| 475 |
+
color: var(--danger);
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
.empty-state {
|
| 479 |
+
text-align: center;
|
| 480 |
+
padding: 3rem;
|
| 481 |
+
color: var(--gray);
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
.empty-icon {
|
| 485 |
+
font-size: 4rem;
|
| 486 |
+
margin-bottom: 1rem;
|
| 487 |
+
opacity: 0.5;
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
.footer-actions {
|
| 491 |
+
display: flex;
|
| 492 |
+
justify-content: space-between;
|
| 493 |
+
align-items: center;
|
| 494 |
+
margin-top: 2rem;
|
| 495 |
+
padding-top: 1rem;
|
| 496 |
+
border-top: 2px solid var(--border);
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
.progress-bar {
|
| 500 |
+
flex: 1;
|
| 501 |
+
height: 8px;
|
| 502 |
+
background: var(--light);
|
| 503 |
+
border-radius: 10px;
|
| 504 |
+
overflow: hidden;
|
| 505 |
+
margin-right: 1rem;
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
.progress-fill {
|
| 509 |
+
height: 100%;
|
| 510 |
+
background: linear-gradient(90deg, var(--primary), var(--secondary));
|
| 511 |
+
border-radius: 10px;
|
| 512 |
+
transition: width 0.5s ease;
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
@keyframes slideDown {
|
| 516 |
+
from {
|
| 517 |
+
opacity: 0;
|
| 518 |
+
transform: translateY(-20px);
|
| 519 |
+
}
|
| 520 |
+
to {
|
| 521 |
+
opacity: 1;
|
| 522 |
+
transform: translateY(0);
|
| 523 |
+
}
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
@keyframes fadeIn {
|
| 527 |
+
from {
|
| 528 |
+
opacity: 0;
|
| 529 |
+
}
|
| 530 |
+
to {
|
| 531 |
+
opacity: 1;
|
| 532 |
+
}
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
@keyframes slideIn {
|
| 536 |
+
from {
|
| 537 |
+
opacity: 0;
|
| 538 |
+
transform: translateX(-20px);
|
| 539 |
+
}
|
| 540 |
+
to {
|
| 541 |
+
opacity: 1;
|
| 542 |
+
transform: translateX(0);
|
| 543 |
+
}
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
@media (max-width: 768px) {
|
| 547 |
+
.container {
|
| 548 |
+
padding: 1rem;
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
h1 {
|
| 552 |
+
font-size: 2rem;
|
| 553 |
+
}
|
| 554 |
+
|
| 555 |
+
.main-card {
|
| 556 |
+
padding: 1.5rem;
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
.stats {
|
| 560 |
+
grid-template-columns: repeat(2, 1fr);
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
.filter-section {
|
| 564 |
+
flex-direction: column;
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
.search-box {
|
| 568 |
+
max-width: 100%;
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
.footer-actions {
|
| 572 |
+
flex-direction: column;
|
| 573 |
+
gap: 1rem;
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
.progress-bar {
|
| 577 |
+
width: 100%;
|
| 578 |
+
margin-right: 0;
|
| 579 |
+
}
|
| 580 |
+
}
|
| 581 |
+
</style>
|
| 582 |
+
</head>
|
| 583 |
+
<body>
|
| 584 |
+
<div class="container">
|
| 585 |
+
<header>
|
| 586 |
+
<div class="header-content">
|
| 587 |
+
<h1>
|
| 588 |
+
<div class="logo">
|
| 589 |
+
<i class="fas fa-tasks"></i>
|
| 590 |
+
</div>
|
| 591 |
+
TaskFlow
|
| 592 |
+
</h1>
|
| 593 |
+
<div class="header-actions">
|
| 594 |
+
<button class="theme-toggle" onclick="toggleTheme()">
|
| 595 |
+
<i class="fas fa-moon" id="themeIcon"></i>
|
| 596 |
+
</button>
|
| 597 |
+
</div>
|
| 598 |
+
</div>
|
| 599 |
+
<p style="color: white; opacity: 0.9;">Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" style="color: white; text-decoration: underline;" target="_blank">anycoder</a></p>
|
| 600 |
+
</header>
|
| 601 |
+
|
| 602 |
+
<main class="main-card">
|
| 603 |
+
<section class="stats">
|
| 604 |
+
<div class="stat-card">
|
| 605 |
+
<div class="stat-number" id="totalTasks">0</div>
|
| 606 |
+
<div class="stat-label">Total Tasks</div>
|
| 607 |
+
</div>
|
| 608 |
+
<div class="stat-card">
|
| 609 |
+
<div class="stat-number" id="completedTasks">0</div>
|
| 610 |
+
<div class="stat-label">Completed</div>
|
| 611 |
+
</div>
|
| 612 |
+
<div class="stat-card">
|
| 613 |
+
<div class="stat-number" id="pendingTasks">0</div>
|
| 614 |
+
<div class="stat-label">Pending</div>
|
| 615 |
+
</div>
|
| 616 |
+
<div class="stat-card">
|
| 617 |
+
<div class="stat-number" id="todayTasks">0</div>
|
| 618 |
+
<div class="stat-label">Due Today</div>
|
| 619 |
+
</div>
|
| 620 |
+
</section>
|
| 621 |
+
|
| 622 |
+
<section class="add-todo-section">
|
| 623 |
+
<form class="add-todo-form" onsubmit="addTodo(event)">
|
| 624 |
+
<div class="input-group">
|
| 625 |
+
<input type="text" class="input-field" id="todoInput" placeholder="What needs to be done?" required>
|
| 626 |
+
<select class="select-field" id="categorySelect">
|
| 627 |
+
<option value="work">Work</option>
|
| 628 |
+
<option value="personal">Personal</option>
|
| 629 |
+
<option value="shopping">Shopping</option>
|
| 630 |
+
<option value="health">Health</option>
|
| 631 |
+
</select>
|
| 632 |
+
<select class="select-field" id="prioritySelect">
|
| 633 |
+
<option value="low">Low Priority</option>
|
| 634 |
+
<option value="medium">Medium Priority</option>
|
| 635 |
+
<option value="high">High Priority</option>
|
| 636 |
+
</select>
|
| 637 |
+
<input type="date" class="input-field" id="dueDateInput" style="max-width: 200px;">
|
| 638 |
+
<button type="submit" class="btn btn-primary">
|
| 639 |
+
<i class="fas fa-plus"></i>
|
| 640 |
+
Add Task
|
| 641 |
+
</button>
|
| 642 |
+
</div>
|
| 643 |
+
</form>
|
| 644 |
+
</section>
|
| 645 |
+
|
| 646 |
+
<section class="filter-section">
|
| 647 |
+
<button class="filter-btn active" onclick="filterTodos('all')">All</button>
|
| 648 |
+
<button class="filter-btn" onclick="filterTodos('active')">Active</button>
|
| 649 |
+
<button class="filter-btn" onclick="filterTodos('completed')">Completed</button>
|
| 650 |
+
<div class="search-box">
|
| 651 |
+
<i class="fas fa-search search-icon"></i>
|
| 652 |
+
<input type="text" class="search-input" placeholder="Search tasks..." oninput="searchTodos(this.value)">
|
| 653 |
+
</div>
|
| 654 |
+
</section>
|
| 655 |
+
|
| 656 |
+
<section class="todos-container" id="todosContainer">
|
| 657 |
+
<div class="empty-state">
|
| 658 |
+
<div class="empty-icon">
|
| 659 |
+
<i class="fas fa-clipboard-list"></i>
|
| 660 |
+
</div>
|
| 661 |
+
<p>No tasks yet. Add your first task above!</p>
|
| 662 |
+
</div>
|
| 663 |
+
</section>
|
| 664 |
+
|
| 665 |
+
<footer class="footer-actions">
|
| 666 |
+
<div style="display: flex; align-items: center; flex: 1;">
|
| 667 |
+
<div class="progress-bar">
|
| 668 |
+
<div class="progress-fill" id="progressBar" style="width: 0%"></div>
|
| 669 |
+
</div>
|
| 670 |
+
<span id="progressText" style="color: var(--gray); font-size: 0.875rem;">0% Complete</span>
|
| 671 |
+
</div>
|
| 672 |
+
<button class="btn btn-danger btn-sm" onclick="clearCompleted()">
|
| 673 |
+
<i class="fas fa-trash"></i>
|
| 674 |
+
Clear Completed
|
| 675 |
+
</button>
|
| 676 |
+
</footer>
|
| 677 |
+
</main>
|
| 678 |
+
</div>
|
| 679 |
+
|
| 680 |
+
<script>
|
| 681 |
+
let todos = [];
|
| 682 |
+
let currentFilter = 'all';
|
| 683 |
+
let searchTerm = '';
|
| 684 |
+
|
| 685 |
+
// Initialize app
|
| 686 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 687 |
+
loadTodos();
|
| 688 |
+
renderTodos();
|
| 689 |
+
updateStats();
|
| 690 |
+
|
| 691 |
+
// Set today's date as default
|
| 692 |
+
const today = new Date().toISOString().split('T')[0];
|
| 693 |
+
document.getElementById('dueDateInput').value = today;
|
| 694 |
+
|
| 695 |
+
// Check for saved theme
|
| 696 |
+
const savedTheme = localStorage.getItem('theme') || 'light';
|
| 697 |
+
if (savedTheme === 'dark') {
|
| 698 |
+
document.documentElement.setAttribute('data-theme', 'dark');
|
| 699 |
+
document.getElementById('themeIcon').className = 'fas fa-sun';
|
| 700 |
+
}
|
| 701 |
+
});
|
| 702 |
+
|
| 703 |
+
function toggleTheme() {
|
| 704 |
+
const currentTheme = document.documentElement.getAttribute('data-theme');
|
| 705 |
+
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
| 706 |
+
document.documentElement.setAttribute('data-theme', newTheme);
|
| 707 |
+
localStorage.setItem('theme', newTheme);
|
| 708 |
+
|
| 709 |
+
const icon = document.getElementById('themeIcon');
|
| 710 |
+
icon.className = newTheme === 'dark' ? 'fas fa-sun' : 'fas fa-moon';
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
function addTodo(event) {
|
| 714 |
+
event.preventDefault();
|
| 715 |
+
|
| 716 |
+
const input = document.getElementById('todoInput');
|
| 717 |
+
const category = document.getElementById('categorySelect').value;
|
| 718 |
+
const priority = document.getElementById('prioritySelect').value;
|
| 719 |
+
const dueDate = document.getElementById('dueDateInput').value;
|
| 720 |
+
|
| 721 |
+
const todo = {
|
| 722 |
+
id: Date.now(),
|
| 723 |
+
text: input.value.trim(),
|
| 724 |
+
category: category,
|
| 725 |
+
priority: priority,
|
| 726 |
+
dueDate: dueDate,
|
| 727 |
+
completed: false,
|
| 728 |
+
createdAt: new Date().toISOString()
|
| 729 |
+
};
|
| 730 |
+
|
| 731 |
+
todos.unshift(todo);
|
| 732 |
+
saveTodos();
|
| 733 |
+
renderTodos();
|
| 734 |
+
updateStats();
|
| 735 |
+
|
| 736 |
+
// Reset form
|
| 737 |
+
input.value = '';
|
| 738 |
+
const today = new Date().toISOString().split('T')[0];
|
| 739 |
+
document.getElementById('dueDateInput').value = today;
|
| 740 |
+
|
| 741 |
+
// Show success animation
|
| 742 |
+
input.style.borderColor = 'var(--success)';
|
| 743 |
+
setTimeout(() => {
|
| 744 |
+
input.style.borderColor = '';
|
| 745 |
+
}, 1000);
|
| 746 |
+
}
|
| 747 |
+
|
| 748 |
+
function toggleTodo(id) {
|
| 749 |
+
const todo = todos.find(t => t.id === id);
|
| 750 |
+
if (todo) {
|
| 751 |
+
todo.completed = !todo.completed;
|
| 752 |
+
saveTodos();
|
| 753 |
+
renderTodos();
|
| 754 |
+
updateStats();
|
| 755 |
+
}
|
| 756 |
+
}
|
| 757 |
+
|
| 758 |
+
function deleteTodo(id) {
|
| 759 |
+
todos = todos.filter(t => t.id !== id);
|
| 760 |
+
saveTodos();
|
| 761 |
+
renderTodos();
|
| 762 |
+
updateStats();
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
function editTodo(id) {
|
| 766 |
+
const todo = todos.find(t => t.id === id);
|
| 767 |
+
if (todo) {
|
| 768 |
+
const newText = prompt('Edit task:', todo.text);
|
| 769 |
+
if (newText && newText.trim()) {
|
| 770 |
+
todo.text = newText.trim();
|
| 771 |
+
saveTodos();
|
| 772 |
+
renderTodos();
|
| 773 |
+
}
|
| 774 |
+
}
|
| 775 |
+
}
|
| 776 |
+
|
| 777 |
+
function filterTodos(filter) {
|
| 778 |
+
currentFilter = filter;
|
| 779 |
+
|
| 780 |
+
// Update active button
|
| 781 |
+
document.querySelectorAll('.filter-btn').forEach(btn => {
|
| 782 |
+
btn.classList.remove('active');
|
| 783 |
+
});
|
| 784 |
+
event.target.classList.add('active');
|
| 785 |
+
|
| 786 |
+
renderTodos();
|
| 787 |
+
}
|
| 788 |
+
|
| 789 |
+
function searchTodos(term) {
|
| 790 |
+
searchTerm = term.toLowerCase();
|
| 791 |
+
renderTodos();
|
| 792 |
+
}
|
| 793 |
+
|
| 794 |
+
function getFilteredTodos() {
|
| 795 |
+
let filtered = todos;
|
| 796 |
+
|
| 797 |
+
// Apply filter
|
| 798 |
+
if (currentFilter === 'active') {
|
| 799 |
+
filtered = filtered.filter(t => !t.completed);
|
| 800 |
+
} else if (currentFilter === 'completed') {
|
| 801 |
+
filtered = filtered.filter(t => t.completed);
|
| 802 |
+
}
|
| 803 |
+
|
| 804 |
+
// Apply search
|
| 805 |
+
if (searchTerm) {
|
| 806 |
+
filtered = filtered.filter(t =>
|
| 807 |
+
t.text.toLowerCase().includes(searchTerm) ||
|
| 808 |
+
t.category.toLowerCase().includes(searchTerm)
|
| 809 |
+
);
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
return filtered;
|
| 813 |
+
}
|
| 814 |
+
|
| 815 |
+
function renderTodos() {
|
| 816 |
+
const container = document.getElementById('todosContainer');
|
| 817 |
+
const filteredTodos = getFilteredTodos();
|
| 818 |
+
|
| 819 |
+
if (filteredTodos.length === 0) {
|
| 820 |
+
container.innerHTML = `
|
| 821 |
+
<div class="empty-state">
|
| 822 |
+
<div class="empty-icon">
|
| 823 |
+
<i class="fas fa-clipboard-list"></i>
|
| 824 |
+
</div>
|
| 825 |
+
<p>${searchTerm ? 'No tasks found matching your search.' : 'No tasks yet. Add your first task above!'}</p>
|
| 826 |
+
</div>
|
| 827 |
+
`;
|
| 828 |
+
return;
|
| 829 |
+
}
|
| 830 |
+
|
| 831 |
+
container.innerHTML = filteredTodos.map(todo => {
|
| 832 |
+
const isOverdue = todo.dueDate && new Date(todo.dueDate) < new Date() && !todo.completed;
|
| 833 |
+
const dueDateFormatted = todo.dueDate ? new Date(todo.dueDate).toLocaleDateString() : '';
|
| 834 |
+
|
| 835 |
+
return `
|
| 836 |
+
<div class="todo-item ${todo.completed ? 'completed' : ''}" style="${isOverdue ? 'border-left: 4px solid var(--danger);' : ''}">
|
| 837 |
+
<div class="todo-checkbox ${todo.completed ? 'checked' : ''}" onclick="toggleTodo(${todo.id})">
|
| 838 |
+
${todo.completed ? '<i class="fas fa-check"></i>' : ''}
|
| 839 |
+
</div>
|
| 840 |
+
<div class="todo-content">
|
| 841 |
+
<div class="todo-header">
|
| 842 |
+
<span class="todo-text">${todo.text}</span>
|
| 843 |
+
<span class="todo-category category-${todo.category}">${todo.category}</span>
|
| 844 |
+
<span class="priority-badge priority-${todo.priority}">${todo.priority}</span>
|
| 845 |
+
</div>
|
| 846 |
+
<div class="todo-meta">
|
| 847 |
+
${todo.dueDate ? `
|
| 848 |
+
<span style="${isOverdue ? 'color: var(--danger);' : ''}">
|
| 849 |
+
<i class="fas fa-calendar"></i> ${dueDateFormatted}
|
| 850 |
+
${isOverdue ? ' (Overdue)' : ''}
|
| 851 |
+
</span>
|
| 852 |
+
` : ''}
|
| 853 |
+
</div>
|
| 854 |
+
</div>
|
| 855 |
+
<div class="todo-actions">
|
| 856 |
+
<button class="action-btn" onclick="editTodo(${todo.id})">
|
| 857 |
+
<i class="fas fa-edit"></i>
|
| 858 |
+
</button>
|
| 859 |
+
<button class="action-btn delete" onclick="deleteTodo(${todo.id})">
|
| 860 |
+
<i class="fas fa-trash"></i>
|
| 861 |
+
</button>
|
| 862 |
+
</div>
|
| 863 |
+
</div>
|
| 864 |
+
`;
|
| 865 |
+
}).join('');
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
function updateStats() {
|
| 869 |
+
const total = todos.length;
|
| 870 |
+
const completed = todos.filter(t => t.completed).length;
|
| 871 |
+
const pending = total - completed;
|
| 872 |
+
const today = new Date().toISOString().split('T')[0];
|
| 873 |
+
const dueToday = todos.filter(t => t.dueDate === today && !t.completed).length;
|
| 874 |
+
|
| 875 |
+
document.getElementById('totalTasks').textContent = total;
|
| 876 |
+
document.getElementById('completedTasks').textContent = completed;
|
| 877 |
+
document.getElementById('pendingTasks').textContent = pending;
|
| 878 |
+
document.getElementById('todayTasks').textContent = dueToday;
|
| 879 |
+
|
| 880 |
+
// Update progress bar
|
| 881 |
+
const progress = total > 0 ? Math.round((completed / total) * 100) : 0;
|
| 882 |
+
document.getElementById('progressBar').style.width = `${progress}%`;
|
| 883 |
+
document.getElementById('progressText').textContent = `${progress}% Complete`;
|
| 884 |
+
}
|
| 885 |
+
|
| 886 |
+
function clearCompleted() {
|
| 887 |
+
if (confirm('Are you sure you want to clear all completed tasks?')) {
|
| 888 |
+
todos = todos.filter(t => !t.completed);
|
| 889 |
+
saveTodos();
|
| 890 |
+
renderTodos();
|
| 891 |
+
updateStats();
|
| 892 |
+
}
|
| 893 |
+
}
|
| 894 |
+
|
| 895 |
+
function saveTodos() {
|
| 896 |
+
localStorage.setItem('todos', JSON.stringify(todos));
|
| 897 |
+
}
|
| 898 |
+
|
| 899 |
+
function loadTodos() {
|
| 900 |
+
const saved = localStorage.getItem('todos');
|
| 901 |
+
if (saved) {
|
| 902 |
+
todos = JSON.parse(saved);
|
| 903 |
+
}
|
| 904 |
+
}
|
| 905 |
+
</script>
|
| 906 |
+
</body>
|
| 907 |
+
</html>
|