mirror of
https://github.com/DeNNiiInc/Connect-5.git
synced 2026-04-17 22:46:00 +00:00
Feat: Add temporary 2x brightness highlight for last move
This commit is contained in:
7
game.js
7
game.js
@@ -94,7 +94,12 @@ class Connect5Game {
|
||||
// Update UI
|
||||
const cellIndex = row * this.boardSize + col;
|
||||
const cell = this.boardElement.children[cellIndex];
|
||||
cell.classList.add("occupied", this.currentPlayer.toLowerCase());
|
||||
cell.classList.add("occupied", this.currentPlayer.toLowerCase(), "latest-move");
|
||||
|
||||
// Remove brightness boost after 2 seconds
|
||||
setTimeout(() => {
|
||||
if (cell) cell.classList.remove("latest-move");
|
||||
}, 2000);
|
||||
|
||||
// In local mode only, check for win/draw and switch player
|
||||
if (!multiplayerClient || !multiplayerClient.isMultiplayer) {
|
||||
|
||||
Reference in New Issue
Block a user