feat: devWeb - display the current round

This commit is contained in:
kmitresse
2024-05-01 11:25:23 +02:00
parent b9c08fa6cc
commit ec26b8b334
4 changed files with 19 additions and 8 deletions
@@ -7,7 +7,7 @@
<layout:base title="Profil">
<component:hero>
<div class="columns is-centered">
<div class="column is-9-tablet is-9-desktop is-9-widescreen">
<div class="column is-11-tablet is-11-desktop is-11-widescreen">
<component:card title="Statistiques de la partie">
<component:game-statistics/>
</component:card>
@@ -50,7 +50,7 @@
<div class="column is-one-quarter is-justify-content-center" id="choice"
style="position: absolute; right: 0; z-index: 9999">
<div class="buttons is-flex-direction-column">
<p id="round"></p>
<p id="round" class="title has-text-white"></p>
<button class="button is-fullwidth" data-value="COLOR_VALUE">Même couleur et valeur</button>
<button class="button is-fullwidth" data-value="COLOR">Même couleur</button>
<button class="button is-fullwidth" data-value="VALUE">Même valeur</button>
@@ -258,11 +258,16 @@
const deck = document.querySelector('#deck'); // Column
const myCard = document.querySelector('#myCard'); // Column
const otherCards = document.querySelector('#otherCards'); // Columns
const round = document.querySelector('#round');
// Reset content
deck.innerHTML = "";
myCard.innerHTML = "";
otherCards.innerHTML = "";
round.innerText = "";
// Show current round
round.innerText = "Manche " + (currentGame.currentRound+1)
// Show other player cards
game.players
@@ -304,13 +309,19 @@
const choice = document.querySelector('#choice');
const myCard = document.querySelector('#myCard'); // Column
const otherCards = document.querySelector('#otherCards'); // Columns
const round = document.querySelector('#round');
// Reset content
deck.innerHTML = "";
myCard.innerHTML = "";
otherCards.innerHTML = "";
round.innerText = "";
choice.querySelectorAll('button').forEach(button => button.disabled = false);
// Show the current round
round.innerText = "Manche " + (currentGame.currentRound + 1)
// Show other player cards
game.players
.filter(p => p.user.id !== ${user.id})