improve layout for smaller width

This commit is contained in:
Vinzenz Schroeter 2024-04-21 21:37:38 +02:00
parent 19e1792307
commit 3cea9c967d
5 changed files with 13 additions and 4 deletions

View file

@ -1,4 +1,6 @@
.GadgetRows { .GadgetRows {
justify-content: space-evenly; justify-content: space-evenly;
margin-top: calc(4 * var(--padding-normal)); margin-top: var(--padding-big);
flex-wrap: wrap;
row-gap: var(--padding-big);
} }

View file

@ -33,6 +33,9 @@ export default function App() {
}, [nameId, isLoggedIn])(); }, [nameId, isLoggedIn])();
return <Column className='flex-grow'> return <Column className='flex-grow'>
<ClientScreen logout={logout} theme={theme} playerId={nameId.id}/>
<Row> <Row>
<h1 className='flex-grow'>CCCB-Tanks!</h1> <h1 className='flex-grow'>CCCB-Tanks!</h1>
<Button text='change colors' onClick={() => setTheme(_ => getRandomTheme())}/> <Button text='change colors' onClick={() => setTheme(_ => getRandomTheme())}/>
@ -42,12 +45,14 @@ export default function App() {
{nameId.name !== '' && {nameId.name !== '' &&
<Button onClick={() => setNameId(getNewNameId)} text='logout'/>} <Button onClick={() => setNameId(getNewNameId)} text='logout'/>}
</Row> </Row>
<ClientScreen logout={logout} theme={theme} playerId={nameId.id}/>
{nameId.name === '' && <JoinForm setNameId={setNameId} clientId={nameId.id}/>} {nameId.name === '' && <JoinForm setNameId={setNameId} clientId={nameId.id}/>}
<Row className='GadgetRows'> <Row className='GadgetRows'>
{isLoggedIn && <Controls playerId={nameId.id}/>} {isLoggedIn && <Controls playerId={nameId.id}/>}
{isLoggedIn && <PlayerInfo playerId={nameId.id}/>} {isLoggedIn && <PlayerInfo playerId={nameId.id}/>}
<Scoreboard/> <Scoreboard/>
</Row> </Row>
</Column>; </Column>;
} }

View file

@ -1,6 +1,6 @@
.Controls { .Controls {
text-align: center; text-align: center;
gap: calc(4 * var(--padding-normal)); gap: var(--padding-big);
} }
.Controls-Container { .Controls-Container {

View file

@ -10,6 +10,7 @@
box-sizing: border-box; box-sizing: border-box;
font-family: CCCBFont, monospace; font-family: CCCBFont, monospace;
text-transform: uppercase; text-transform: uppercase;
appearance: none;
} }
:root { :root {
@ -22,6 +23,7 @@
--border-size-thick: 8px; --border-size-thick: 8px;
--padding-normal: 8px; --padding-normal: 8px;
--padding-big: calc(4 * var(--padding-normal));
} }
html, body { html, body {

View file

@ -1,4 +1,4 @@
import {ConfigEnv, defineConfig} from 'vite'; import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/ // https://vitejs.dev/config/