mirror of
https://github.com/DeNNiiInc/Connect-5.git
synced 2026-04-17 20:36:00 +00:00
Enhance UI with ghost piece and board glow effects
This commit is contained in:
9
game.js
9
game.js
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user