Skip to content

Commit

Permalink
Update index.html to display winner
Browse files Browse the repository at this point in the history
  • Loading branch information
Antenehden authored Aug 12, 2024
1 parent 996943b commit 0bb8b3d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@ <h3>Scores</h3>
stakeDisplay.textContent = 'Stake: ' + (currentRound.currentStake);
statusDisplay.textContent = 'Status: ' + (gameState.isGameActive ? 'Closed' : 'Open');
roundDisplay.textContent = 'Round: ' + (gameState.currentRoundIndex + 1) + '/' + gameState.rounds.length;
winnerDisplay.textContent = 'Winner: ' + (gameState.winner ? gameState.winner.name : 'No winner yet');
currentPlayerDisplay.textContent = 'Current Player: ' + (gameState.players.find(p => p.name === currentPlayer.name).name);

if (!gameState.isGameActive && gameState.stats.winner) {
winnerDisplay.textContent = 'Winner: ' + gameState.stats.winner.name;
} else {
winnerDisplay.textContent = 'Winner: ';
}

scoreTable.innerHTML = '';
gameState.players.forEach(player => {
const row = document.createElement('tr');
Expand Down

0 comments on commit 0bb8b3d

Please sign in to comment.