Minor style fixes

landing-page-layout
MiguelMLorente 2024-12-10 23:46:47 +01:00
parent d9eafeb71a
commit 3a9b88ef55
5 changed files with 46 additions and 30 deletions

View File

@ -3,10 +3,10 @@ import { Player } from 'src/players/player';
export class Game {
gameId: string;
gameCode: string;
players: Set<Player>;
players: Player[];
constructor(gameId: string, gameCode: string, player: Player) {
this.gameId = gameId;
this.gameCode = gameCode;
this.players = new Set([player]);
this.players = [player];
}
}

View File

@ -1,3 +1,9 @@
@use "node_modules/@picocss/pico/scss/pico" with (
$theme-color: "pumpkin"
);
#root, #app {
height: 100%;
width: 100%;
padding: 0;
}

View File

@ -8,7 +8,7 @@ export interface AppProps {
const App = (props: AppProps) => {
return (
<div className="app">
<div id="app">
<LandingPage {...props} />
</div>
);

View File

@ -1,11 +1,15 @@
body {
.landing-page {
height: 100%;
width: 100%;
padding: 2%;
margin: 0 auto;
text-align: center;
background: linear-gradient(-45deg, #03444a, #00a8a8, #f1bc52, #ff8f4b);
background-size: 400% 400%;
animation: gradient 15s ease infinite;
height: 100vh;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
@ -17,13 +21,20 @@ body {
background-position: 0% 50%;
}
}
div {
.landing-page-body {
margin: auto;
width: 20%;
min-width: 300px;
}
> div {
padding: 2%;
}
button {
font-size: 1rem;
width: 70%;
margin-bottom: var(--pico-spacing)
}
#body-format {
margin: auto;
max-width: 20%;
}

View File

@ -25,12 +25,12 @@ const LandingPage = (props: LandingPageProps) => {
(joinLobbyPayload.lobbyId = event.target.value);
return (
<React.Fragment>
<div className="landing-page-title" id="landing-page-title">
<div className="landing-page">
<div>
<h1>Trains And Roads</h1>
</div>
<div id="body-format">
<div className="user-name-input" id="user-name-input">
<div className="landing-page-body">
<div>
<input
placeholder="Enter username"
onChange={registerUsername}
@ -39,21 +39,20 @@ const LandingPage = (props: LandingPageProps) => {
Create Lobby
</button>
</div>
<div className="join-lobby" id="join-lobby">
<div>
<input
className="lobby-id-input"
placeholder="Enter Lobby Id"
onChange={registerLobbyId}
></input>
<button
className="join-lobby-button secondary"
className="secondary"
onClick={() => handleJoinLobby(socket, joinLobbyPayload)}
>
Join Lobby
</button>
</div>
</div>
</React.Fragment>
</div>
);
};
export default LandingPage;