Enhance UI with ghost piece and board glow effects

This commit is contained in:
2025-12-21 20:41:19 +11:00
parent acf32d0418
commit 79ffb771a8
2 changed files with 52 additions and 0 deletions

View File

@@ -67,6 +67,9 @@ class Connect5Game {
}
this.updateStatus();
// Set initial board class
this.boardElement.classList.add(`turn-${this.currentPlayer.toLowerCase()}`);
}
handleCellClick(row, col) {
@@ -213,6 +216,12 @@ class Connect5Game {
this.statusMessage.textContent = `Player ${this.currentPlayer}'s turn`;
this.currentPlayerDisplay.textContent = this.currentPlayer;
// Update board class for ghost piece
if (this.boardElement) {
this.boardElement.classList.remove('turn-x', 'turn-o');
this.boardElement.classList.add(`turn-${this.currentPlayer.toLowerCase()}`);
}
// Update the player display style
const playerDisplay = document.querySelector(".player-display");
if (this.currentPlayer === "O") {