From ebc6906bf6be6bceaf6f65608a70386461fdd1b6 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Sat, 29 Nov 2025 02:47:57 +0530 Subject: [PATCH] - Introduced animated Board component with smooth mount transitions. - Added hover scale, tap animations, and cell pop-in effects for moves. - Implemented animated status transitions and winner pulse effect. - Highlighted winning symbols with glow styling. - Improved game feel with responsive and modern interaction feedback. --- src/tictactoe/Board.tsx | 116 ++++++++++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 16 deletions(-) diff --git a/src/tictactoe/Board.tsx b/src/tictactoe/Board.tsx index c8dd082..b9632f0 100644 --- a/src/tictactoe/Board.tsx +++ b/src/tictactoe/Board.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { motion, AnimatePresence } from "framer-motion"; interface BoardProps { board: string[][]; @@ -29,7 +30,7 @@ export default function Board({ const isMyTurn = gameReady && myIndex !== -1 && turn === myIndex; // ------------------------------- - // 🟦 HEADER STATUS FIXED + // STATUS // ------------------------------- let status; if (!gameReady) { @@ -43,16 +44,37 @@ export default function Board({ } return ( -
-

{status}

+ + + {status} + {gameReady && mySymbol && ( -
- You: {mySymbol} — Opponent: {opponentSymbol} -
+ + You: {mySymbol} — Opponent:{" "} + {opponentSymbol} + )} -
!disabled && onCellClick(rIdx, cIdx)} style={{ width: "80px", height: "80px", fontSize: "2rem", + borderRadius: "10px", + border: "2px solid #333", + background: "#111", + color: "white", cursor: disabled ? "not-allowed" : "pointer", - }} - onClick={() => { - if (!disabled) onCellClick(rIdx, cIdx); + display: "flex", + alignItems: "center", + justifyContent: "center", }} > - {cell} - + + {cell && ( + + {cell} + + )} + + ); }) )} -
-
+ + + {/* Winner pulse animation */} + {winner && ( + + 🎉 {winner} Wins! 🎉 + + )} + ); }