Spaces:
Running
Running
Add 2 files
Browse files- index.html +436 -530
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -278,7 +278,7 @@
|
|
| 278 |
|
| 279 |
input:checked + .slider .fa-moon {
|
| 280 |
opacity: 0;
|
| 281 |
-
}
|
| 282 |
|
| 283 |
/* Custom styles for score controls */
|
| 284 |
.score-controls {
|
|
@@ -325,55 +325,53 @@
|
|
| 325 |
font-weight: 600;
|
| 326 |
}
|
| 327 |
|
| 328 |
-
/*
|
| 329 |
-
.
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
margin-top:
|
| 335 |
-
|
| 336 |
}
|
| 337 |
|
| 338 |
-
.
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
align-items: center;
|
| 343 |
-
justify-content: space-between;
|
| 344 |
}
|
| 345 |
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
}
|
| 350 |
|
| 351 |
-
.
|
| 352 |
-
|
| 353 |
-
background-color: rgba(0, 0, 0, 0.1);
|
| 354 |
-
border-radius: 5px;
|
| 355 |
-
margin-top: 8px;
|
| 356 |
-
overflow: hidden;
|
| 357 |
}
|
| 358 |
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
}
|
| 364 |
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
background-color: #744210;
|
| 368 |
-
color: #faf089;
|
| 369 |
}
|
| 370 |
|
| 371 |
-
|
| 372 |
-
|
|
|
|
| 373 |
}
|
| 374 |
|
| 375 |
-
.
|
| 376 |
-
|
|
|
|
| 377 |
}
|
| 378 |
</style>
|
| 379 |
</head>
|
|
@@ -406,7 +404,7 @@
|
|
| 406 |
</div>
|
| 407 |
|
| 408 |
<div id="player-names" class="hidden">
|
| 409 |
-
<h3 class="text-xl font-medium mb-3 text-gray-700">Nomes dos Jogadores:</
|
| 410 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
|
| 411 |
<div id="player1-input" class="hidden">
|
| 412 |
<label class="block text-gray-700 mb-1">Jogador 1:</label>
|
|
@@ -431,318 +429,252 @@
|
|
| 431 |
|
| 432 |
<!-- Main Game Section -->
|
| 433 |
<div id="game-section" class="hidden">
|
| 434 |
-
<!--
|
| 435 |
-
<div class="
|
| 436 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 437 |
</div>
|
| 438 |
|
| 439 |
-
<!--
|
| 440 |
-
<div id="
|
| 441 |
-
<
|
| 442 |
-
<div class="
|
| 443 |
-
<div class="
|
| 444 |
-
<
|
| 445 |
-
|
| 446 |
-
<
|
|
|
|
|
|
|
|
|
|
| 447 |
</div>
|
| 448 |
</div>
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
<
|
| 452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 453 |
</div>
|
| 454 |
</div>
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
<
|
| 458 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 459 |
</div>
|
| 460 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 461 |
</div>
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 466 |
</div>
|
| 467 |
</div>
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 475 |
|
| 476 |
-
<div class="space-y-4">
|
| 477 |
-
<!--
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
<input type="number" min="6" max="20" class="score-input border rounded" data-category="carros" value="6" onchange="updatePeValues()">
|
| 488 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('carros', 1)">+</button>
|
| 489 |
-
<span class="ml-2 text-lg">/10 (PE: <span id="pe-carros" class="font-bold">0</span>)</span>
|
| 490 |
-
</div>
|
| 491 |
-
</div>
|
| 492 |
</div>
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
<div class="category-card category-color-samba p-4 rounded-lg">
|
| 496 |
-
<div class="category-header flex items-center mb-2">
|
| 497 |
-
<i class="fas fa-music mr-2"></i>
|
| 498 |
-
<h3>Samba Enredo</h3>
|
| 499 |
-
</div>
|
| 500 |
-
<div class="category-body">
|
| 501 |
-
<p class="text-sm mb-3">Último cubo amarelo na Ficha de Carnavalesco</p>
|
| 502 |
-
<div class="score-controls">
|
| 503 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('samba', -1)">-</button>
|
| 504 |
-
<input type="number" min="6" max="10" class="score-input border rounded" data-category="samba" value="6">
|
| 505 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('samba', 1)">+</button>
|
| 506 |
-
</div>
|
| 507 |
-
</div>
|
| 508 |
</div>
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
</div>
|
| 523 |
-
</div>
|
| 524 |
</div>
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
<div class="category-card category-color-comissao p-4 rounded-lg">
|
| 528 |
-
<div class="category-header flex items-center mb-2">
|
| 529 |
-
<i class="fas fa-users mr-2"></i>
|
| 530 |
-
<h3>Comissão de Frente</h3>
|
| 531 |
-
</div>
|
| 532 |
-
<div class="category-body">
|
| 533 |
-
<p class="text-sm mb-3">Pontos base + valores das fichas de Comissão</p>
|
| 534 |
-
<div class="score-controls">
|
| 535 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('comissao', -1)">-</button>
|
| 536 |
-
<input type="number" min="6" max="20" class="score-input border rounded" data-category="comissao" value="6" onchange="updatePeValues()">
|
| 537 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('comissao', 1)">+</button>
|
| 538 |
-
<span class="ml-2 text-lg">/10 (PE: <span id="pe-comissao" class="font-bold">0</span>)</span>
|
| 539 |
-
</div>
|
| 540 |
-
</div>
|
| 541 |
</div>
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
</div>
|
| 556 |
-
</div>
|
| 557 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 558 |
</div>
|
| 559 |
</div>
|
| 560 |
|
| 561 |
-
<!--
|
| 562 |
-
<div class="
|
| 563 |
-
<
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
<
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
<h3>Fantasias</h3>
|
| 571 |
-
</div>
|
| 572 |
-
<div class="category-body">
|
| 573 |
-
<p class="text-sm mb-3">Soma dos pontos das Cartas de Fantasias</p>
|
| 574 |
-
<div class="score-controls">
|
| 575 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('fantasias', -1)">-</button>
|
| 576 |
-
<input type="number" min="0" max="20" class="score-input border rounded" data-category="fantasias" value="0">
|
| 577 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('fantasias', 1)">+</button>
|
| 578 |
-
</div>
|
| 579 |
-
</div>
|
| 580 |
-
</div>
|
| 581 |
-
|
| 582 |
-
<!-- Bateria -->
|
| 583 |
-
<div class="category-card category-color-bateria p-4 rounded-lg">
|
| 584 |
-
<div class="category-header flex items-center mb-2">
|
| 585 |
-
<i class="fas fa-drum mr-2"></i>
|
| 586 |
-
<h3>Bateria</h3>
|
| 587 |
-
</div>
|
| 588 |
-
<div class="category-body">
|
| 589 |
-
<p class="text-sm mb-3">Pontos base + valores das fichas de Bateria</p>
|
| 590 |
-
<div class="score-controls">
|
| 591 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('bateria', -1)">-</button>
|
| 592 |
-
<input type="number" min="5" max="20" class="score-input border rounded" data-category="bateria" value="5" onchange="updatePeValues()">
|
| 593 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('bateria', 1)">+</button>
|
| 594 |
-
<span class="ml-2 text-lg">/10 (PE: <span id="pe-bateria" class="font-bold">0</span>)</span>
|
| 595 |
-
</div>
|
| 596 |
-
</div>
|
| 597 |
-
</div>
|
| 598 |
-
|
| 599 |
-
<!-- Evolução -->
|
| 600 |
-
<div class="category-card category-color-evolucao p-4 rounded-lg">
|
| 601 |
-
<div class="category-header flex items-center mb-2">
|
| 602 |
-
<i class="fas fa-route mr-2"></i>
|
| 603 |
-
<h3>Evolução</h3>
|
| 604 |
-
</div>
|
| 605 |
-
<div class="category-body">
|
| 606 |
-
<p class="text-sm mb-3">Pontos base + valores das fichas de Evolução</p>
|
| 607 |
-
<div class="score-controls">
|
| 608 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('evolucao', -1)">-</button>
|
| 609 |
-
<input type="number" min="5" max="10" class="score-input border rounded" data-category="evolucao" value="5">
|
| 610 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('evolucao', 1)">+</button>
|
| 611 |
-
</div>
|
| 612 |
-
</div>
|
| 613 |
-
</div>
|
| 614 |
-
|
| 615 |
-
<!-- Harmonia -->
|
| 616 |
-
<div class="category-card category-color-harmonia p-4 rounded-lg">
|
| 617 |
-
<div class="category-header flex items-center mb-2">
|
| 618 |
-
<i class="fas fa-heart mr-2"></i>
|
| 619 |
-
<h3>Harmonia</h3>
|
| 620 |
-
</div>
|
| 621 |
-
<div class="category-body">
|
| 622 |
-
<p class="text-sm mb-3">Último cubo azul no tabuleiro individual</p>
|
| 623 |
-
<div class="score-controls">
|
| 624 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('harmonia', -1)">-</button>
|
| 625 |
-
<input type="number" min="5" max="10" class="score-input border rounded" data-category="harmonia" value="5">
|
| 626 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('harmonia', 1)">+</button>
|
| 627 |
-
</div>
|
| 628 |
-
</div>
|
| 629 |
-
</div>
|
| 630 |
</div>
|
| 631 |
</div>
|
| 632 |
|
| 633 |
-
<
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
<input type="number" min="0" class="additional-input border rounded w-16 text-center" data-category="feitos" placeholder="0" onchange="updatePeValues()">
|
| 648 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('feitos', 1)">+</button>
|
| 649 |
-
</div>
|
| 650 |
-
</div>
|
| 651 |
-
</div>
|
| 652 |
-
|
| 653 |
-
<!-- Palpites -->
|
| 654 |
-
<div class="additional-points-card p-3 rounded-lg bg-gray-50">
|
| 655 |
-
<div class="flex justify-between items-center">
|
| 656 |
-
<div>
|
| 657 |
-
<h3 class="font-medium text-lg">Palpites</h3>
|
| 658 |
-
<p class="text-sm text-gray-600">Realizados no tabuleiro do Sambódromo</p>
|
| 659 |
-
</div>
|
| 660 |
-
<div class="score-controls">
|
| 661 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('palpites', -1)">-</button>
|
| 662 |
-
<input type="number" min="0" class="additional-input border rounded w-16 text-center" data-category="palpites" placeholder="0" onchange="updatePeValues()">
|
| 663 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('palpites', 1)">+</button>
|
| 664 |
-
</div>
|
| 665 |
-
</div>
|
| 666 |
-
</div>
|
| 667 |
-
|
| 668 |
-
<!-- Entusiastas -->
|
| 669 |
-
<div class="additional-points-card p-3 rounded-lg bg-gray-50">
|
| 670 |
-
<div class="flex justify-between items-center">
|
| 671 |
-
<div>
|
| 672 |
-
<h3 class="font-medium text-lg">Entusiastas</h3>
|
| 673 |
-
<p class="text-sm text-gray-600">Combinação com Destaques no tabuleiro</p>
|
| 674 |
-
</div>
|
| 675 |
-
<div class="score-controls">
|
| 676 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('entusiastas', -1)">-</button>
|
| 677 |
-
<input type="number" min="0" class="additional-input border rounded w-16 text-center" data-category="entusiastas" placeholder="0" onchange="updatePeValues()">
|
| 678 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('entusiastas', 1)">+</button>
|
| 679 |
-
</div>
|
| 680 |
-
</div>
|
| 681 |
-
</div>
|
| 682 |
-
|
| 683 |
-
<!-- Arranjos Alegóricos -->
|
| 684 |
-
<div class="additional-points-card p-3 rounded-lg bg-gray-50">
|
| 685 |
-
<div class="flex justify-between items-center">
|
| 686 |
-
<div>
|
| 687 |
-
<h3 class="font-medium text-lg">Arranjos Alegóricos</h3>
|
| 688 |
-
<p class="text-sm text-gray-600">(∑ nv Carro) × (∑ nv Fantasias) = PE</p>
|
| 689 |
-
</div>
|
| 690 |
-
<div class="score-controls">
|
| 691 |
-
<button class="score-btn bg-red-500 text-white" onclick="updateScore('arranjos', -1)">-</button>
|
| 692 |
-
<input type="number" min="0" class="additional-input border rounded w-16 text-center" data-category="arranjos" placeholder="0" onchange="updatePeValues()">
|
| 693 |
-
<button class="score-btn bg-green-500 text-white" onclick="updateScore('arranjos', 1)">+</button>
|
| 694 |
-
</div>
|
| 695 |
-
</div>
|
| 696 |
-
</div>
|
| 697 |
</div>
|
| 698 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 699 |
</div>
|
| 700 |
-
</div>
|
| 701 |
-
|
| 702 |
-
<!-- Calculate Button and Results -->
|
| 703 |
-
<div class="mt-8 text-center">
|
| 704 |
-
<button id="btn-calculate" class="px-8 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition font-medium text-lg">
|
| 705 |
-
<i class="fas fa-calculator mr-2"></i>Calcular Pontuação
|
| 706 |
-
</button>
|
| 707 |
|
| 708 |
-
<
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
<
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
</
|
| 717 |
-
<div>
|
| 718 |
-
<h3 class="font-medium text-gray-700">Pontos de Emoção (PE):</h3>
|
| 719 |
-
<p id="total-pe" class="text-2xl font-bold">0</p>
|
| 720 |
-
</div>
|
| 721 |
</div>
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
</
|
|
|
|
| 734 |
</div>
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
<h3 class="font-bold text-lg text-purple-800 mb-2">Pontuação Final (PV):</h3>
|
| 738 |
-
<p id="final-score" class="text-4xl font-extrabold text-purple-600">0</p>
|
| 739 |
</div>
|
| 740 |
</div>
|
| 741 |
|
| 742 |
-
<
|
| 743 |
-
|
| 744 |
-
</
|
| 745 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 746 |
</div>
|
| 747 |
</div>
|
| 748 |
|
|
@@ -768,8 +700,43 @@
|
|
| 768 |
// Game state
|
| 769 |
const gameState = {
|
| 770 |
players: [],
|
| 771 |
-
|
| 772 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 773 |
};
|
| 774 |
|
| 775 |
// DOM Elements
|
|
@@ -777,11 +744,14 @@
|
|
| 777 |
const gameSection = document.getElementById('game-section');
|
| 778 |
const finalResults = document.getElementById('final-results');
|
| 779 |
const playerNames = document.getElementById('player-names');
|
| 780 |
-
const playerTabs = document.getElementById('player-tabs');
|
| 781 |
const resultsSection = document.getElementById('results-section');
|
| 782 |
const playersRanking = document.getElementById('players-ranking');
|
| 783 |
const themeToggle = document.getElementById('theme-toggle');
|
| 784 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
| 785 |
|
| 786 |
// Check for saved theme preference
|
| 787 |
if (localStorage.getItem('darkMode') === 'true') {
|
|
@@ -805,10 +775,13 @@
|
|
| 805 |
document.getElementById('btn-3players').addEventListener('click', () => setupPlayers(3));
|
| 806 |
document.getElementById('btn-4players').addEventListener('click', () => setupPlayers(4));
|
| 807 |
document.getElementById('btn-start-game').addEventListener('click', startGame);
|
| 808 |
-
document.getElementById('btn-calculate').addEventListener('click', calculateScore);
|
| 809 |
-
document.getElementById('btn-next-player').addEventListener('click', nextPlayer);
|
| 810 |
document.getElementById('btn-restart').addEventListener('click', restartGame);
|
| 811 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 812 |
// Player setup
|
| 813 |
function setupPlayers(numPlayers) {
|
| 814 |
playerNames.classList.remove('hidden');
|
|
@@ -836,251 +809,184 @@
|
|
| 836 |
.map(input => input.value || `Jogador ${input.id.replace('player', '').replace('-input', '')}`);
|
| 837 |
|
| 838 |
// Initialize scores with minimum values
|
| 839 |
-
gameState.scores = gameState.players.map(() =>
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
harmonia: 5,
|
| 849 |
-
feitos: 0,
|
| 850 |
-
palpites: 0,
|
| 851 |
-
entusiastas: 0,
|
| 852 |
-
arranjos: 0,
|
| 853 |
-
pe: 0,
|
| 854 |
-
total: 0
|
| 855 |
-
}));
|
| 856 |
|
| 857 |
-
// Create player
|
| 858 |
-
|
| 859 |
|
| 860 |
// Switch to game section
|
| 861 |
setupSection.classList.add('hidden');
|
| 862 |
gameSection.classList.remove('hidden');
|
| 863 |
-
peMonitorSection.classList.remove('hidden');
|
| 864 |
|
| 865 |
-
// Show first
|
| 866 |
-
|
| 867 |
}
|
| 868 |
|
| 869 |
-
// Create player
|
| 870 |
-
function
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
const tab = document.createElement('div');
|
| 875 |
-
tab.className = `px-4 py-2 rounded-t-lg cursor-pointer transition ${index === 0 ? 'bg-white shadow-md font-medium' : 'bg-gray-200 hover:bg-gray-300'}`;
|
| 876 |
-
tab.classList.add(`player-color-${index + 1}`);
|
| 877 |
-
tab.textContent = player;
|
| 878 |
-
tab.dataset.playerIndex = index;
|
| 879 |
|
| 880 |
-
|
| 881 |
-
gameState.
|
| 882 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 883 |
});
|
| 884 |
-
|
| 885 |
-
playerTabs.appendChild(tab);
|
| 886 |
-
});
|
| 887 |
-
}
|
| 888 |
-
|
| 889 |
-
// Show current player
|
| 890 |
-
function showCurrentPlayer() {
|
| 891 |
-
// Update active tab
|
| 892 |
-
document.querySelectorAll('#player-tabs div').forEach((tab, index) => {
|
| 893 |
-
if (index === gameState.currentPlayer) {
|
| 894 |
-
tab.classList.add('bg-white', 'shadow-md', 'font-medium');
|
| 895 |
-
tab.classList.remove('bg-gray-200', 'hover:bg-gray-300');
|
| 896 |
-
} else {
|
| 897 |
-
tab.classList.remove('bg-white', 'shadow-md', 'font-medium');
|
| 898 |
-
tab.classList.add('bg-gray-200', 'hover:bg-gray-300');
|
| 899 |
-
}
|
| 900 |
-
});
|
| 901 |
-
|
| 902 |
-
// Set all inputs to their minimum values
|
| 903 |
-
document.querySelectorAll('.score-input, .additional-input').forEach(input => {
|
| 904 |
-
const min = parseInt(input.getAttribute('min')) || 0;
|
| 905 |
-
input.value = min;
|
| 906 |
-
});
|
| 907 |
-
|
| 908 |
-
// Update game state with minimum values
|
| 909 |
-
const currentPlayer = gameState.currentPlayer;
|
| 910 |
-
gameState.scores[currentPlayer] = {
|
| 911 |
-
carros: 6,
|
| 912 |
-
samba: 6,
|
| 913 |
-
enredo: 0,
|
| 914 |
-
comissao: 6,
|
| 915 |
-
mestre: 7,
|
| 916 |
-
fantasias: 0,
|
| 917 |
-
bateria: 5,
|
| 918 |
-
evolucao: 5,
|
| 919 |
-
harmonia: 5,
|
| 920 |
-
feitos: 0,
|
| 921 |
-
palpites: 0,
|
| 922 |
-
entusiastas: 0,
|
| 923 |
-
arranjos: 0,
|
| 924 |
-
pe: 0,
|
| 925 |
-
total: 0
|
| 926 |
-
};
|
| 927 |
-
|
| 928 |
-
// Reset PE displays
|
| 929 |
-
document.querySelectorAll('[id^="pe-"]').forEach(el => {
|
| 930 |
-
el.textContent = '0';
|
| 931 |
});
|
| 932 |
-
|
| 933 |
-
// Hide results section
|
| 934 |
-
resultsSection.classList.add('hidden');
|
| 935 |
-
|
| 936 |
-
// Update PE monitors
|
| 937 |
-
updatePeValues();
|
| 938 |
}
|
| 939 |
|
| 940 |
-
// Update
|
| 941 |
-
function
|
| 942 |
-
const input = document.querySelector(`.score-input[data-category="${category}"]`)
|
| 943 |
-
document.querySelector(`.additional-input[data-category="${category}"]`);
|
| 944 |
-
|
| 945 |
if (!input) return;
|
| 946 |
|
| 947 |
-
let value = parseInt(input.value) || 0;
|
| 948 |
-
const max = parseInt(input.getAttribute('max')) || Infinity;
|
| 949 |
const min = parseInt(input.getAttribute('min')) || 0;
|
|
|
|
| 950 |
|
|
|
|
| 951 |
value += change;
|
| 952 |
value = Math.max(min, Math.min(max, value));
|
| 953 |
|
| 954 |
input.value = value;
|
| 955 |
-
|
| 956 |
-
// Update the game state immediately
|
| 957 |
-
const currentPlayer = gameState.currentPlayer;
|
| 958 |
-
gameState.scores[currentPlayer][category] = value;
|
| 959 |
-
|
| 960 |
-
// Update PE values in real-time
|
| 961 |
-
updatePeValues();
|
| 962 |
}
|
| 963 |
|
| 964 |
-
//
|
| 965 |
-
function
|
| 966 |
-
|
| 967 |
-
|
| 968 |
-
|
| 969 |
-
|
| 970 |
-
const peCarros = Math.max(0, (playerScore.carros || 0) - 10);
|
| 971 |
-
const peComissao = Math.max(0, (playerScore.comissao || 0) - 10);
|
| 972 |
-
const peBateria = Math.max(0, (playerScore.bateria || 0) - 10);
|
| 973 |
|
| 974 |
-
//
|
| 975 |
-
|
| 976 |
-
const peEntusiastas = playerScore.entusiastas || 0;
|
| 977 |
-
const peArranjos = playerScore.arranjos || 0;
|
| 978 |
-
const pePalpites = playerScore.palpites || 0;
|
| 979 |
|
| 980 |
-
//
|
| 981 |
-
|
| 982 |
-
peFeitos + peEntusiastas + peArranjos - pePalpites;
|
| 983 |
|
| 984 |
-
|
| 985 |
-
|
| 986 |
-
|
| 987 |
-
|
|
|
|
|
|
|
|
|
|
| 988 |
|
| 989 |
-
// Update
|
| 990 |
-
|
| 991 |
-
|
| 992 |
-
|
| 993 |
-
updatePeMonitor('pe-total-monitor', totalPE, 50); // Assuming max 50 PE for progress bar
|
| 994 |
|
| 995 |
// Update game state
|
| 996 |
-
|
| 997 |
-
}
|
| 998 |
-
|
| 999 |
-
// Update PE monitor display
|
| 1000 |
-
function updatePeMonitor(monitorId, peValue, maxValue) {
|
| 1001 |
-
const monitor = document.getElementById(monitorId);
|
| 1002 |
-
if (!monitor) return;
|
| 1003 |
-
|
| 1004 |
-
const peDisplay = monitor.querySelector('.pe-value');
|
| 1005 |
-
const progressBar = monitor.querySelector('.pe-progress-bar');
|
| 1006 |
-
|
| 1007 |
-
peDisplay.textContent = `${peValue} PE`;
|
| 1008 |
-
|
| 1009 |
-
// Calculate percentage for progress bar (capped at 100%)
|
| 1010 |
-
const percentage = Math.min(100, (peValue / maxValue) * 100);
|
| 1011 |
-
progressBar.style.width = `${percentage}%`;
|
| 1012 |
}
|
| 1013 |
|
| 1014 |
-
//
|
| 1015 |
-
function
|
| 1016 |
-
|
| 1017 |
-
|
| 1018 |
-
|
| 1019 |
-
// Get category scores
|
| 1020 |
-
const categories = ['carros', 'samba', 'enredo', 'comissao', 'mestre', 'fantasias', 'bateria', 'evolucao', 'harmonia'];
|
| 1021 |
-
categories.forEach(category => {
|
| 1022 |
-
const input = document.querySelector(`.score-input[data-category="${category}"]`);
|
| 1023 |
-
playerScore[category] = input.value ? Math.max(0, Math.min(20, parseInt(input.value))) : 0;
|
| 1024 |
-
});
|
| 1025 |
-
|
| 1026 |
-
// Get additional points
|
| 1027 |
-
const additional = ['feitos', 'palpites', 'entusiastas', 'arranjos'];
|
| 1028 |
-
additional.forEach(category => {
|
| 1029 |
-
const input = document.querySelector(`.additional-input[data-category="${category}"]`);
|
| 1030 |
-
playerScore[category] = input.value ? Math.max(0, parseInt(input.value)) : 0;
|
| 1031 |
-
});
|
| 1032 |
-
|
| 1033 |
-
// Calculate PE for categories that can exceed 10
|
| 1034 |
-
const peCarros = Math.max(0, playerScore.carros - 10);
|
| 1035 |
-
const peComissao = Math.max(0, playerScore.comissao - 10);
|
| 1036 |
-
const peBateria = Math.max(0, playerScore.bateria - 10);
|
| 1037 |
-
|
| 1038 |
-
// Calculate total PE
|
| 1039 |
-
playerScore.pe = peCarros + peComissao + peBateria +
|
| 1040 |
-
playerScore.feitos + playerScore.entusiastas +
|
| 1041 |
-
playerScore.arranjos - playerScore.palpites;
|
| 1042 |
-
playerScore.pe = Math.max(0, playerScore.pe);
|
| 1043 |
-
|
| 1044 |
-
// Calculate total from categories (max 10 each)
|
| 1045 |
-
const cappedCategories = categories.map(cat => {
|
| 1046 |
-
// These categories can exceed 10 (but only count 10 for the total)
|
| 1047 |
-
if (['carros', 'comissao', 'bateria', 'fantasias'].includes(cat)) {
|
| 1048 |
-
return Math.min(10, playerScore[cat]);
|
| 1049 |
-
}
|
| 1050 |
-
return playerScore[cat];
|
| 1051 |
-
});
|
| 1052 |
-
|
| 1053 |
-
const totalQuesitos = cappedCategories.reduce((sum, score) => sum + score, 0);
|
| 1054 |
-
|
| 1055 |
-
// Calculate final score
|
| 1056 |
-
playerScore.total = totalQuesitos + (playerScore.pe / 10);
|
| 1057 |
-
|
| 1058 |
-
// Display results
|
| 1059 |
-
document.getElementById('total-quesitos').textContent = totalQuesitos;
|
| 1060 |
-
document.getElementById('total-pe').textContent = playerScore.pe;
|
| 1061 |
-
document.getElementById('pe-divided').textContent = (playerScore.pe / 10).toFixed(1);
|
| 1062 |
-
document.getElementById('final-score').textContent = playerScore.total.toFixed(1);
|
| 1063 |
-
|
| 1064 |
-
resultsSection.classList.remove('hidden');
|
| 1065 |
-
resultsSection.classList.add('slide-up');
|
| 1066 |
-
|
| 1067 |
-
// Scroll to results
|
| 1068 |
-
resultsSection.scrollIntoView({ behavior: 'smooth' });
|
| 1069 |
}
|
| 1070 |
|
| 1071 |
-
//
|
| 1072 |
-
function
|
| 1073 |
-
if (gameState.
|
| 1074 |
-
gameState.
|
| 1075 |
-
showCurrentPlayer();
|
| 1076 |
-
} else {
|
| 1077 |
-
// Game over, show final results
|
| 1078 |
-
showFinalResults();
|
| 1079 |
}
|
| 1080 |
}
|
| 1081 |
|
| 1082 |
// Show final results
|
| 1083 |
function showFinalResults() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1084 |
gameSection.classList.add('hidden');
|
| 1085 |
finalResults.classList.remove('hidden');
|
| 1086 |
|
|
@@ -1163,7 +1069,7 @@
|
|
| 1163 |
|
| 1164 |
// Reset game state
|
| 1165 |
gameState.players = [];
|
| 1166 |
-
gameState.
|
| 1167 |
gameState.scores = [];
|
| 1168 |
|
| 1169 |
// Reset inputs
|
|
|
|
| 278 |
|
| 279 |
input:checked + .slider .fa-moon {
|
| 280 |
opacity: 0;
|
| 281 |
+
}
|
| 282 |
|
| 283 |
/* Custom styles for score controls */
|
| 284 |
.score-controls {
|
|
|
|
| 325 |
font-weight: 600;
|
| 326 |
}
|
| 327 |
|
| 328 |
+
/* Progress bar */
|
| 329 |
+
.progress-container {
|
| 330 |
+
width: 100%;
|
| 331 |
+
height: 10px;
|
| 332 |
+
background-color: #e2e8f0;
|
| 333 |
+
border-radius: 5px;
|
| 334 |
+
margin-top: 10px;
|
| 335 |
+
overflow: hidden;
|
| 336 |
}
|
| 337 |
|
| 338 |
+
.progress-bar {
|
| 339 |
+
height: 100%;
|
| 340 |
+
background-color: #4c51bf;
|
| 341 |
+
transition: width 0.3s ease;
|
|
|
|
|
|
|
| 342 |
}
|
| 343 |
|
| 344 |
+
/* Dark mode progress bar */
|
| 345 |
+
.dark-mode .progress-container {
|
| 346 |
+
background-color: #4a5568;
|
| 347 |
}
|
| 348 |
|
| 349 |
+
.dark-mode .progress-bar {
|
| 350 |
+
background-color: #9f7aea;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
}
|
| 352 |
|
| 353 |
+
/* Player score row */
|
| 354 |
+
.player-score-row {
|
| 355 |
+
display: flex;
|
| 356 |
+
align-items: center;
|
| 357 |
+
margin-bottom: 10px;
|
| 358 |
+
padding: 10px;
|
| 359 |
+
border-radius: 5px;
|
| 360 |
+
background-color: #f7fafc;
|
| 361 |
}
|
| 362 |
|
| 363 |
+
.dark-mode .player-score-row {
|
| 364 |
+
background-color: #2d3748;
|
|
|
|
|
|
|
| 365 |
}
|
| 366 |
|
| 367 |
+
/* Page transition */
|
| 368 |
+
.page {
|
| 369 |
+
display: none;
|
| 370 |
}
|
| 371 |
|
| 372 |
+
.page.active {
|
| 373 |
+
display: block;
|
| 374 |
+
animation: fadeIn 0.5s;
|
| 375 |
}
|
| 376 |
</style>
|
| 377 |
</head>
|
|
|
|
| 404 |
</div>
|
| 405 |
|
| 406 |
<div id="player-names" class="hidden">
|
| 407 |
+
<h3 class="text-xl font-medium mb-3 text-gray-700">Nomes dos Jogadores:</h3>
|
| 408 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
|
| 409 |
<div id="player1-input" class="hidden">
|
| 410 |
<label class="block text-gray-700 mb-1">Jogador 1:</label>
|
|
|
|
| 429 |
|
| 430 |
<!-- Main Game Section -->
|
| 431 |
<div id="game-section" class="hidden">
|
| 432 |
+
<!-- Progress Bar -->
|
| 433 |
+
<div class="mb-6">
|
| 434 |
+
<div class="flex justify-between mb-1">
|
| 435 |
+
<span class="text-sm font-medium">Progresso da Apuração</span>
|
| 436 |
+
<span id="progress-text" class="text-sm font-medium">0%</span>
|
| 437 |
+
</div>
|
| 438 |
+
<div class="progress-container">
|
| 439 |
+
<div id="progress-bar" class="progress-bar" style="width: 0%"></div>
|
| 440 |
+
</div>
|
| 441 |
</div>
|
| 442 |
|
| 443 |
+
<!-- Quesitos Pages -->
|
| 444 |
+
<div id="pages-container">
|
| 445 |
+
<!-- Carros Alegóricos -->
|
| 446 |
+
<div id="page-carros" class="page bg-white rounded-lg shadow-md p-6">
|
| 447 |
+
<div class="category-card category-color-carros p-4 rounded-lg mb-6">
|
| 448 |
+
<div class="category-header flex items-center mb-2">
|
| 449 |
+
<i class="fas fa-car-side mr-2"></i>
|
| 450 |
+
<h3>Carros Alegóricos</h3>
|
| 451 |
+
</div>
|
| 452 |
+
<div class="category-body">
|
| 453 |
+
<p class="text-sm mb-3">Pontos base + valores das fichas de Carro Alegórico</p>
|
| 454 |
</div>
|
| 455 |
</div>
|
| 456 |
+
|
| 457 |
+
<div id="player-scores-carros" class="space-y-4">
|
| 458 |
+
<!-- Player scores will be inserted here -->
|
| 459 |
+
</div>
|
| 460 |
+
</div>
|
| 461 |
+
|
| 462 |
+
<!-- Samba Enredo -->
|
| 463 |
+
<div id="page-samba" class="page bg-white rounded-lg shadow-md p-6">
|
| 464 |
+
<div class="category-card category-color-samba p-4 rounded-lg mb-6">
|
| 465 |
+
<div class="category-header flex items-center mb-2">
|
| 466 |
+
<i class="fas fa-music mr-2"></i>
|
| 467 |
+
<h3>Samba Enredo</h3>
|
| 468 |
+
</div>
|
| 469 |
+
<div class="category-body">
|
| 470 |
+
<p class="text-sm mb-3">Último cubo amarelo na Ficha de Carnavalesco</p>
|
| 471 |
</div>
|
| 472 |
</div>
|
| 473 |
+
|
| 474 |
+
<div id="player-scores-samba" class="space-y-4">
|
| 475 |
+
<!-- Player scores will be inserted here -->
|
| 476 |
+
</div>
|
| 477 |
+
</div>
|
| 478 |
+
|
| 479 |
+
<!-- Enredo -->
|
| 480 |
+
<div id="page-enredo" class="page bg-white rounded-lg shadow-md p-6">
|
| 481 |
+
<div class="category-card category-color-enredo p-4 rounded-lg mb-6">
|
| 482 |
+
<div class="category-header flex items-center mb-2">
|
| 483 |
+
<i class="fas fa-book-open mr-2"></i>
|
| 484 |
+
<h3>Enredo</h3>
|
| 485 |
+
</div>
|
| 486 |
+
<div class="category-body">
|
| 487 |
+
<p class="text-sm mb-3">Último cubo verde no tabuleiro individual</p>
|
| 488 |
</div>
|
| 489 |
</div>
|
| 490 |
+
|
| 491 |
+
<div id="player-scores-enredo" class="space-y-4">
|
| 492 |
+
<!-- Player scores will be inserted here -->
|
| 493 |
+
</div>
|
| 494 |
</div>
|
| 495 |
+
|
| 496 |
+
<!-- Comissão de Frente -->
|
| 497 |
+
<div id="page-comissao" class="page bg-white rounded-lg shadow-md p-6">
|
| 498 |
+
<div class="category-card category-color-comissao p-4 rounded-lg mb-6">
|
| 499 |
+
<div class="category-header flex items-center mb-2">
|
| 500 |
+
<i class="fas fa-users mr-2"></i>
|
| 501 |
+
<h3>Comissão de Frente</h3>
|
| 502 |
+
</div>
|
| 503 |
+
<div class="category-body">
|
| 504 |
+
<p class="text-sm mb-3">Pontos base + valores das fichas de Comissão</p>
|
| 505 |
+
</div>
|
| 506 |
+
</div>
|
| 507 |
+
|
| 508 |
+
<div id="player-scores-comissao" class="space-y-4">
|
| 509 |
+
<!-- Player scores will be inserted here -->
|
| 510 |
</div>
|
| 511 |
</div>
|
| 512 |
+
|
| 513 |
+
<!-- Mestre Sala e Porta Bandeira -->
|
| 514 |
+
<div id="page-mestre" class="page bg-white rounded-lg shadow-md p-6">
|
| 515 |
+
<div class="category-card category-color-mestre p-4 rounded-lg mb-6">
|
| 516 |
+
<div class="category-header flex items-center mb-2">
|
| 517 |
+
<i class="fas fa-flag mr-2"></i>
|
| 518 |
+
<h3>Mestre Sala e Porta Bandeira</h3>
|
| 519 |
+
</div>
|
| 520 |
+
<div class="category-body">
|
| 521 |
+
<p class="text-sm mb-3">Pontos base + valores da ficha específica</p>
|
| 522 |
+
</div>
|
| 523 |
+
</div>
|
| 524 |
|
| 525 |
+
<div id="player-scores-mestre" class="space-y-4">
|
| 526 |
+
<!-- Player scores will be inserted here -->
|
| 527 |
+
</div>
|
| 528 |
+
</div>
|
| 529 |
+
|
| 530 |
+
<!-- Fantasias -->
|
| 531 |
+
<div id="page-fantasias" class="page bg-white rounded-lg shadow-md p-6">
|
| 532 |
+
<div class="category-card category-color-fantasias p-4 rounded-lg mb-6">
|
| 533 |
+
<div class="category-header flex items-center mb-2">
|
| 534 |
+
<i class="fas fa-tshirt mr-2"></i>
|
| 535 |
+
<h3>Fantasias</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 536 |
</div>
|
| 537 |
+
<div class="category-body">
|
| 538 |
+
<p class="text-sm mb-3">Soma dos pontos das Cartas de Fantasias</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
</div>
|
| 540 |
+
</div>
|
| 541 |
+
|
| 542 |
+
<div id="player-scores-fantasias" class="space-y-4">
|
| 543 |
+
<!-- Player scores will be inserted here -->
|
| 544 |
+
</div>
|
| 545 |
+
</div>
|
| 546 |
+
|
| 547 |
+
<!-- Bateria -->
|
| 548 |
+
<div id="page-bateria" class="page bg-white rounded-lg shadow-md p-6">
|
| 549 |
+
<div class="category-card category-color-bateria p-4 rounded-lg mb-6">
|
| 550 |
+
<div class="category-header flex items-center mb-2">
|
| 551 |
+
<i class="fas fa-drum mr-2"></i>
|
| 552 |
+
<h3>Bateria</h3>
|
|
|
|
|
|
|
| 553 |
</div>
|
| 554 |
+
<div class="category-body">
|
| 555 |
+
<p class="text-sm mb-3">Pontos base + valores das fichas de Bateria</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 556 |
</div>
|
| 557 |
+
</div>
|
| 558 |
+
|
| 559 |
+
<div id="player-scores-bateria" class="space-y-4">
|
| 560 |
+
<!-- Player scores will be inserted here -->
|
| 561 |
+
</div>
|
| 562 |
+
</div>
|
| 563 |
+
|
| 564 |
+
<!-- Evolução -->
|
| 565 |
+
<div id="page-evolucao" class="page bg-white rounded-lg shadow-md p-6">
|
| 566 |
+
<div class="category-card category-color-evolucao p-4 rounded-lg mb-6">
|
| 567 |
+
<div class="category-header flex items-center mb-2">
|
| 568 |
+
<i class="fas fa-route mr-2"></i>
|
| 569 |
+
<h3>Evolução</h3>
|
|
|
|
|
|
|
| 570 |
</div>
|
| 571 |
+
<div class="category-body">
|
| 572 |
+
<p class="text-sm mb-3">Pontos base + valores das fichas de Evolução</p>
|
| 573 |
+
</div>
|
| 574 |
+
</div>
|
| 575 |
+
|
| 576 |
+
<div id="player-scores-evolucao" class="space-y-4">
|
| 577 |
+
<!-- Player scores will be inserted here -->
|
| 578 |
</div>
|
| 579 |
</div>
|
| 580 |
|
| 581 |
+
<!-- Harmonia -->
|
| 582 |
+
<div id="page-harmonia" class="page bg-white rounded-lg shadow-md p-6">
|
| 583 |
+
<div class="category-card category-color-harmonia p-4 rounded-lg mb-6">
|
| 584 |
+
<div class="category-header flex items-center mb-2">
|
| 585 |
+
<i class="fas fa-heart mr-2"></i>
|
| 586 |
+
<h3>Harmonia</h3>
|
| 587 |
+
</div>
|
| 588 |
+
<div class="category-body">
|
| 589 |
+
<p class="text-sm mb-3">Último cubo azul no tabuleiro individual</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
</div>
|
| 591 |
</div>
|
| 592 |
|
| 593 |
+
<div id="player-scores-harmonia" class="space-y-4">
|
| 594 |
+
<!-- Player scores will be inserted here -->
|
| 595 |
+
</div>
|
| 596 |
+
</div>
|
| 597 |
+
|
| 598 |
+
<!-- Feitos -->
|
| 599 |
+
<div id="page-feitos" class="page bg-white rounded-lg shadow-md p-6">
|
| 600 |
+
<div class="category-card p-4 rounded-lg mb-6 bg-gray-50">
|
| 601 |
+
<div class="category-header flex items-center mb-2">
|
| 602 |
+
<i class="fas fa-star mr-2"></i>
|
| 603 |
+
<h3>Feitos</h3>
|
| 604 |
+
</div>
|
| 605 |
+
<div class="category-body">
|
| 606 |
+
<p class="text-sm mb-3">Realizados no tabuleiro do Sambódromo</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 607 |
</div>
|
| 608 |
</div>
|
| 609 |
+
|
| 610 |
+
<div id="player-scores-feitos" class="space-y-4">
|
| 611 |
+
<!-- Player scores will be inserted here -->
|
| 612 |
+
</div>
|
| 613 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
|
| 615 |
+
<!-- Palpites -->
|
| 616 |
+
<div id="page-palpites" class="page bg-white rounded-lg shadow-md p-6">
|
| 617 |
+
<div class="category-card p-4 rounded-lg mb-6 bg-gray-50">
|
| 618 |
+
<div class="category-header flex items-center mb-2">
|
| 619 |
+
<i class="fas fa-comment mr-2"></i>
|
| 620 |
+
<h3>Palpites</h3>
|
| 621 |
+
</div>
|
| 622 |
+
<div class="category-body">
|
| 623 |
+
<p class="text-sm mb-3">Realizados no tabuleiro do Sambódromo</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 624 |
</div>
|
| 625 |
+
</div>
|
| 626 |
+
|
| 627 |
+
<div id="player-scores-palpites" class="space-y-4">
|
| 628 |
+
<!-- Player scores will be inserted here -->
|
| 629 |
+
</div>
|
| 630 |
+
</div>
|
| 631 |
+
|
| 632 |
+
<!-- Entusiastas -->
|
| 633 |
+
<div id="page-entusiastas" class="page bg-white rounded-lg shadow-md p-6">
|
| 634 |
+
<div class="category-card p-4 rounded-lg mb-6 bg-gray-50">
|
| 635 |
+
<div class="category-header flex items-center mb-2">
|
| 636 |
+
<i class="fas fa-users mr-2"></i>
|
| 637 |
+
<h3>Entusiastas</h3>
|
| 638 |
</div>
|
| 639 |
+
<div class="category-body">
|
| 640 |
+
<p class="text-sm mb-3">Combinação com Destaques no tabuleiro</p>
|
|
|
|
|
|
|
| 641 |
</div>
|
| 642 |
</div>
|
| 643 |
|
| 644 |
+
<div id="player-scores-entusiastas" class="space-y-4">
|
| 645 |
+
<!-- Player scores will be inserted here -->
|
| 646 |
+
</div>
|
| 647 |
</div>
|
| 648 |
+
|
| 649 |
+
<!-- Arranjos Alegóricos -->
|
| 650 |
+
<div id="page-arranjos" class="page bg-white rounded-lg shadow-md p-6">
|
| 651 |
+
<div class="category-card p-4 rounded-lg mb-6 bg-gray-50">
|
| 652 |
+
<div class="category-header flex items-center mb-2">
|
| 653 |
+
<i class="fas fa-puzzle-piece mr-2"></i>
|
| 654 |
+
<h3>Arranjos Alegóricos</h3>
|
| 655 |
+
</div>
|
| 656 |
+
<div class="category-body">
|
| 657 |
+
<p class="text-sm mb-3">(∑ nv Carro) × (∑ nv Fantasias) = PE</p>
|
| 658 |
+
</div>
|
| 659 |
+
</div>
|
| 660 |
+
|
| 661 |
+
<div id="player-scores-arranjos" class="space-y-4">
|
| 662 |
+
<!-- Player scores will be inserted here -->
|
| 663 |
+
</div>
|
| 664 |
+
</div>
|
| 665 |
+
</div>
|
| 666 |
+
|
| 667 |
+
<!-- Navigation Buttons -->
|
| 668 |
+
<div class="mt-6 flex justify-between">
|
| 669 |
+
<button id="btn-prev" class="px-4 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400 transition hidden">
|
| 670 |
+
<i class="fas fa-arrow-left mr-2"></i>Anterior
|
| 671 |
+
</button>
|
| 672 |
+
<button id="btn-next" class="px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition ml-auto">
|
| 673 |
+
Próximo <i class="fas fa-arrow-right ml-2"></i>
|
| 674 |
+
</button>
|
| 675 |
+
<button id="btn-calculate" class="px-6 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition hidden">
|
| 676 |
+
<i class="fas fa-calculator mr-2"></i>Calcular Resultados
|
| 677 |
+
</button>
|
| 678 |
</div>
|
| 679 |
</div>
|
| 680 |
|
|
|
|
| 700 |
// Game state
|
| 701 |
const gameState = {
|
| 702 |
players: [],
|
| 703 |
+
currentPage: 0,
|
| 704 |
+
pages: [
|
| 705 |
+
'carros', 'samba', 'enredo', 'comissao', 'mestre',
|
| 706 |
+
'fantasias', 'bateria', 'evolucao', 'harmonia',
|
| 707 |
+
'feitos', 'palpites', 'entusiastas', 'arranjos'
|
| 708 |
+
],
|
| 709 |
+
scores: [],
|
| 710 |
+
minValues: {
|
| 711 |
+
carros: 6,
|
| 712 |
+
samba: 6,
|
| 713 |
+
enredo: 0,
|
| 714 |
+
comissao: 6,
|
| 715 |
+
mestre: 7,
|
| 716 |
+
fantasias: 0,
|
| 717 |
+
bateria: 5,
|
| 718 |
+
evolucao: 5,
|
| 719 |
+
harmonia: 5,
|
| 720 |
+
feitos: 0,
|
| 721 |
+
palpites: 0,
|
| 722 |
+
entusiastas: 0,
|
| 723 |
+
arranjos: 0
|
| 724 |
+
},
|
| 725 |
+
maxValues: {
|
| 726 |
+
carros: 20,
|
| 727 |
+
samba: 10,
|
| 728 |
+
enredo: 10,
|
| 729 |
+
comissao: 20,
|
| 730 |
+
mestre: 10,
|
| 731 |
+
fantasias: 20,
|
| 732 |
+
bateria: 20,
|
| 733 |
+
evolucao: 10,
|
| 734 |
+
harmonia: 10,
|
| 735 |
+
feitos: 99,
|
| 736 |
+
palpites: 99,
|
| 737 |
+
entusiastas: 99,
|
| 738 |
+
arranjos: 99
|
| 739 |
+
}
|
| 740 |
};
|
| 741 |
|
| 742 |
// DOM Elements
|
|
|
|
| 744 |
const gameSection = document.getElementById('game-section');
|
| 745 |
const finalResults = document.getElementById('final-results');
|
| 746 |
const playerNames = document.getElementById('player-names');
|
|
|
|
| 747 |
const resultsSection = document.getElementById('results-section');
|
| 748 |
const playersRanking = document.getElementById('players-ranking');
|
| 749 |
const themeToggle = document.getElementById('theme-toggle');
|
| 750 |
+
const btnPrev = document.getElementById('btn-prev');
|
| 751 |
+
const btnNext = document.getElementById('btn-next');
|
| 752 |
+
const btnCalculate = document.getElementById('btn-calculate');
|
| 753 |
+
const progressText = document.getElementById('progress-text');
|
| 754 |
+
const progressBar = document.getElementById('progress-bar');
|
| 755 |
|
| 756 |
// Check for saved theme preference
|
| 757 |
if (localStorage.getItem('darkMode') === 'true') {
|
|
|
|
| 775 |
document.getElementById('btn-3players').addEventListener('click', () => setupPlayers(3));
|
| 776 |
document.getElementById('btn-4players').addEventListener('click', () => setupPlayers(4));
|
| 777 |
document.getElementById('btn-start-game').addEventListener('click', startGame);
|
|
|
|
|
|
|
| 778 |
document.getElementById('btn-restart').addEventListener('click', restartGame);
|
| 779 |
|
| 780 |
+
// Navigation buttons
|
| 781 |
+
btnPrev.addEventListener('click', prevPage);
|
| 782 |
+
btnNext.addEventListener('click', nextPage);
|
| 783 |
+
btnCalculate.addEventListener('click', showFinalResults);
|
| 784 |
+
|
| 785 |
// Player setup
|
| 786 |
function setupPlayers(numPlayers) {
|
| 787 |
playerNames.classList.remove('hidden');
|
|
|
|
| 809 |
.map(input => input.value || `Jogador ${input.id.replace('player', '').replace('-input', '')}`);
|
| 810 |
|
| 811 |
// Initialize scores with minimum values
|
| 812 |
+
gameState.scores = gameState.players.map(() => {
|
| 813 |
+
const scores = {};
|
| 814 |
+
for (const category in gameState.minValues) {
|
| 815 |
+
scores[category] = gameState.minValues[category];
|
| 816 |
+
}
|
| 817 |
+
scores.pe = 0;
|
| 818 |
+
scores.total = 0;
|
| 819 |
+
return scores;
|
| 820 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 821 |
|
| 822 |
+
// Create player score inputs for each page
|
| 823 |
+
createPlayerScoreInputs();
|
| 824 |
|
| 825 |
// Switch to game section
|
| 826 |
setupSection.classList.add('hidden');
|
| 827 |
gameSection.classList.remove('hidden');
|
|
|
|
| 828 |
|
| 829 |
+
// Show first page
|
| 830 |
+
showPage(0);
|
| 831 |
}
|
| 832 |
|
| 833 |
+
// Create player score inputs for each page
|
| 834 |
+
function createPlayerScoreInputs() {
|
| 835 |
+
gameState.pages.forEach(page => {
|
| 836 |
+
const container = document.getElementById(`player-scores-${page}`);
|
| 837 |
+
container.innerHTML = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 838 |
|
| 839 |
+
gameState.players.forEach((player, index) => {
|
| 840 |
+
const min = gameState.minValues[page] || 0;
|
| 841 |
+
const max = gameState.maxValues[page] || 20;
|
| 842 |
+
|
| 843 |
+
const playerDiv = document.createElement('div');
|
| 844 |
+
playerDiv.className = `player-score-row player-color-${index + 1}`;
|
| 845 |
+
|
| 846 |
+
const playerName = document.createElement('div');
|
| 847 |
+
playerName.className = 'flex-1 font-medium';
|
| 848 |
+
playerName.textContent = player;
|
| 849 |
+
|
| 850 |
+
const scoreControls = document.createElement('div');
|
| 851 |
+
scoreControls.className = 'score-controls';
|
| 852 |
+
|
| 853 |
+
const btnMinus = document.createElement('button');
|
| 854 |
+
btnMinus.className = 'score-btn bg-red-500 text-white';
|
| 855 |
+
btnMinus.innerHTML = '-';
|
| 856 |
+
btnMinus.addEventListener('click', () => updatePlayerScore(page, index, -1));
|
| 857 |
+
|
| 858 |
+
const input = document.createElement('input');
|
| 859 |
+
input.type = 'number';
|
| 860 |
+
input.className = 'score-input border rounded';
|
| 861 |
+
input.dataset.playerIndex = index;
|
| 862 |
+
input.dataset.category = page;
|
| 863 |
+
input.min = min;
|
| 864 |
+
input.max = max;
|
| 865 |
+
input.value = min;
|
| 866 |
+
input.addEventListener('change', () => {
|
| 867 |
+
const value = parseInt(input.value) || min;
|
| 868 |
+
input.value = Math.max(min, Math.min(max, value));
|
| 869 |
+
gameState.scores[index][page] = parseInt(input.value);
|
| 870 |
+
});
|
| 871 |
+
|
| 872 |
+
const btnPlus = document.createElement('button');
|
| 873 |
+
btnPlus.className = 'score-btn bg-green-500 text-white';
|
| 874 |
+
btnPlus.innerHTML = '+';
|
| 875 |
+
btnPlus.addEventListener('click', () => updatePlayerScore(page, index, 1));
|
| 876 |
+
|
| 877 |
+
scoreControls.appendChild(btnMinus);
|
| 878 |
+
scoreControls.appendChild(input);
|
| 879 |
+
scoreControls.appendChild(btnPlus);
|
| 880 |
+
|
| 881 |
+
playerDiv.appendChild(playerName);
|
| 882 |
+
playerDiv.appendChild(scoreControls);
|
| 883 |
+
|
| 884 |
+
container.appendChild(playerDiv);
|
| 885 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 886 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 887 |
}
|
| 888 |
|
| 889 |
+
// Update player score
|
| 890 |
+
function updatePlayerScore(category, playerIndex, change) {
|
| 891 |
+
const input = document.querySelector(`.score-input[data-category="${category}"][data-player-index="${playerIndex}"]`);
|
|
|
|
|
|
|
| 892 |
if (!input) return;
|
| 893 |
|
|
|
|
|
|
|
| 894 |
const min = parseInt(input.getAttribute('min')) || 0;
|
| 895 |
+
const max = parseInt(input.getAttribute('max')) || 20;
|
| 896 |
|
| 897 |
+
let value = parseInt(input.value) || min;
|
| 898 |
value += change;
|
| 899 |
value = Math.max(min, Math.min(max, value));
|
| 900 |
|
| 901 |
input.value = value;
|
| 902 |
+
gameState.scores[playerIndex][category] = value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 903 |
}
|
| 904 |
|
| 905 |
+
// Show specific page
|
| 906 |
+
function showPage(index) {
|
| 907 |
+
// Hide all pages
|
| 908 |
+
document.querySelectorAll('.page').forEach(page => {
|
| 909 |
+
page.classList.remove('active');
|
| 910 |
+
});
|
|
|
|
|
|
|
|
|
|
| 911 |
|
| 912 |
+
// Show selected page
|
| 913 |
+
document.getElementById(`page-${gameState.pages[index]}`).classList.add('active');
|
|
|
|
|
|
|
|
|
|
| 914 |
|
| 915 |
+
// Update navigation buttons
|
| 916 |
+
btnPrev.classList.toggle('hidden', index === 0);
|
|
|
|
| 917 |
|
| 918 |
+
if (index === gameState.pages.length - 1) {
|
| 919 |
+
btnNext.classList.add('hidden');
|
| 920 |
+
btnCalculate.classList.remove('hidden');
|
| 921 |
+
} else {
|
| 922 |
+
btnNext.classList.remove('hidden');
|
| 923 |
+
btnCalculate.classList.add('hidden');
|
| 924 |
+
}
|
| 925 |
|
| 926 |
+
// Update progress
|
| 927 |
+
const progress = Math.round((index + 1) / gameState.pages.length * 100);
|
| 928 |
+
progressText.textContent = `${progress}%`;
|
| 929 |
+
progressBar.style.width = `${progress}%`;
|
|
|
|
| 930 |
|
| 931 |
// Update game state
|
| 932 |
+
gameState.currentPage = index;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 933 |
}
|
| 934 |
|
| 935 |
+
// Go to next page
|
| 936 |
+
function nextPage() {
|
| 937 |
+
if (gameState.currentPage < gameState.pages.length - 1) {
|
| 938 |
+
showPage(gameState.currentPage + 1);
|
| 939 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 940 |
}
|
| 941 |
|
| 942 |
+
// Go to previous page
|
| 943 |
+
function prevPage() {
|
| 944 |
+
if (gameState.currentPage > 0) {
|
| 945 |
+
showPage(gameState.currentPage - 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 946 |
}
|
| 947 |
}
|
| 948 |
|
| 949 |
// Show final results
|
| 950 |
function showFinalResults() {
|
| 951 |
+
// Calculate PE and total scores for each player
|
| 952 |
+
gameState.players.forEach((player, index) => {
|
| 953 |
+
const scores = gameState.scores[index];
|
| 954 |
+
|
| 955 |
+
// Calculate PE for categories that can exceed 10
|
| 956 |
+
const peCarros = Math.max(0, (scores.carros || 0) - 10);
|
| 957 |
+
const peComissao = Math.max(0, (scores.comissao || 0) - 10);
|
| 958 |
+
const peBateria = Math.max(0, (scores.bateria || 0) - 10);
|
| 959 |
+
|
| 960 |
+
// Calculate additional PE
|
| 961 |
+
const peFeitos = scores.feitos || 0;
|
| 962 |
+
const peEntusiastas = scores.entusiastas || 0;
|
| 963 |
+
const peArranjos = scores.arranjos || 0;
|
| 964 |
+
const pePalpites = scores.palpites || 0;
|
| 965 |
+
|
| 966 |
+
// Calculate total PE
|
| 967 |
+
scores.pe = peCarros + peComissao + peBateria +
|
| 968 |
+
peFeitos + peEntusiastas + peArranjos - pePalpites;
|
| 969 |
+
scores.pe = Math.max(0, scores.pe);
|
| 970 |
+
|
| 971 |
+
// Calculate total from categories (max 10 each)
|
| 972 |
+
const categories = ['carros', 'samba', 'enredo', 'comissao', 'mestre',
|
| 973 |
+
'fantasias', 'bateria', 'evolucao', 'harmonia'];
|
| 974 |
+
|
| 975 |
+
const cappedCategories = categories.map(cat => {
|
| 976 |
+
// These categories can exceed 10 (but only count 10 for the total)
|
| 977 |
+
if (['carros', 'comissao', 'bateria', 'fantasias'].includes(cat)) {
|
| 978 |
+
return Math.min(10, scores[cat]);
|
| 979 |
+
}
|
| 980 |
+
return scores[cat];
|
| 981 |
+
});
|
| 982 |
+
|
| 983 |
+
const totalQuesitos = cappedCategories.reduce((sum, score) => sum + score, 0);
|
| 984 |
+
|
| 985 |
+
// Calculate final score
|
| 986 |
+
scores.total = totalQuesitos + (scores.pe / 10);
|
| 987 |
+
});
|
| 988 |
+
|
| 989 |
+
// Switch to final results
|
| 990 |
gameSection.classList.add('hidden');
|
| 991 |
finalResults.classList.remove('hidden');
|
| 992 |
|
|
|
|
| 1069 |
|
| 1070 |
// Reset game state
|
| 1071 |
gameState.players = [];
|
| 1072 |
+
gameState.currentPage = 0;
|
| 1073 |
gameState.scores = [];
|
| 1074 |
|
| 1075 |
// Reset inputs
|
prompts.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
mostrar em tempo real os pontos de emoção PE de cada quesito
|
| 2 |
-
as os valores mínimos (min=) devem começar aparecendo no score-input de cada quesito
|
|
|
|
|
|
| 1 |
mostrar em tempo real os pontos de emoção PE de cada quesito
|
| 2 |
+
as os valores mínimos (min=) devem começar aparecendo no score-input de cada quesito
|
| 3 |
+
tudo ok, agora fazer que cada página seja um quesito e eu possa colocar as notas de todos jogadore, depois fazer um botão para proxima pagina para o próximo quesito ate terminar todos quesitos e pontos adicionais
|