Skip to content

Commit

Permalink
Styling the game-status message
Browse files Browse the repository at this point in the history
  • Loading branch information
etnt committed Oct 11, 2024
1 parent 8d94584 commit 123772a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@

.welcome-message {
font-size: 1.5em;
padding-left: 200px;
margin: 0;
margin-right: 20px;
/* Add some space between the message and the button */
Expand All @@ -187,6 +188,11 @@
/* Darker red on hover */
}

.game-status {
font-size: 1.1em;
padding-left: 40px;
}

.challenge-user {
font-size: 16px;
font-weight: bold;
Expand Down
12 changes: 6 additions & 6 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ const App: React.FC = () => {
<div className="welcome-container">
<h2 className="welcome-message">Welcome {user.username}!</h2>
<button className="logout-button" onClick={handleLogout}>Logout</button>
<div className="game-status">
{gameStatus === 'active' && <p></p>}
{gameStatus === 'resigned' && <p>White resigned. Black wins!</p>}
{gameStatus === 'checkmate' && <p>Checkmate! {game.turn() === 'w' ? 'Black' : 'White'} wins!</p>}
{gameStatus === 'draw' && <p>Game ended in a draw</p>}
</div>
</div>
<div className="game-container">
<div className="side-controls">
Expand Down Expand Up @@ -214,12 +220,6 @@ const App: React.FC = () => {
/>
</div>
</div>
<div className="game-status">
{gameStatus === 'active' && <p>Game in progress</p>}
{gameStatus === 'resigned' && <p>White resigned. Black wins!</p>}
{gameStatus === 'checkmate' && <p>Checkmate! {game.turn() === 'w' ? 'Black' : 'White'} wins!</p>}
{gameStatus === 'draw' && <p>Game ended in a draw</p>}
</div>
{opponent !== 'stockfish' && (
<div className="online-players">
<h3>Online Players</h3>
Expand Down

0 comments on commit 123772a

Please sign in to comment.