Add 1 files
Browse files- index.html +391 -391
index.html
CHANGED
|
@@ -1,32 +1,32 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Eisenhower
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<style>
|
| 10 |
-
.
|
| 11 |
min-height: 300px;
|
| 12 |
transition: all 0.3s ease;
|
| 13 |
}
|
| 14 |
-
.
|
| 15 |
transform: translateY(-5px);
|
| 16 |
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
| 17 |
}
|
| 18 |
-
.
|
| 19 |
transition: all 0.2s ease;
|
| 20 |
cursor: pointer;
|
| 21 |
}
|
| 22 |
-
.
|
| 23 |
background-color: rgba(255,255,255,0.2);
|
| 24 |
}
|
| 25 |
-
.
|
| 26 |
text-decoration: line-through;
|
| 27 |
opacity: 0.7;
|
| 28 |
}
|
| 29 |
-
.
|
| 30 |
font-size: 0.75rem;
|
| 31 |
padding: 0.15rem 0.4rem;
|
| 32 |
border-radius: 9999px;
|
|
@@ -34,25 +34,25 @@
|
|
| 34 |
.modal {
|
| 35 |
transition: all 0.3s ease;
|
| 36 |
}
|
| 37 |
-
.modal-
|
| 38 |
opacity: 1;
|
| 39 |
pointer-events: auto;
|
| 40 |
}
|
| 41 |
-
.
|
| 42 |
transition: all 0.2s ease;
|
| 43 |
}
|
| 44 |
-
.
|
| 45 |
background-color: rgba(0,0,0,0.05);
|
| 46 |
}
|
| 47 |
-
.
|
| 48 |
min-height: 100px;
|
| 49 |
resize: none;
|
| 50 |
}
|
| 51 |
-
.
|
| 52 |
max-height: 80vh;
|
| 53 |
overflow-y: auto;
|
| 54 |
}
|
| 55 |
-
.
|
| 56 |
width: 120px;
|
| 57 |
}
|
| 58 |
</style>
|
|
@@ -60,610 +60,610 @@
|
|
| 60 |
<body class="bg-gray-100 min-h-screen">
|
| 61 |
<div class="container mx-auto px-4 py-8">
|
| 62 |
<header class="mb-8 text-center">
|
| 63 |
-
<h1 class="text-4xl font-bold text-gray-800 mb-2">
|
| 64 |
-
<p class="text-gray-600">Organize
|
| 65 |
</header>
|
| 66 |
|
| 67 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
|
| 68 |
-
<!--
|
| 69 |
-
<div class="
|
| 70 |
<div class="flex justify-between items-center mb-4">
|
| 71 |
-
<h2 class="text-xl font-semibold text-red-800">
|
| 72 |
-
<span class="bg-red-200 text-red-800 px-3 py-1 rounded-full text-sm">
|
| 73 |
</div>
|
| 74 |
<div class="mb-4 flex">
|
| 75 |
-
<input type="text" id="
|
| 76 |
-
<input type="date" id="
|
| 77 |
-
<button onclick="
|
| 78 |
</div>
|
| 79 |
-
<ul id="
|
| 80 |
</div>
|
| 81 |
|
| 82 |
-
<!--
|
| 83 |
-
<div class="
|
| 84 |
<div class="flex justify-between items-center mb-4">
|
| 85 |
-
<h2 class="text-xl font-semibold text-blue-800">
|
| 86 |
-
<span class="bg-blue-200 text-blue-800 px-3 py-1 rounded-full text-sm">
|
| 87 |
</div>
|
| 88 |
<div class="mb-4 flex">
|
| 89 |
-
<input type="text" id="
|
| 90 |
-
<input type="date" id="
|
| 91 |
-
<button onclick="
|
| 92 |
</div>
|
| 93 |
-
<ul id="
|
| 94 |
</div>
|
| 95 |
|
| 96 |
-
<!--
|
| 97 |
-
<div class="
|
| 98 |
<div class="flex justify-between items-center mb-4">
|
| 99 |
-
<h2 class="text-xl font-semibold text-yellow-800">
|
| 100 |
-
<span class="bg-yellow-200 text-yellow-800 px-3 py-1 rounded-full text-sm">
|
| 101 |
</div>
|
| 102 |
<div class="mb-4 flex">
|
| 103 |
-
<input type="text" id="
|
| 104 |
-
<input type="date" id="
|
| 105 |
-
<button onclick="
|
| 106 |
</div>
|
| 107 |
-
<ul id="
|
| 108 |
</div>
|
| 109 |
|
| 110 |
-
<!--
|
| 111 |
-
<div class="
|
| 112 |
<div class="flex justify-between items-center mb-4">
|
| 113 |
-
<h2 class="text-xl font-semibold text-green-800">
|
| 114 |
-
<span class="bg-green-200 text-green-800 px-3 py-1 rounded-full text-sm">
|
| 115 |
</div>
|
| 116 |
<div class="mb-4 flex">
|
| 117 |
-
<input type="text" id="
|
| 118 |
-
<input type="date" id="
|
| 119 |
-
<button onclick="
|
| 120 |
</div>
|
| 121 |
-
<ul id="
|
| 122 |
</div>
|
| 123 |
</div>
|
| 124 |
|
| 125 |
<div class="text-center mt-8">
|
| 126 |
-
<button onclick="
|
| 127 |
-
<i class="fas fa-history mr-2"></i>
|
| 128 |
</button>
|
| 129 |
</div>
|
| 130 |
</div>
|
| 131 |
|
| 132 |
-
<!--
|
| 133 |
-
<div id="
|
| 134 |
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] overflow-hidden">
|
| 135 |
-
<div id="
|
| 136 |
-
<h2 class="text-xl font-semibold">
|
| 137 |
-
<button onclick="
|
| 138 |
<i class="fas fa-times"></i>
|
| 139 |
</button>
|
| 140 |
</div>
|
| 141 |
-
<div class="
|
| 142 |
<div class="mb-6">
|
| 143 |
-
<label class="block text-gray-700 font-medium mb-2">
|
| 144 |
-
<input type="text" id="
|
| 145 |
</div>
|
| 146 |
|
| 147 |
<div class="mb-6">
|
| 148 |
-
<label class="block text-gray-700 font-medium mb-2">
|
| 149 |
<div class="flex items-center">
|
| 150 |
-
<input type="date" id="
|
| 151 |
-
<button onclick="
|
| 152 |
</div>
|
| 153 |
</div>
|
| 154 |
|
| 155 |
<div class="mb-6">
|
| 156 |
-
<label class="block text-gray-700 font-medium mb-2">
|
| 157 |
-
<textarea id="
|
| 158 |
</div>
|
| 159 |
|
| 160 |
<div class="mb-6">
|
| 161 |
<div class="flex justify-between items-center mb-2">
|
| 162 |
-
<label class="block text-gray-700 font-medium">
|
| 163 |
-
<button onclick="
|
| 164 |
-
<i class="fas fa-plus mr-1"></i>
|
| 165 |
</button>
|
| 166 |
</div>
|
| 167 |
-
<ul id="
|
| 168 |
-
<!--
|
| 169 |
</ul>
|
| 170 |
</div>
|
| 171 |
</div>
|
| 172 |
<div class="bg-gray-100 p-4 flex justify-between items-center">
|
| 173 |
-
<button onclick="
|
| 174 |
-
<i class="fas fa-trash mr-2"></i>
|
| 175 |
</button>
|
| 176 |
<div>
|
| 177 |
-
<button onclick="
|
| 178 |
-
<button onclick="
|
| 179 |
</div>
|
| 180 |
</div>
|
| 181 |
</div>
|
| 182 |
</div>
|
| 183 |
|
| 184 |
-
<!--
|
| 185 |
-
<div id="
|
| 186 |
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] overflow-hidden">
|
| 187 |
<div class="bg-purple-500 text-white p-4 flex justify-between items-center">
|
| 188 |
-
<h2 class="text-xl font-semibold">
|
| 189 |
-
<button onclick="
|
| 190 |
<i class="fas fa-times"></i>
|
| 191 |
</button>
|
| 192 |
</div>
|
| 193 |
<div class="p-4 overflow-y-auto max-h-[60vh]">
|
| 194 |
-
<div id="
|
| 195 |
-
<!--
|
| 196 |
</div>
|
| 197 |
</div>
|
| 198 |
<div class="bg-gray-100 p-4 flex justify-between items-center">
|
| 199 |
-
<button onclick="
|
| 200 |
-
<i class="fas fa-trash mr-2"></i>
|
| 201 |
</button>
|
| 202 |
-
<span id="
|
| 203 |
</div>
|
| 204 |
</div>
|
| 205 |
</div>
|
| 206 |
|
| 207 |
<script>
|
| 208 |
-
//
|
| 209 |
-
let
|
| 210 |
-
1: JSON.parse(localStorage.getItem('
|
| 211 |
-
2: JSON.parse(localStorage.getItem('
|
| 212 |
-
3: JSON.parse(localStorage.getItem('
|
| 213 |
-
4: JSON.parse(localStorage.getItem('
|
| 214 |
};
|
| 215 |
|
| 216 |
-
let
|
| 217 |
|
| 218 |
-
//
|
| 219 |
-
let
|
| 220 |
-
let
|
| 221 |
|
| 222 |
-
//
|
| 223 |
-
const
|
| 224 |
-
1: document.getElementById('
|
| 225 |
-
2: document.getElementById('
|
| 226 |
-
3: document.getElementById('
|
| 227 |
-
4: document.getElementById('
|
| 228 |
};
|
| 229 |
|
| 230 |
-
const
|
| 231 |
-
const
|
| 232 |
-
const
|
| 233 |
-
const
|
| 234 |
|
| 235 |
-
//
|
| 236 |
-
const
|
| 237 |
-
const
|
| 238 |
-
const
|
| 239 |
-
const
|
| 240 |
-
const
|
| 241 |
|
| 242 |
-
//
|
| 243 |
document.addEventListener('DOMContentLoaded', () => {
|
| 244 |
-
|
| 245 |
-
|
| 246 |
});
|
| 247 |
|
| 248 |
-
//
|
| 249 |
-
function
|
| 250 |
-
const
|
| 251 |
-
const
|
| 252 |
-
const
|
| 253 |
|
| 254 |
-
if (
|
| 255 |
-
const
|
| 256 |
id: Date.now(),
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
};
|
| 265 |
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
|
| 270 |
-
//
|
| 271 |
-
|
| 272 |
-
|
| 273 |
}
|
| 274 |
}
|
| 275 |
|
| 276 |
-
//
|
| 277 |
-
function
|
| 278 |
-
const
|
| 279 |
|
| 280 |
-
if (
|
| 281 |
-
const
|
| 282 |
-
|
| 283 |
|
| 284 |
-
if (
|
| 285 |
-
//
|
| 286 |
-
|
| 287 |
-
...
|
| 288 |
-
|
| 289 |
});
|
| 290 |
-
|
| 291 |
|
| 292 |
-
// Remove
|
| 293 |
-
|
| 294 |
}
|
| 295 |
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
}
|
| 300 |
}
|
| 301 |
|
| 302 |
-
//
|
| 303 |
-
function
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
}
|
| 309 |
|
| 310 |
-
//
|
| 311 |
-
function
|
| 312 |
-
const
|
| 313 |
-
if (!
|
| 314 |
|
| 315 |
-
|
| 316 |
-
|
| 317 |
|
| 318 |
-
//
|
| 319 |
-
|
| 320 |
|
| 321 |
-
//
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
|
| 326 |
-
//
|
| 327 |
-
|
| 328 |
|
| 329 |
-
//
|
| 330 |
-
|
| 331 |
}
|
| 332 |
|
| 333 |
-
//
|
| 334 |
-
function
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
}
|
| 339 |
|
| 340 |
-
//
|
| 341 |
-
function
|
| 342 |
-
if (!
|
| 343 |
|
| 344 |
-
//
|
| 345 |
-
const
|
| 346 |
-
if (
|
| 347 |
|
| 348 |
-
//
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
|
| 353 |
-
//
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
}
|
| 358 |
|
| 359 |
-
//
|
| 360 |
-
function
|
| 361 |
-
if (!
|
| 362 |
-
|
| 363 |
}
|
| 364 |
|
| 365 |
-
// Remove
|
| 366 |
-
function
|
| 367 |
-
|
| 368 |
}
|
| 369 |
|
| 370 |
-
//
|
| 371 |
-
function
|
| 372 |
-
if (!
|
| 373 |
|
| 374 |
-
const
|
| 375 |
-
if (
|
| 376 |
-
const
|
| 377 |
id: Date.now(),
|
| 378 |
-
|
| 379 |
-
|
| 380 |
};
|
| 381 |
|
| 382 |
-
//
|
| 383 |
-
const
|
| 384 |
-
if (
|
| 385 |
|
| 386 |
-
//
|
| 387 |
-
if (!
|
| 388 |
-
|
| 389 |
}
|
| 390 |
|
| 391 |
-
//
|
| 392 |
-
|
| 393 |
|
| 394 |
-
//
|
| 395 |
-
|
| 396 |
-
|
| 397 |
}
|
| 398 |
}
|
| 399 |
|
| 400 |
-
//
|
| 401 |
-
function
|
| 402 |
-
if (!
|
| 403 |
|
| 404 |
-
//
|
| 405 |
-
const
|
| 406 |
-
if (
|
| 407 |
|
| 408 |
-
//
|
| 409 |
-
const
|
| 410 |
-
if (
|
| 411 |
-
|
| 412 |
-
!
|
| 413 |
|
| 414 |
-
//
|
| 415 |
-
|
| 416 |
-
|
| 417 |
}
|
| 418 |
}
|
| 419 |
|
| 420 |
-
//
|
| 421 |
-
function
|
| 422 |
-
if (!
|
| 423 |
|
| 424 |
-
//
|
| 425 |
-
const
|
| 426 |
-
if (
|
| 427 |
|
| 428 |
-
//
|
| 429 |
-
|
| 430 |
-
|
| 431 |
|
| 432 |
-
//
|
| 433 |
-
|
| 434 |
-
|
| 435 |
}
|
| 436 |
|
| 437 |
-
//
|
| 438 |
-
function
|
| 439 |
-
for (let
|
| 440 |
-
|
| 441 |
}
|
| 442 |
}
|
| 443 |
|
| 444 |
-
//
|
| 445 |
-
function
|
| 446 |
-
const
|
| 447 |
-
|
| 448 |
|
| 449 |
-
if (
|
| 450 |
-
|
| 451 |
return;
|
| 452 |
}
|
| 453 |
|
| 454 |
-
|
| 455 |
const li = document.createElement('li');
|
| 456 |
-
li.className = `
|
| 457 |
-
li.onclick = () =>
|
| 458 |
|
| 459 |
-
// Checkbox
|
| 460 |
-
const
|
| 461 |
-
|
| 462 |
|
| 463 |
const checkbox = document.createElement('input');
|
| 464 |
checkbox.type = 'checkbox';
|
| 465 |
checkbox.className = 'mr-3 h-5 w-5';
|
| 466 |
-
checkbox.checked =
|
| 467 |
checkbox.onclick = (e) => {
|
| 468 |
e.stopPropagation();
|
| 469 |
-
|
| 470 |
};
|
| 471 |
|
| 472 |
-
const
|
| 473 |
-
|
| 474 |
-
|
| 475 |
|
| 476 |
-
|
| 477 |
-
|
| 478 |
|
| 479 |
-
//
|
| 480 |
-
const
|
| 481 |
-
|
| 482 |
|
| 483 |
-
if (
|
| 484 |
-
const
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
}
|
| 489 |
|
| 490 |
-
const
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
e.stopPropagation();
|
| 495 |
-
|
| 496 |
};
|
| 497 |
|
| 498 |
-
|
| 499 |
|
| 500 |
-
li.appendChild(
|
| 501 |
-
li.appendChild(
|
| 502 |
-
|
| 503 |
});
|
| 504 |
}
|
| 505 |
|
| 506 |
-
//
|
| 507 |
-
function
|
| 508 |
-
|
| 509 |
|
| 510 |
-
if (!
|
| 511 |
|
| 512 |
-
//
|
| 513 |
-
const
|
| 514 |
-
if (
|
| 515 |
|
| 516 |
-
const
|
| 517 |
|
| 518 |
-
if (!
|
| 519 |
-
|
| 520 |
return;
|
| 521 |
}
|
| 522 |
|
| 523 |
-
|
| 524 |
const li = document.createElement('li');
|
| 525 |
-
li.className = '
|
| 526 |
|
| 527 |
-
// Checkbox
|
| 528 |
-
const
|
| 529 |
-
|
| 530 |
|
| 531 |
const checkbox = document.createElement('input');
|
| 532 |
checkbox.type = 'checkbox';
|
| 533 |
checkbox.className = 'mr-3 h-4 w-4';
|
| 534 |
-
checkbox.checked =
|
| 535 |
-
checkbox.onclick = () =>
|
| 536 |
|
| 537 |
-
const
|
| 538 |
-
|
| 539 |
-
|
| 540 |
|
| 541 |
-
|
| 542 |
-
|
| 543 |
|
| 544 |
-
//
|
| 545 |
-
const
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
e.stopPropagation();
|
| 550 |
-
|
| 551 |
};
|
| 552 |
|
| 553 |
-
li.appendChild(
|
| 554 |
-
li.appendChild(
|
| 555 |
-
|
| 556 |
});
|
| 557 |
}
|
| 558 |
|
| 559 |
-
//
|
| 560 |
-
function
|
| 561 |
-
|
| 562 |
|
| 563 |
-
if (
|
| 564 |
-
|
| 565 |
-
|
| 566 |
return;
|
| 567 |
}
|
| 568 |
|
| 569 |
-
//
|
| 570 |
-
const
|
| 571 |
-
|
| 572 |
-
const
|
| 573 |
-
if (!
|
| 574 |
-
|
| 575 |
}
|
| 576 |
-
|
| 577 |
});
|
| 578 |
|
| 579 |
-
//
|
| 580 |
-
const
|
| 581 |
|
| 582 |
-
|
| 583 |
-
const
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
|
| 588 |
-
const
|
| 589 |
-
|
| 590 |
|
| 591 |
-
|
| 592 |
-
const
|
| 593 |
-
|
| 594 |
|
| 595 |
-
const
|
| 596 |
-
|
| 597 |
|
| 598 |
-
const
|
| 599 |
-
|
| 600 |
-
|
| 601 |
|
| 602 |
-
const
|
| 603 |
-
|
| 604 |
-
|
| 605 |
|
| 606 |
-
|
| 607 |
-
|
| 608 |
|
| 609 |
-
const
|
| 610 |
-
|
| 611 |
-
|
| 612 |
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
});
|
| 617 |
|
| 618 |
-
|
| 619 |
});
|
| 620 |
|
| 621 |
-
|
| 622 |
}
|
| 623 |
|
| 624 |
-
//
|
| 625 |
-
function
|
| 626 |
-
if (confirm('
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
}
|
| 631 |
}
|
| 632 |
|
| 633 |
-
//
|
| 634 |
-
function
|
| 635 |
-
|
| 636 |
-
|
| 637 |
}
|
| 638 |
|
| 639 |
-
//
|
| 640 |
-
function
|
| 641 |
-
localStorage.setItem(`
|
| 642 |
}
|
| 643 |
|
| 644 |
-
function
|
| 645 |
-
localStorage.setItem('
|
| 646 |
}
|
| 647 |
|
| 648 |
-
function
|
| 649 |
-
if (!
|
| 650 |
-
const
|
| 651 |
-
return
|
| 652 |
}
|
| 653 |
|
| 654 |
-
function
|
| 655 |
-
const
|
| 656 |
-
switch(
|
| 657 |
-
case 1: return `${
|
| 658 |
-
case 2: return `${
|
| 659 |
-
case 3: return `${
|
| 660 |
-
case 4: return `${
|
| 661 |
-
default: return `${
|
| 662 |
}
|
| 663 |
}
|
| 664 |
|
| 665 |
-
function
|
| 666 |
-
switch(
|
| 667 |
case 1: return 'bg-red-500';
|
| 668 |
case 2: return 'bg-blue-500';
|
| 669 |
case 3: return 'bg-yellow-500';
|
|
@@ -672,8 +672,8 @@
|
|
| 672 |
}
|
| 673 |
}
|
| 674 |
|
| 675 |
-
function
|
| 676 |
-
switch(
|
| 677 |
case 1: return 'bg-red-50 hover:bg-red-200';
|
| 678 |
case 2: return 'bg-blue-50 hover:bg-blue-200';
|
| 679 |
case 3: return 'bg-yellow-50 hover:bg-yellow-200';
|
|
@@ -682,12 +682,12 @@
|
|
| 682 |
}
|
| 683 |
}
|
| 684 |
|
| 685 |
-
function
|
| 686 |
-
switch(
|
| 687 |
-
case 1: return '
|
| 688 |
-
case 2: return '
|
| 689 |
-
case 3: return '
|
| 690 |
-
case 4: return '
|
| 691 |
default: return '';
|
| 692 |
}
|
| 693 |
}
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="pt-BR">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Matriz Eisenhower de Tarefas</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<style>
|
| 10 |
+
.quadrante {
|
| 11 |
min-height: 300px;
|
| 12 |
transition: all 0.3s ease;
|
| 13 |
}
|
| 14 |
+
.quadrante:hover {
|
| 15 |
transform: translateY(-5px);
|
| 16 |
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
| 17 |
}
|
| 18 |
+
.item-tarefa {
|
| 19 |
transition: all 0.2s ease;
|
| 20 |
cursor: pointer;
|
| 21 |
}
|
| 22 |
+
.item-tarefa:hover {
|
| 23 |
background-color: rgba(255,255,255,0.2);
|
| 24 |
}
|
| 25 |
+
.concluida {
|
| 26 |
text-decoration: line-through;
|
| 27 |
opacity: 0.7;
|
| 28 |
}
|
| 29 |
+
.badge-data {
|
| 30 |
font-size: 0.75rem;
|
| 31 |
padding: 0.15rem 0.4rem;
|
| 32 |
border-radius: 9999px;
|
|
|
|
| 34 |
.modal {
|
| 35 |
transition: all 0.3s ease;
|
| 36 |
}
|
| 37 |
+
.modal-aberto {
|
| 38 |
opacity: 1;
|
| 39 |
pointer-events: auto;
|
| 40 |
}
|
| 41 |
+
.item-subtarefa {
|
| 42 |
transition: all 0.2s ease;
|
| 43 |
}
|
| 44 |
+
.item-subtarefa:hover {
|
| 45 |
background-color: rgba(0,0,0,0.05);
|
| 46 |
}
|
| 47 |
+
.area-descricao {
|
| 48 |
min-height: 100px;
|
| 49 |
resize: none;
|
| 50 |
}
|
| 51 |
+
.cartao-tarefa {
|
| 52 |
max-height: 80vh;
|
| 53 |
overflow-y: auto;
|
| 54 |
}
|
| 55 |
+
.entrada-data-editar {
|
| 56 |
width: 120px;
|
| 57 |
}
|
| 58 |
</style>
|
|
|
|
| 60 |
<body class="bg-gray-100 min-h-screen">
|
| 61 |
<div class="container mx-auto px-4 py-8">
|
| 62 |
<header class="mb-8 text-center">
|
| 63 |
+
<h1 class="text-4xl font-bold text-gray-800 mb-2">Matriz Eisenhower</h1>
|
| 64 |
+
<p class="text-gray-600">Organize suas tarefas por urgência e importância</p>
|
| 65 |
</header>
|
| 66 |
|
| 67 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
|
| 68 |
+
<!-- Quadrante 1: Urgente & Importante -->
|
| 69 |
+
<div class="quadrante bg-red-100 rounded-lg shadow-lg p-6">
|
| 70 |
<div class="flex justify-between items-center mb-4">
|
| 71 |
+
<h2 class="text-xl font-semibold text-red-800">Urgente & Importante</h2>
|
| 72 |
+
<span class="bg-red-200 text-red-800 px-3 py-1 rounded-full text-sm">Faça Primeiro</span>
|
| 73 |
</div>
|
| 74 |
<div class="mb-4 flex">
|
| 75 |
+
<input type="text" id="entradaTarefa1" placeholder="Adicionar tarefa..." class="flex-grow px-4 py-2 rounded-l-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-red-500">
|
| 76 |
+
<input type="date" id="entradaData1" class="border border-gray-300 px-2">
|
| 77 |
+
<button onclick="adicionarTarefa(1)" class="bg-red-500 text-white px-4 py-2 rounded-r-lg hover:bg-red-600 transition"><i class="fas fa-plus"></i></button>
|
| 78 |
</div>
|
| 79 |
+
<ul id="listaTarefas1" class="space-y-2"></ul>
|
| 80 |
</div>
|
| 81 |
|
| 82 |
+
<!-- Quadrante 2: Não Urgente & Importante -->
|
| 83 |
+
<div class="quadrante bg-blue-100 rounded-lg shadow-lg p-6">
|
| 84 |
<div class="flex justify-between items-center mb-4">
|
| 85 |
+
<h2 class="text-xl font-semibold text-blue-800">Não Urgente & Importante</h2>
|
| 86 |
+
<span class="bg-blue-200 text-blue-800 px-3 py-1 rounded-full text-sm">Agende</span>
|
| 87 |
</div>
|
| 88 |
<div class="mb-4 flex">
|
| 89 |
+
<input type="text" id="entradaTarefa2" placeholder="Adicionar tarefa..." class="flex-grow px-4 py-2 rounded-l-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 90 |
+
<input type="date" id="entradaData2" class="border border-gray-300 px-2">
|
| 91 |
+
<button onclick="adicionarTarefa(2)" class="bg-blue-500 text-white px-4 py-2 rounded-r-lg hover:bg-blue-600 transition"><i class="fas fa-plus"></i></button>
|
| 92 |
</div>
|
| 93 |
+
<ul id="listaTarefas2" class="space-y-2"></ul>
|
| 94 |
</div>
|
| 95 |
|
| 96 |
+
<!-- Quadrante 3: Urgente & Não Importante -->
|
| 97 |
+
<div class="quadrante bg-yellow-100 rounded-lg shadow-lg p-6">
|
| 98 |
<div class="flex justify-between items-center mb-4">
|
| 99 |
+
<h2 class="text-xl font-semibold text-yellow-800">Urgente & Não Importante</h2>
|
| 100 |
+
<span class="bg-yellow-200 text-yellow-800 px-3 py-1 rounded-full text-sm">Delegue</span>
|
| 101 |
</div>
|
| 102 |
<div class="mb-4 flex">
|
| 103 |
+
<input type="text" id="entradaTarefa3" placeholder="Adicionar tarefa..." class="flex-grow px-4 py-2 rounded-l-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-yellow-500">
|
| 104 |
+
<input type="date" id="entradaData3" class="border border-gray-300 px-2">
|
| 105 |
+
<button onclick="adicionarTarefa(3)" class="bg-yellow-500 text-white px-4 py-2 rounded-r-lg hover:bg-yellow-600 transition"><i class="fas fa-plus"></i></button>
|
| 106 |
</div>
|
| 107 |
+
<ul id="listaTarefas3" class="space-y-2"></ul>
|
| 108 |
</div>
|
| 109 |
|
| 110 |
+
<!-- Quadrante 4: Não Urgente & Não Importante -->
|
| 111 |
+
<div class="quadrante bg-green-100 rounded-lg shadow-lg p-6">
|
| 112 |
<div class="flex justify-between items-center mb-4">
|
| 113 |
+
<h2 class="text-xl font-semibold text-green-800">Não Urgente & Não Importante</h2>
|
| 114 |
+
<span class="bg-green-200 text-green-800 px-3 py-1 rounded-full text-sm">Elimine</span>
|
| 115 |
</div>
|
| 116 |
<div class="mb-4 flex">
|
| 117 |
+
<input type="text" id="entradaTarefa4" placeholder="Adicionar tarefa..." class="flex-grow px-4 py-2 rounded-l-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-green-500">
|
| 118 |
+
<input type="date" id="entradaData4" class="border border-gray-300 px-2">
|
| 119 |
+
<button onclick="adicionarTarefa(4)" class="bg-green-500 text-white px-4 py-2 rounded-r-lg hover:bg-green-600 transition"><i class="fas fa-plus"></i></button>
|
| 120 |
</div>
|
| 121 |
+
<ul id="listaTarefas4" class="space-y-2"></ul>
|
| 122 |
</div>
|
| 123 |
</div>
|
| 124 |
|
| 125 |
<div class="text-center mt-8">
|
| 126 |
+
<button onclick="alternarModalHistorico()" class="bg-purple-500 text-white px-6 py-3 rounded-lg shadow-lg hover:bg-purple-600 transition flex items-center justify-center mx-auto">
|
| 127 |
+
<i class="fas fa-history mr-2"></i> Ver Histórico de Tarefas Concluídas
|
| 128 |
</button>
|
| 129 |
</div>
|
| 130 |
</div>
|
| 131 |
|
| 132 |
+
<!-- Modal de Detalhes da Tarefa -->
|
| 133 |
+
<div id="modalTarefa" class="modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 opacity-0 pointer-events-none">
|
| 134 |
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] overflow-hidden">
|
| 135 |
+
<div id="cabecalhoModalTarefa" class="p-4 flex justify-between items-center">
|
| 136 |
+
<h2 class="text-xl font-semibold">Detalhes da Tarefa</h2>
|
| 137 |
+
<button onclick="fecharModalTarefa()" class="text-gray-500 hover:text-gray-700">
|
| 138 |
<i class="fas fa-times"></i>
|
| 139 |
</button>
|
| 140 |
</div>
|
| 141 |
+
<div class="cartao-tarefa p-6 overflow-y-auto">
|
| 142 |
<div class="mb-6">
|
| 143 |
+
<label class="block text-gray-700 font-medium mb-2">Título da Tarefa</label>
|
| 144 |
+
<input type="text" id="tituloModalTarefa" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 145 |
</div>
|
| 146 |
|
| 147 |
<div class="mb-6">
|
| 148 |
+
<label class="block text-gray-700 font-medium mb-2">Data de Vencimento</label>
|
| 149 |
<div class="flex items-center">
|
| 150 |
+
<input type="date" id="dataModalTarefa" class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 entrada-data-editar">
|
| 151 |
+
<button onclick="removerDataTarefa()" class="ml-2 text-red-500 hover:text-red-700 text-sm">Remover Data</button>
|
| 152 |
</div>
|
| 153 |
</div>
|
| 154 |
|
| 155 |
<div class="mb-6">
|
| 156 |
+
<label class="block text-gray-700 font-medium mb-2">Descrição</label>
|
| 157 |
+
<textarea id="descricaoModalTarefa" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 area-descricao" placeholder="Adicione uma descrição detalhada..."></textarea>
|
| 158 |
</div>
|
| 159 |
|
| 160 |
<div class="mb-6">
|
| 161 |
<div class="flex justify-between items-center mb-2">
|
| 162 |
+
<label class="block text-gray-700 font-medium">Subtarefas</label>
|
| 163 |
+
<button onclick="adicionarSubtarefa()" class="text-blue-500 hover:text-blue-700 text-sm flex items-center">
|
| 164 |
+
<i class="fas fa-plus mr-1"></i> Adicionar Subtarefa
|
| 165 |
</button>
|
| 166 |
</div>
|
| 167 |
+
<ul id="subtasksModalTarefa" class="space-y-2 mt-2">
|
| 168 |
+
<!-- Subtarefas serão adicionadas aqui -->
|
| 169 |
</ul>
|
| 170 |
</div>
|
| 171 |
</div>
|
| 172 |
<div class="bg-gray-100 p-4 flex justify-between items-center">
|
| 173 |
+
<button onclick="excluirTarefaAtual()" class="text-red-500 hover:text-red-700 flex items-center">
|
| 174 |
+
<i class="fas fa-trash mr-2"></i> Excluir Tarefa
|
| 175 |
</button>
|
| 176 |
<div>
|
| 177 |
+
<button onclick="fecharModalTarefa()" class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg mr-2 hover:bg-gray-400">Cancelar</button>
|
| 178 |
+
<button onclick="salvarDetalhesTarefa()" class="bg-blue-500 text-white px-4 py-2 rounded-lg hover:bg-blue-600">Salvar Alterações</button>
|
| 179 |
</div>
|
| 180 |
</div>
|
| 181 |
</div>
|
| 182 |
</div>
|
| 183 |
|
| 184 |
+
<!-- Modal de Histórico -->
|
| 185 |
+
<div id="modalHistorico" class="modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 opacity-0 pointer-events-none">
|
| 186 |
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] overflow-hidden">
|
| 187 |
<div class="bg-purple-500 text-white p-4 flex justify-between items-center">
|
| 188 |
+
<h2 class="text-xl font-semibold">Histórico de Tarefas Concluídas</h2>
|
| 189 |
+
<button onclick="alternarModalHistorico()" class="text-white hover:text-gray-200">
|
| 190 |
<i class="fas fa-times"></i>
|
| 191 |
</button>
|
| 192 |
</div>
|
| 193 |
<div class="p-4 overflow-y-auto max-h-[60vh]">
|
| 194 |
+
<div id="conteudoHistorico" class="space-y-3">
|
| 195 |
+
<!-- Itens de histórico serão adicionados aqui -->
|
| 196 |
</div>
|
| 197 |
</div>
|
| 198 |
<div class="bg-gray-100 p-4 flex justify-between items-center">
|
| 199 |
+
<button onclick="limparHistorico()" class="text-red-500 hover:text-red-700 flex items-center">
|
| 200 |
+
<i class="fas fa-trash mr-2"></i> Limpar Histórico
|
| 201 |
</button>
|
| 202 |
+
<span id="contadorHistorico" class="text-gray-600">0 tarefas concluídas</span>
|
| 203 |
</div>
|
| 204 |
</div>
|
| 205 |
</div>
|
| 206 |
|
| 207 |
<script>
|
| 208 |
+
// Inicializa tarefas e histórico do localStorage
|
| 209 |
+
let tarefas = {
|
| 210 |
+
1: JSON.parse(localStorage.getItem('tarefas1')) || [],
|
| 211 |
+
2: JSON.parse(localStorage.getItem('tarefas2')) || [],
|
| 212 |
+
3: JSON.parse(localStorage.getItem('tarefas3')) || [],
|
| 213 |
+
4: JSON.parse(localStorage.getItem('tarefas4')) || []
|
| 214 |
};
|
| 215 |
|
| 216 |
+
let historico = JSON.parse(localStorage.getItem('historico')) || [];
|
| 217 |
|
| 218 |
+
// Tarefa atual sendo editada
|
| 219 |
+
let tarefaAtual = null;
|
| 220 |
+
let quadranteAtual = null;
|
| 221 |
|
| 222 |
+
// Elementos DOM
|
| 223 |
+
const listasTarefas = {
|
| 224 |
+
1: document.getElementById('listaTarefas1'),
|
| 225 |
+
2: document.getElementById('listaTarefas2'),
|
| 226 |
+
3: document.getElementById('listaTarefas3'),
|
| 227 |
+
4: document.getElementById('listaTarefas4')
|
| 228 |
};
|
| 229 |
|
| 230 |
+
const conteudoHistorico = document.getElementById('conteudoHistorico');
|
| 231 |
+
const contadorHistorico = document.getElementById('contadorHistorico');
|
| 232 |
+
const modalHistorico = document.getElementById('modalHistorico');
|
| 233 |
+
const modalTarefa = document.getElementById('modalTarefa');
|
| 234 |
|
| 235 |
+
// Elementos do modal de tarefa
|
| 236 |
+
const tituloModalTarefa = document.getElementById('tituloModalTarefa');
|
| 237 |
+
const dataModalTarefa = document.getElementById('dataModalTarefa');
|
| 238 |
+
const descricaoModalTarefa = document.getElementById('descricaoModalTarefa');
|
| 239 |
+
const subtasksModalTarefa = document.getElementById('subtasksModalTarefa');
|
| 240 |
+
const cabecalhoModalTarefa = document.getElementById('cabecalhoModalTarefa');
|
| 241 |
|
| 242 |
+
// Renderiza todas as tarefas ao carregar a página
|
| 243 |
document.addEventListener('DOMContentLoaded', () => {
|
| 244 |
+
renderizarTodasTarefas();
|
| 245 |
+
renderizarHistorico();
|
| 246 |
});
|
| 247 |
|
| 248 |
+
// Adiciona uma nova tarefa a um quadrante
|
| 249 |
+
function adicionarTarefa(quadrante) {
|
| 250 |
+
const entrada = document.getElementById(`entradaTarefa${quadrante}`);
|
| 251 |
+
const entradaData = document.getElementById(`entradaData${quadrante}`);
|
| 252 |
+
const textoTarefa = entrada.value.trim();
|
| 253 |
|
| 254 |
+
if (textoTarefa) {
|
| 255 |
+
const novaTarefa = {
|
| 256 |
id: Date.now(),
|
| 257 |
+
texto: textoTarefa,
|
| 258 |
+
concluida: false,
|
| 259 |
+
data: entradaData.value || null,
|
| 260 |
+
quadrante: quadrante,
|
| 261 |
+
criadaEm: new Date().toISOString(),
|
| 262 |
+
descricao: '',
|
| 263 |
+
subtarefas: []
|
| 264 |
};
|
| 265 |
|
| 266 |
+
tarefas[quadrante].push(novaTarefa);
|
| 267 |
+
salvarTarefas(quadrante);
|
| 268 |
+
renderizarTarefas(quadrante);
|
| 269 |
|
| 270 |
+
// Limpa os campos de entrada
|
| 271 |
+
entrada.value = '';
|
| 272 |
+
entradaData.value = '';
|
| 273 |
}
|
| 274 |
}
|
| 275 |
|
| 276 |
+
// Alterna o status de conclusão da tarefa
|
| 277 |
+
function alternarTarefa(quadrante, idTarefa) {
|
| 278 |
+
const indiceTarefa = tarefas[quadrante].findIndex(tarefa => tarefa.id === idTarefa);
|
| 279 |
|
| 280 |
+
if (indiceTarefa !== -1) {
|
| 281 |
+
const tarefa = tarefas[quadrante][indiceTarefa];
|
| 282 |
+
tarefa.concluida = !tarefa.concluida;
|
| 283 |
|
| 284 |
+
if (tarefa.concluida) {
|
| 285 |
+
// Adiciona ao histórico
|
| 286 |
+
historico.push({
|
| 287 |
+
...tarefa,
|
| 288 |
+
concluidaEm: new Date().toISOString()
|
| 289 |
});
|
| 290 |
+
salvarHistorico();
|
| 291 |
|
| 292 |
+
// Remove das tarefas ativas
|
| 293 |
+
tarefas[quadrante].splice(indiceTarefa, 1);
|
| 294 |
}
|
| 295 |
|
| 296 |
+
salvarTarefas(quadrante);
|
| 297 |
+
renderizarTarefas(quadrante);
|
| 298 |
+
renderizarHistorico();
|
| 299 |
}
|
| 300 |
}
|
| 301 |
|
| 302 |
+
// Exclui uma tarefa
|
| 303 |
+
function excluirTarefa(quadrante, idTarefa) {
|
| 304 |
+
tarefas[quadrante] = tarefas[quadrante].filter(tarefa => tarefa.id !== idTarefa);
|
| 305 |
+
salvarTarefas(quadrante);
|
| 306 |
+
renderizarTarefas(quadrante);
|
| 307 |
+
fecharModalTarefa();
|
| 308 |
}
|
| 309 |
|
| 310 |
+
// Abre o modal de detalhes da tarefa
|
| 311 |
+
function abrirModalTarefa(quadrante, idTarefa) {
|
| 312 |
+
const tarefa = tarefas[quadrante].find(t => t.id === idTarefa);
|
| 313 |
+
if (!tarefa) return;
|
| 314 |
|
| 315 |
+
tarefaAtual = tarefa;
|
| 316 |
+
quadranteAtual = quadrante;
|
| 317 |
|
| 318 |
+
// Define a cor do cabeçalho do modal com base no quadrante
|
| 319 |
+
cabecalhoModalTarefa.className = `p-4 flex justify-between items-center ${obterClasseBgQuadrante(quadrante)} text-white`;
|
| 320 |
|
| 321 |
+
// Preenche os campos do modal
|
| 322 |
+
tituloModalTarefa.value = tarefa.texto;
|
| 323 |
+
dataModalTarefa.value = tarefa.data || '';
|
| 324 |
+
descricaoModalTarefa.value = tarefa.descricao || '';
|
| 325 |
|
| 326 |
+
// Renderiza as subtarefas
|
| 327 |
+
renderizarSubtarefas();
|
| 328 |
|
| 329 |
+
// Mostra o modal
|
| 330 |
+
modalTarefa.classList.remove('opacity-0', 'pointer-events-none');
|
| 331 |
}
|
| 332 |
|
| 333 |
+
// Fecha o modal de detalhes da tarefa
|
| 334 |
+
function fecharModalTarefa() {
|
| 335 |
+
modalTarefa.classList.add('opacity-0', 'pointer-events-none');
|
| 336 |
+
tarefaAtual = null;
|
| 337 |
+
quadranteAtual = null;
|
| 338 |
}
|
| 339 |
|
| 340 |
+
// Salva os detalhes da tarefa do modal
|
| 341 |
+
function salvarDetalhesTarefa() {
|
| 342 |
+
if (!tarefaAtual || !quadranteAtual) return;
|
| 343 |
|
| 344 |
+
// Encontra a tarefa no array
|
| 345 |
+
const indiceTarefa = tarefas[quadranteAtual].findIndex(t => t.id === tarefaAtual.id);
|
| 346 |
+
if (indiceTarefa === -1) return;
|
| 347 |
|
| 348 |
+
// Atualiza as propriedades da tarefa
|
| 349 |
+
tarefas[quadranteAtual][indiceTarefa].texto = tituloModalTarefa.value;
|
| 350 |
+
tarefas[quadranteAtual][indiceTarefa].data = dataModalTarefa.value || null;
|
| 351 |
+
tarefas[quadranteAtual][indiceTarefa].descricao = descricaoModalTarefa.value;
|
| 352 |
|
| 353 |
+
// Salva e renderiza
|
| 354 |
+
salvarTarefas(quadranteAtual);
|
| 355 |
+
renderizarTarefas(quadranteAtual);
|
| 356 |
+
fecharModalTarefa();
|
| 357 |
}
|
| 358 |
|
| 359 |
+
// Exclui a tarefa atual sendo editada
|
| 360 |
+
function excluirTarefaAtual() {
|
| 361 |
+
if (!tarefaAtual || !quadranteAtual) return;
|
| 362 |
+
excluirTarefa(quadranteAtual, tarefaAtual.id);
|
| 363 |
}
|
| 364 |
|
| 365 |
+
// Remove a data da tarefa atual
|
| 366 |
+
function removerDataTarefa() {
|
| 367 |
+
dataModalTarefa.value = '';
|
| 368 |
}
|
| 369 |
|
| 370 |
+
// Adiciona uma nova subtarefa
|
| 371 |
+
function adicionarSubtarefa() {
|
| 372 |
+
if (!tarefaAtual || !quadranteAtual) return;
|
| 373 |
|
| 374 |
+
const textoSubtarefa = prompt('Digite a subtarefa:');
|
| 375 |
+
if (textoSubtarefa && textoSubtarefa.trim()) {
|
| 376 |
+
const novaSubtarefa = {
|
| 377 |
id: Date.now(),
|
| 378 |
+
texto: textoSubtarefa.trim(),
|
| 379 |
+
concluida: false
|
| 380 |
};
|
| 381 |
|
| 382 |
+
// Encontra a tarefa no array
|
| 383 |
+
const indiceTarefa = tarefas[quadranteAtual].findIndex(t => t.id === tarefaAtual.id);
|
| 384 |
+
if (indiceTarefa === -1) return;
|
| 385 |
|
| 386 |
+
// Inicializa o array de subtarefas se não existir
|
| 387 |
+
if (!tarefas[quadranteAtual][indiceTarefa].subtarefas) {
|
| 388 |
+
tarefas[quadranteAtual][indiceTarefa].subtarefas = [];
|
| 389 |
}
|
| 390 |
|
| 391 |
+
// Adiciona a subtarefa
|
| 392 |
+
tarefas[quadranteAtual][indiceTarefa].subtarefas.push(novaSubtarefa);
|
| 393 |
|
| 394 |
+
// Salva e renderiza
|
| 395 |
+
salvarTarefas(quadranteAtual);
|
| 396 |
+
renderizarSubtarefas();
|
| 397 |
}
|
| 398 |
}
|
| 399 |
|
| 400 |
+
// Alterna o status de conclusão da subtarefa
|
| 401 |
+
function alternarSubtarefa(idSubtarefa) {
|
| 402 |
+
if (!tarefaAtual || !quadranteAtual) return;
|
| 403 |
|
| 404 |
+
// Encontra a tarefa no array
|
| 405 |
+
const indiceTarefa = tarefas[quadranteAtual].findIndex(t => t.id === tarefaAtual.id);
|
| 406 |
+
if (indiceTarefa === -1) return;
|
| 407 |
|
| 408 |
+
// Encontra e alterna a subtarefa
|
| 409 |
+
const indiceSubtarefa = tarefas[quadranteAtual][indiceTarefa].subtarefas.findIndex(st => st.id === idSubtarefa);
|
| 410 |
+
if (indiceSubtarefa !== -1) {
|
| 411 |
+
tarefas[quadranteAtual][indiceTarefa].subtarefas[indiceSubtarefa].concluida =
|
| 412 |
+
!tarefas[quadranteAtual][indiceTarefa].subtarefas[indiceSubtarefa].concluida;
|
| 413 |
|
| 414 |
+
// Salva e renderiza
|
| 415 |
+
salvarTarefas(quadranteAtual);
|
| 416 |
+
renderizarSubtarefas();
|
| 417 |
}
|
| 418 |
}
|
| 419 |
|
| 420 |
+
// Exclui uma subtarefa
|
| 421 |
+
function excluirSubtarefa(idSubtarefa) {
|
| 422 |
+
if (!tarefaAtual || !quadranteAtual) return;
|
| 423 |
|
| 424 |
+
// Encontra a tarefa no array
|
| 425 |
+
const indiceTarefa = tarefas[quadranteAtual].findIndex(t => t.id === tarefaAtual.id);
|
| 426 |
+
if (indiceTarefa === -1) return;
|
| 427 |
|
| 428 |
+
// Filtra a subtarefa
|
| 429 |
+
tarefas[quadranteAtual][indiceTarefa].subtarefas =
|
| 430 |
+
tarefas[quadranteAtual][indiceTarefa].subtarefas.filter(st => st.id !== idSubtarefa);
|
| 431 |
|
| 432 |
+
// Salva e renderiza
|
| 433 |
+
salvarTarefas(quadranteAtual);
|
| 434 |
+
renderizarSubtarefas();
|
| 435 |
}
|
| 436 |
|
| 437 |
+
// Renderiza todas as tarefas
|
| 438 |
+
function renderizarTodasTarefas() {
|
| 439 |
+
for (let quadrante = 1; quadrante <= 4; quadrante++) {
|
| 440 |
+
renderizarTarefas(quadrante);
|
| 441 |
}
|
| 442 |
}
|
| 443 |
|
| 444 |
+
// Renderiza as tarefas de um quadrante específico
|
| 445 |
+
function renderizarTarefas(quadrante) {
|
| 446 |
+
const lista = listasTarefas[quadrante];
|
| 447 |
+
lista.innerHTML = '';
|
| 448 |
|
| 449 |
+
if (tarefas[quadrante].length === 0) {
|
| 450 |
+
lista.innerHTML = '<li class="text-gray-500 italic">Nenhuma tarefa ainda. Adicione uma acima!</li>';
|
| 451 |
return;
|
| 452 |
}
|
| 453 |
|
| 454 |
+
tarefas[quadrante].forEach(tarefa => {
|
| 455 |
const li = document.createElement('li');
|
| 456 |
+
li.className = `item-tarefa ${obterClasseHoverQuadrante(quadrante)} p-3 rounded-lg flex items-center justify-between`;
|
| 457 |
+
li.onclick = () => abrirModalTarefa(quadrante, tarefa.id);
|
| 458 |
|
| 459 |
+
// Checkbox e texto
|
| 460 |
+
const divEsquerda = document.createElement('div');
|
| 461 |
+
divEsquerda.className = 'flex items-center';
|
| 462 |
|
| 463 |
const checkbox = document.createElement('input');
|
| 464 |
checkbox.type = 'checkbox';
|
| 465 |
checkbox.className = 'mr-3 h-5 w-5';
|
| 466 |
+
checkbox.checked = tarefa.concluida;
|
| 467 |
checkbox.onclick = (e) => {
|
| 468 |
e.stopPropagation();
|
| 469 |
+
alternarTarefa(quadrante, tarefa.id);
|
| 470 |
};
|
| 471 |
|
| 472 |
+
const textoTarefa = document.createElement('span');
|
| 473 |
+
textoTarefa.className = tarefa.concluida ? 'concluida' : '';
|
| 474 |
+
textoTarefa.textContent = tarefa.texto;
|
| 475 |
|
| 476 |
+
divEsquerda.appendChild(checkbox);
|
| 477 |
+
divEsquerda.appendChild(textoTarefa);
|
| 478 |
|
| 479 |
+
// Lado direito (data e botão de exclusão)
|
| 480 |
+
const divDireita = document.createElement('div');
|
| 481 |
+
divDireita.className = 'flex items-center';
|
| 482 |
|
| 483 |
+
if (tarefa.data) {
|
| 484 |
+
const badgeData = document.createElement('span');
|
| 485 |
+
badgeData.className = `badge-data ${obterClasseCorQuadrante(quadrante, true)} mr-2`;
|
| 486 |
+
badgeData.textContent = formatarData(tarefa.data);
|
| 487 |
+
divDireita.appendChild(badgeData);
|
| 488 |
}
|
| 489 |
|
| 490 |
+
const botaoExcluir = document.createElement('button');
|
| 491 |
+
botaoExcluir.className = 'text-gray-500 hover:text-gray-700';
|
| 492 |
+
botaoExcluir.innerHTML = '<i class="fas fa-ellipsis-v"></i>';
|
| 493 |
+
botaoExcluir.onclick = (e) => {
|
| 494 |
e.stopPropagation();
|
| 495 |
+
abrirModalTarefa(quadrante, tarefa.id);
|
| 496 |
};
|
| 497 |
|
| 498 |
+
divDireita.appendChild(botaoExcluir);
|
| 499 |
|
| 500 |
+
li.appendChild(divEsquerda);
|
| 501 |
+
li.appendChild(divDireita);
|
| 502 |
+
lista.appendChild(li);
|
| 503 |
});
|
| 504 |
}
|
| 505 |
|
| 506 |
+
// Renderiza as subtarefas no modal
|
| 507 |
+
function renderizarSubtarefas() {
|
| 508 |
+
subtasksModalTarefa.innerHTML = '';
|
| 509 |
|
| 510 |
+
if (!tarefaAtual || !quadranteAtual) return;
|
| 511 |
|
| 512 |
+
// Encontra a tarefa no array
|
| 513 |
+
const indiceTarefa = tarefas[quadranteAtual].findIndex(t => t.id === tarefaAtual.id);
|
| 514 |
+
if (indiceTarefa === -1) return;
|
| 515 |
|
| 516 |
+
const tarefa = tarefas[quadranteAtual][indiceTarefa];
|
| 517 |
|
| 518 |
+
if (!tarefa.subtarefas || tarefa.subtarefas.length === 0) {
|
| 519 |
+
subtasksModalTarefa.innerHTML = '<li class="text-gray-500 italic text-sm">Nenhuma subtarefa ainda.</li>';
|
| 520 |
return;
|
| 521 |
}
|
| 522 |
|
| 523 |
+
tarefa.subtarefas.forEach(subtarefa => {
|
| 524 |
const li = document.createElement('li');
|
| 525 |
+
li.className = 'item-subtarefa bg-gray-50 p-2 rounded flex items-center justify-between';
|
| 526 |
|
| 527 |
+
// Checkbox e texto
|
| 528 |
+
const divEsquerda = document.createElement('div');
|
| 529 |
+
divEsquerda.className = 'flex items-center';
|
| 530 |
|
| 531 |
const checkbox = document.createElement('input');
|
| 532 |
checkbox.type = 'checkbox';
|
| 533 |
checkbox.className = 'mr-3 h-4 w-4';
|
| 534 |
+
checkbox.checked = subtarefa.concluida;
|
| 535 |
+
checkbox.onclick = () => alternarSubtarefa(subtarefa.id);
|
| 536 |
|
| 537 |
+
const textoSubtarefa = document.createElement('span');
|
| 538 |
+
textoSubtarefa.className = subtarefa.concluida ? 'concluida text-sm' : 'text-sm';
|
| 539 |
+
textoSubtarefa.textContent = subtarefa.texto;
|
| 540 |
|
| 541 |
+
divEsquerda.appendChild(checkbox);
|
| 542 |
+
divEsquerda.appendChild(textoSubtarefa);
|
| 543 |
|
| 544 |
+
// Botão de exclusão
|
| 545 |
+
const botaoExcluir = document.createElement('button');
|
| 546 |
+
botaoExcluir.className = 'text-red-400 hover:text-red-600 text-sm';
|
| 547 |
+
botaoExcluir.innerHTML = '<i class="fas fa-times"></i>';
|
| 548 |
+
botaoExcluir.onclick = (e) => {
|
| 549 |
e.stopPropagation();
|
| 550 |
+
excluirSubtarefa(subtarefa.id);
|
| 551 |
};
|
| 552 |
|
| 553 |
+
li.appendChild(divEsquerda);
|
| 554 |
+
li.appendChild(botaoExcluir);
|
| 555 |
+
subtasksModalTarefa.appendChild(li);
|
| 556 |
});
|
| 557 |
}
|
| 558 |
|
| 559 |
+
// Renderiza o histórico
|
| 560 |
+
function renderizarHistorico() {
|
| 561 |
+
conteudoHistorico.innerHTML = '';
|
| 562 |
|
| 563 |
+
if (historico.length === 0) {
|
| 564 |
+
conteudoHistorico.innerHTML = '<p class="text-gray-500 italic">Nenhuma tarefa concluída ainda.</p>';
|
| 565 |
+
contadorHistorico.textContent = '0 tarefas concluídas';
|
| 566 |
return;
|
| 567 |
}
|
| 568 |
|
| 569 |
+
// Agrupa por data de conclusão
|
| 570 |
+
const historicoAgrupado = {};
|
| 571 |
+
historico.forEach(tarefa => {
|
| 572 |
+
const data = new Date(tarefa.concluidaEm).toLocaleDateString();
|
| 573 |
+
if (!historicoAgrupado[data]) {
|
| 574 |
+
historicoAgrupado[data] = [];
|
| 575 |
}
|
| 576 |
+
historicoAgrupado[data].push(tarefa);
|
| 577 |
});
|
| 578 |
|
| 579 |
+
// Ordena datas em ordem decrescente
|
| 580 |
+
const datasOrdenadas = Object.keys(historicoAgrupado).sort((a, b) => new Date(b) - new Date(a));
|
| 581 |
|
| 582 |
+
datasOrdenadas.forEach(data => {
|
| 583 |
+
const cabecalhoData = document.createElement('h3');
|
| 584 |
+
cabecalhoData.className = 'font-semibold text-gray-700 mt-4 mb-2';
|
| 585 |
+
cabecalhoData.textContent = data;
|
| 586 |
+
conteudoHistorico.appendChild(cabecalhoData);
|
| 587 |
|
| 588 |
+
const listaData = document.createElement('div');
|
| 589 |
+
listaData.className = 'space-y-2';
|
| 590 |
|
| 591 |
+
historicoAgrupado[data].forEach(tarefa => {
|
| 592 |
+
const divTarefa = document.createElement('div');
|
| 593 |
+
divTarefa.className = 'bg-gray-50 p-3 rounded-lg flex items-center justify-between';
|
| 594 |
|
| 595 |
+
const divEsquerda = document.createElement('div');
|
| 596 |
+
divEsquerda.className = 'flex items-center';
|
| 597 |
|
| 598 |
+
const badgeQuadrante = document.createElement('span');
|
| 599 |
+
badgeQuadrante.className = `badge-data ${obterClasseCorQuadrante(tarefa.quadrante, true)} mr-3`;
|
| 600 |
+
badgeQuadrante.textContent = obterNomeQuadrante(tarefa.quadrante);
|
| 601 |
|
| 602 |
+
const textoTarefa = document.createElement('span');
|
| 603 |
+
textoTarefa.className = 'concluida';
|
| 604 |
+
textoTarefa.textContent = tarefa.texto;
|
| 605 |
|
| 606 |
+
divEsquerda.appendChild(badgeQuadrante);
|
| 607 |
+
divEsquerda.appendChild(textoTarefa);
|
| 608 |
|
| 609 |
+
const divDireita = document.createElement('div');
|
| 610 |
+
divDireita.className = 'text-sm text-gray-500';
|
| 611 |
+
divDireita.textContent = new Date(tarefa.concluidaEm).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});
|
| 612 |
|
| 613 |
+
divTarefa.appendChild(divEsquerda);
|
| 614 |
+
divTarefa.appendChild(divDireita);
|
| 615 |
+
listaData.appendChild(divTarefa);
|
| 616 |
});
|
| 617 |
|
| 618 |
+
conteudoHistorico.appendChild(listaData);
|
| 619 |
});
|
| 620 |
|
| 621 |
+
contadorHistorico.textContent = `${historico.length} tarefa${historico.length !== 1 ? 's' : ''} concluída${historico.length !== 1 ? 's' : ''}`;
|
| 622 |
}
|
| 623 |
|
| 624 |
+
// Limpa o histórico
|
| 625 |
+
function limparHistorico() {
|
| 626 |
+
if (confirm('Tem certeza que deseja limpar todo o histórico?')) {
|
| 627 |
+
historico = [];
|
| 628 |
+
salvarHistorico();
|
| 629 |
+
renderizarHistorico();
|
| 630 |
}
|
| 631 |
}
|
| 632 |
|
| 633 |
+
// Alterna o modal de histórico
|
| 634 |
+
function alternarModalHistorico() {
|
| 635 |
+
modalHistorico.classList.toggle('opacity-0');
|
| 636 |
+
modalHistorico.classList.toggle('pointer-events-none');
|
| 637 |
}
|
| 638 |
|
| 639 |
+
// Funções auxiliares
|
| 640 |
+
function salvarTarefas(quadrante) {
|
| 641 |
+
localStorage.setItem(`tarefas${quadrante}`, JSON.stringify(tarefas[quadrante]));
|
| 642 |
}
|
| 643 |
|
| 644 |
+
function salvarHistorico() {
|
| 645 |
+
localStorage.setItem('historico', JSON.stringify(historico));
|
| 646 |
}
|
| 647 |
|
| 648 |
+
function formatarData(dataString) {
|
| 649 |
+
if (!dataString) return '';
|
| 650 |
+
const data = new Date(dataString);
|
| 651 |
+
return data.toLocaleDateString([], {month: 'short', day: 'numeric'});
|
| 652 |
}
|
| 653 |
|
| 654 |
+
function obterClasseCorQuadrante(quadrante, isBg = false) {
|
| 655 |
+
const prefixo = isBg ? 'bg' : 'text';
|
| 656 |
+
switch(quadrante) {
|
| 657 |
+
case 1: return `${prefixo}-red-500`;
|
| 658 |
+
case 2: return `${prefixo}-blue-500`;
|
| 659 |
+
case 3: return `${prefixo}-yellow-500`;
|
| 660 |
+
case 4: return `${prefixo}-green-500`;
|
| 661 |
+
default: return `${prefixo}-gray-500`;
|
| 662 |
}
|
| 663 |
}
|
| 664 |
|
| 665 |
+
function obterClasseBgQuadrante(quadrante) {
|
| 666 |
+
switch(quadrante) {
|
| 667 |
case 1: return 'bg-red-500';
|
| 668 |
case 2: return 'bg-blue-500';
|
| 669 |
case 3: return 'bg-yellow-500';
|
|
|
|
| 672 |
}
|
| 673 |
}
|
| 674 |
|
| 675 |
+
function obterClasseHoverQuadrante(quadrante) {
|
| 676 |
+
switch(quadrante) {
|
| 677 |
case 1: return 'bg-red-50 hover:bg-red-200';
|
| 678 |
case 2: return 'bg-blue-50 hover:bg-blue-200';
|
| 679 |
case 3: return 'bg-yellow-50 hover:bg-yellow-200';
|
|
|
|
| 682 |
}
|
| 683 |
}
|
| 684 |
|
| 685 |
+
function obterNomeQuadrante(quadrante) {
|
| 686 |
+
switch(quadrante) {
|
| 687 |
+
case 1: return 'Urgente & Importante';
|
| 688 |
+
case 2: return 'Não Urgente & Importante';
|
| 689 |
+
case 3: return 'Urgente & Não Importante';
|
| 690 |
+
case 4: return 'Não Urgente & Não Importante';
|
| 691 |
default: return '';
|
| 692 |
}
|
| 693 |
}
|