Create landing page base layout

landing-page-layout
MiguelMLorente 2025-02-08 16:23:55 +01:00
parent b7561d804c
commit 0650f0481b
3 changed files with 72 additions and 3 deletions

View File

@ -3,16 +3,20 @@ import { Socket } from "socket.io-client";
import LandingPage from "./pages/landing/LandingPage"; import LandingPage from "./pages/landing/LandingPage";
import GamePage from "./pages/game/GamePage"; import GamePage from "./pages/game/GamePage";
import "./App.scss"; import "./App.scss";
import LobbyPage from "./pages/lobby/LobbyPage";
export interface AppProps { export interface AppProps {
socket: Socket; socket: Socket;
} }
const App = (props: AppProps) => { const App = (props: AppProps) => {
const renderedPage: string = "LOBBY";
return ( return (
<div id="app"> <div className="app">
<LandingPage {...props} /> {renderedPage === "LANDING" && <LandingPage {...props} />}
<GamePage /> {renderedPage === "LOBBY" && <LobbyPage />}
{renderedPage === "GAME" && <GamePage />}
</div> </div>
); );
}; };

View File

@ -0,0 +1,42 @@
.lobby-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%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.lobby-page-body {
margin: auto;
width: 20%;
min-width: 300px;
.lobby-user-name {
margin: 0 auto 10px;
padding: 10px;
width: 60%;
border: 2px solid cyan;
border-radius: 10px;
}
.start-game-button {
margin-top: 30px;
}
}
}

View File

@ -0,0 +1,23 @@
import "./LobbyPage.scss";
const LobbyPage = () => {
const userNames = ["Laura", "Miguel", "David"];
return (
<div className="lobby-page">
<div className="landing-page-title">
<h1>Trains And Roads</h1>
</div>
<div className="lobby-page-body">
{userNames.map((name) => (
<div className="lobby-user-name">{name}</div>
))}
<div className="start-game-button">
<button>Start Game</button>
</div>
</div>
</div>
);
};
export default LobbyPage;