From 0fa644dbc003202af115fe6bf6a5e89816dd9dd8 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Sat, 29 Nov 2025 03:11:33 +0530 Subject: [PATCH] - Added full-height flex layout with fixed header and centered main content. - Locked page scroll via body overflow hidden to prevent outer page scrolling. - Moved game content into scrollable middle pane. - Removed global top padding from styles.css to match new fixed-header layout. - Simplified layout structure and removed unused commented code. --- src/tictactoe/TicTacToe.tsx | 115 +++++++++++++++--------------------- src/tictactoe/styles.css | 1 - 2 files changed, 48 insertions(+), 68 deletions(-) diff --git a/src/tictactoe/TicTacToe.tsx b/src/tictactoe/TicTacToe.tsx index 4aac9dd..a7e16ec 100644 --- a/src/tictactoe/TicTacToe.tsx +++ b/src/tictactoe/TicTacToe.tsx @@ -33,29 +33,17 @@ export default function TicTacToe() { } } + useEffect(() => { + document.body.style.overflow = "hidden"; + return () => { + document.body.style.overflow = "auto"; + }; + }, []); + useEffect(() => { onMatchData(onMatchDataCallback); }, [onMatchData]); - // useEffect(() => { - // let active = true; - // - // async function refreshLoop() { - // while (active) { - // const matches = await listOpenMatches(); - // setOpenMatches(matches); - // - // await new Promise(res => setTimeout(res, 500)); // 0.5s refresh - // } - // } - // - // refreshLoop(); - // - // return () => { - // active = false; - // }; - // }, [listOpenMatches]); - // ------------------------------------------ // SEND A MOVE // ------------------------------------------ @@ -66,73 +54,66 @@ export default function TicTacToe() { } return ( - - {/* Game header bar */} - Tic Tac Toe Multiplayer - + - {/* Player component panel */} -
-
- {/* Board display container */} - - +
+ +
-
+ ); } diff --git a/src/tictactoe/styles.css b/src/tictactoe/styles.css index 5a0fd1c..86e1555 100644 --- a/src/tictactoe/styles.css +++ b/src/tictactoe/styles.css @@ -3,7 +3,6 @@ body { background: #eaeef3; display: flex; justify-content: center; - padding-top: 50px; margin: 0; color: #222; }