refactor(new-game): modernize UI, remove player selects
- Refactored New Game screen to use a modern, card-like, dark-themed layout - Removed select dropdowns for previous players, now only datalist+input for player names - Updated paddings, backgrounds, borders, and font sizes for a visually consistent, modern look - No logic changes, only markup and style Refs #1
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"dev": "astro dev --host",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
|
||||
@@ -28,43 +28,54 @@ export default function NewGame({ onCreateGame, playerNameHistory, onCancel }) {
|
||||
|
||||
return (
|
||||
<form className={styles['new-game-form']} onSubmit={handleSubmit}>
|
||||
<div>
|
||||
<label>Spieler 1:</label>
|
||||
<input value={player1} onInput={e => setPlayer1(e.target.value)} list="player1-history" />
|
||||
<div className={styles['screen-title']}>Neues Spiel</div>
|
||||
<div className={styles['player-inputs']}>
|
||||
<div className={styles['player-input']}>
|
||||
<label>Spieler 1</label>
|
||||
<div className={styles['name-input-container']}>
|
||||
<input className={styles['name-input']} placeholder="Name Spieler 1" value={player1} onInput={e => setPlayer1(e.target.value)} list="player1-history" />
|
||||
<datalist id="player1-history">
|
||||
{playerNameHistory.map(name => <option value={name} key={name} />)}
|
||||
</datalist>
|
||||
</div>
|
||||
<div>
|
||||
<label>Spieler 2:</label>
|
||||
<input value={player2} onInput={e => setPlayer2(e.target.value)} list="player2-history" />
|
||||
</div>
|
||||
<div className={styles['player-input']}>
|
||||
<label>Spieler 2</label>
|
||||
<div className={styles['name-input-container']}>
|
||||
<input className={styles['name-input']} placeholder="Name Spieler 2" value={player2} onInput={e => setPlayer2(e.target.value)} list="player2-history" />
|
||||
<datalist id="player2-history">
|
||||
{playerNameHistory.map(name => <option value={name} key={name} />)}
|
||||
</datalist>
|
||||
</div>
|
||||
<div>
|
||||
<label>Spieler 3 (optional):</label>
|
||||
<input value={player3} onInput={e => setPlayer3(e.target.value)} list="player3-history" />
|
||||
</div>
|
||||
<div className={styles['player-input']}>
|
||||
<label>Spieler 3 (optional)</label>
|
||||
<div className={styles['name-input-container']}>
|
||||
<input className={styles['name-input']} placeholder="Name Spieler 3" value={player3} onInput={e => setPlayer3(e.target.value)} list="player3-history" />
|
||||
<datalist id="player3-history">
|
||||
{playerNameHistory.map(name => <option value={name} key={name} />)}
|
||||
</datalist>
|
||||
</div>
|
||||
<div>
|
||||
<label>Spieltyp:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles['game-settings']}>
|
||||
<div className={styles['setting-group']}>
|
||||
<label>Spieltyp</label>
|
||||
<select value={gameType} onChange={e => setGameType(e.target.value)}>
|
||||
<option value="8-Ball">8-Ball</option>
|
||||
<option value="9-Ball">9-Ball</option>
|
||||
<option value="10-Ball">10-Ball</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Race to:</label>
|
||||
<div className={styles['setting-group']}>
|
||||
<label>Race to X (optional)</label>
|
||||
<input type="number" value={raceTo} onInput={e => setRaceTo(e.target.value)} min="1" />
|
||||
</div>
|
||||
</div>
|
||||
{error && <div className={styles['validation-error']}>{error}</div>}
|
||||
<div className={styles['form-actions']}>
|
||||
<button type="button" className={styles['nav-button']} onClick={onCancel}>Abbrechen</button>
|
||||
<button type="submit" className={styles['nav-button']}>Spiel starten</button>
|
||||
<div className={styles['nav-buttons']}>
|
||||
<button type="button" className={styles['btn']} onClick={onCancel}>Abbrechen</button>
|
||||
<button type="submit" className={styles['btn']}>Spiel starten</button>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
|
||||
@@ -18,94 +18,117 @@
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.screen-title {
|
||||
font-size: 24px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
margin-bottom: 32px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.player-inputs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
gap: 24px;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.player-input {
|
||||
margin-bottom: 20px;
|
||||
background: #222;
|
||||
border-radius: 8px;
|
||||
padding: 20px 16px 16px 16px;
|
||||
margin-bottom: 0;
|
||||
box-shadow: 0 1px 4px rgba(0,0,0,0.12);
|
||||
}
|
||||
.player-input label {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 12px;
|
||||
color: #ccc;
|
||||
font-size: 24px;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.name-input-container {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
.name-select {
|
||||
flex: 1;
|
||||
padding: 30px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
min-height: 44px;
|
||||
gap: 12px;
|
||||
}
|
||||
.name-input {
|
||||
flex: 2;
|
||||
padding: 30px;
|
||||
padding: 14px 12px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
font-size: 1.1rem;
|
||||
min-height: 44px;
|
||||
}
|
||||
.name-select:focus, .name-input:focus {
|
||||
outline: none;
|
||||
border-color: #666;
|
||||
border-radius: 0 6px 6px 0;
|
||||
}
|
||||
.game-settings {
|
||||
margin-top: 20px;
|
||||
margin-top: 0;
|
||||
width: 100%;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.setting-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.setting-group select {
|
||||
.setting-group label {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
color: #ccc;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.setting-group select, .setting-group input {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
padding: 14px 12px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
font-size: 1.1rem;
|
||||
min-height: 44px;
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.setting-group input {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
}
|
||||
.setting-group input:focus {
|
||||
.setting-group input:focus, .setting-group select:focus {
|
||||
outline: none;
|
||||
border-color: #666;
|
||||
}
|
||||
.validation-error {
|
||||
color: #f44336;
|
||||
background: #2a2a2a;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 1.1rem;
|
||||
text-align: center;
|
||||
}
|
||||
.nav-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin: 20px 0 40px 0;
|
||||
gap: 12px;
|
||||
margin: 16px 0 0 0;
|
||||
}
|
||||
.btn {
|
||||
flex: 1;
|
||||
min-width: 100px;
|
||||
padding: 20px;
|
||||
padding: 18px;
|
||||
color: white;
|
||||
background: #333;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-size: 20px;
|
||||
border-radius: 6px;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
touch-action: manipulation;
|
||||
transition: background 0.2s, color 0.2s;
|
||||
}
|
||||
.btn:hover {
|
||||
background: #444;
|
||||
}
|
||||
.new-game-form {
|
||||
width: 100%;
|
||||
max-width: 700px;
|
||||
margin: 32px auto 0 auto;
|
||||
background: #181818;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 2px 16px rgba(0,0,0,0.4);
|
||||
padding: 32px 24px 24px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user