2 Commits

Author SHA1 Message Date
Frank Schwenk c93c9035ae fix(ui): robust default layout for club tablets 2026-09-24 16:35:28 +02:00
Frank Schwenk c876a80b7e feat: add setup button to edit game details 2026-09-22 16:04:47 +02:00
27 changed files with 1110 additions and 529 deletions
File diff suppressed because one or more lines are too long
+26 -48
View File
@@ -1,5 +1,5 @@
import { h } from 'preact';
import { useEffect, useCallback } from 'preact/hooks';
import { useCallback } from 'preact/hooks';
import {
useGameState,
@@ -10,8 +10,9 @@ import {
useCompletionModal,
} from '@lib/state';
import { GameService } from '@lib/data/gameService';
import type { StandardGame, Game, EndlosGame } from '@lib/domain/types';
import { isEndlosGame } from '@lib/domain/gameUtils';
import type { StandardGame, Game, EndlosGame, GameSetupData } from '@lib/domain/types';
import { applySetupData, isEndlosGame, isStandardGame } from '@lib/domain/gameUtils';
import { validateGameSetupData } from '@lib/domain/validation';
import { Layout } from '@lib/ui/Layout';
import GameListScreen from './screens/GameListScreen';
@@ -34,51 +35,6 @@ export default function App() {
const validationModal = useValidationModal();
const completionModal = useCompletionModal();
// Keep layout height stable when the virtual keyboard opens on cheap Android tablets.
useEffect(() => {
const root = document.documentElement;
let rafId = 0;
let orientationTimer1 = 0;
let orientationTimer2 = 0;
const updateViewportVars = () => {
cancelAnimationFrame(rafId);
rafId = requestAnimationFrame(() => {
const viewport = window.visualViewport;
const layoutHeight = window.innerHeight;
const appHeight = viewport?.height ?? layoutHeight;
const keyboardOffset = viewport
? Math.max(0, layoutHeight - viewport.height - viewport.offsetTop)
: 0;
root.style.setProperty('--app-height', `${Math.round(appHeight)}px`);
root.style.setProperty('--keyboard-offset', `${Math.round(keyboardOffset)}px`);
});
};
const handleOrientationChange = () => {
updateViewportVars();
orientationTimer1 = window.setTimeout(updateViewportVars, 100);
orientationTimer2 = window.setTimeout(updateViewportVars, 350);
};
updateViewportVars();
window.addEventListener('resize', updateViewportVars);
window.addEventListener('orientationchange', handleOrientationChange);
window.visualViewport?.addEventListener('resize', updateViewportVars);
window.visualViewport?.addEventListener('scroll', updateViewportVars);
return () => {
cancelAnimationFrame(rafId);
window.clearTimeout(orientationTimer1);
window.clearTimeout(orientationTimer2);
window.removeEventListener('resize', updateViewportVars);
window.removeEventListener('orientationchange', handleOrientationChange);
window.visualViewport?.removeEventListener('resize', updateViewportVars);
window.visualViewport?.removeEventListener('scroll', updateViewportVars);
};
}, []);
// Game lifecycle handlers
const handleCreateGame = useCallback(async (gameData: any) => {
try {
@@ -141,6 +97,27 @@ export default function App() {
}
}, [navigation.currentGameId, gameState.getGameById, gameState.updateGame, validationModal.showValidation]);
const handleUpdateGameSetup = useCallback(async (setupData: GameSetupData) => {
if (!navigation.currentGameId) return;
const game = gameState.getGameById(navigation.currentGameId);
if (!game || !isStandardGame(game)) return;
const validation = validateGameSetupData(setupData);
if (!validation.isValid) {
validationModal.showValidation(validation.errors.join('\n'));
return;
}
try {
const updatedGame = applySetupData(game, setupData);
await gameState.updateGame(navigation.currentGameId, updatedGame);
} catch (error) {
console.error('Failed to update game setup:', error);
validationModal.showValidation('Spieleinstellungen konnten nicht gespeichert werden.');
}
}, [navigation.currentGameId, gameState.getGameById, gameState.updateGame, validationModal.showValidation]);
const handleForfeit = async () => {
if (!navigation.currentGameId) return;
@@ -294,6 +271,7 @@ export default function App() {
onUndo={handleUndo}
onForfeit={handleForfeit}
onBack={navigation.showGameList}
onUpdateGameSetup={handleUpdateGameSetup}
/>
)}
+1 -1
View File
@@ -1,6 +1,6 @@
/* FullscreenToggle — top-right keeps bottom controls clear on scoreboard */
.fullscreenToggle {
position: fixed;
position: absolute;
top: calc(var(--space-md) + var(--safe-area-top));
right: calc(var(--space-md) + var(--safe-area-right));
width: var(--touch-target-comfortable);
+2 -2
View File
@@ -10,9 +10,9 @@ const FullscreenToggle = () => {
// Toggle fullscreen mode for the document
const handleToggle = useCallback(() => {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen();
document.documentElement.requestFullscreen().catch(() => {});
} else {
document.exitFullscreen();
document.exitFullscreen().catch(() => {});
}
}, []);
+4 -1
View File
@@ -1,7 +1,7 @@
import { h } from 'preact';
import { Screen } from '@lib/ui/Layout';
import GameDetail from '@lib/features/game-detail/GameDetail';
import type { Game, EndlosGame } from '@lib/domain/types';
import type { Game, EndlosGame, GameSetupData } from '@lib/domain/types';
interface GameDetailScreenProps {
game?: Game;
@@ -11,6 +11,7 @@ interface GameDetailScreenProps {
onUndo: () => void;
onForfeit: () => void;
onBack: () => void;
onUpdateGameSetup?: (setupData: GameSetupData) => void;
}
export default function GameDetailScreen({
@@ -21,6 +22,7 @@ export default function GameDetailScreen({
onUndo,
onForfeit,
onBack,
onUpdateGameSetup,
}: GameDetailScreenProps) {
if (!game) {
return (
@@ -40,6 +42,7 @@ export default function GameDetailScreen({
onUndo={onUndo}
onForfeit={onForfeit}
onBack={onBack}
onUpdateGameSetup={onUpdateGameSetup}
/>
</Screen>
);
+5
View File
@@ -38,6 +38,11 @@ export const VALIDATION_MESSAGES = {
RACE_TO_REQUIRED: 'Race-to Wert ist erforderlich',
RACE_TO_INVALID: 'Race-to Wert muss eine positive Zahl sein',
DUPLICATE_PLAYER_NAMES: 'Spielernamen müssen eindeutig sein',
SCORE_INVALID: 'Punkte müssen ganze Zahlen ≥ 0 sein',
BREAK_RULE_REQUIRED: 'Break-Regel ist erforderlich',
BREAK_ORDER_INVALID: 'Break-Reihenfolge ist ungültig',
CURRENT_BREAKER_INVALID: 'Aktueller Breaker ist ungültig',
RACE_TO_BELOW_SCORE: 'Race-to muss mindestens dem höchsten Punktestand entsprechen',
} as const;
export const BREAKPOINTS = {
+92 -1
View File
@@ -1,4 +1,4 @@
import type { Game, StandardGame, EndlosGame } from './types';
import type { Game, GameSetupData, StandardGame, EndlosGame } from './types';
/**
* Game utility functions for common operations
@@ -12,6 +12,97 @@ export function isStandardGame(game: Game): game is StandardGame {
return !('players' in game);
}
function setupActivePlayerCount(data: GameSetupData): number {
return data.player3?.trim() ? 3 : 2;
}
function defaultBreakOrder(playerCount: number): number[] {
return playerCount === 3 ? [1, 2, 3] : [1, 2];
}
function normalizeBreakFields(
data: GameSetupData,
playerCount: number,
): { breakOrder: number[]; currentBreakerIdx: number } {
const expectedPlayers = playerCount === 3 ? [1, 2, 3] : [1, 2];
const order = data.breakOrder ?? [];
const orderValid =
order.length === playerCount &&
new Set(order).size === playerCount &&
order.every((p) => expectedPlayers.includes(p)) &&
expectedPlayers.every((p) => order.includes(p));
if (!orderValid) {
return { breakOrder: defaultBreakOrder(playerCount), currentBreakerIdx: 0 };
}
const idx = data.currentBreakerIdx;
if (!Number.isInteger(idx) || idx < 0 || idx >= order.length) {
return { breakOrder: order, currentBreakerIdx: 0 };
}
return { breakOrder: order, currentBreakerIdx: idx };
}
export function gameToSetupData(game: StandardGame): GameSetupData {
const playerCount = game.player3?.trim() ? 3 : 2;
const breakOrder = game.breakOrder ?? defaultBreakOrder(playerCount);
return {
player1: game.player1,
player2: game.player2,
player3: game.player3,
score1: game.score1,
score2: game.score2,
score3: game.score3,
gameType: game.gameType,
raceTo: game.raceTo,
breakRule: game.breakRule ?? 'winnerbreak',
breakOrder,
currentBreakerIdx: game.currentBreakerIdx ?? 0,
};
}
export function applySetupData(game: StandardGame, data: GameSetupData): StandardGame {
const playerCount = setupActivePlayerCount(data);
const { breakOrder, currentBreakerIdx } = normalizeBreakFields(data, playerCount);
const scores = [data.score1, data.score2];
if (playerCount === 3) {
scores.push(data.score3 ?? 0);
}
let status = game.status;
if (data.raceTo !== Infinity && scores.some((score) => score >= data.raceTo)) {
status = 'completed';
}
const updated: StandardGame = {
...game,
player1: data.player1.trim(),
player2: data.player2.trim(),
score1: data.score1,
score2: data.score2,
gameType: data.gameType,
raceTo: data.raceTo,
breakRule: data.breakRule,
breakOrder,
currentBreakerIdx,
status,
updatedAt: new Date().toISOString(),
};
if (playerCount === 3 && data.player3?.trim()) {
updated.player3 = data.player3.trim();
updated.score3 = data.score3 ?? 0;
} else {
delete updated.player3;
delete updated.score3;
}
return updated;
}
export function formatGameTime(dateString: string): string {
const date = new Date(dateString);
const now = new Date();
+14
View File
@@ -71,4 +71,18 @@ export interface NewGameData {
export type NewGameStep = 'player1' | 'player2' | 'player3' | 'gameType' | 'raceTo' | 'breakRule' | 'breakOrder' | null;
export interface GameSetupData {
player1: string;
player2: string;
player3?: string;
score1: number;
score2: number;
score3?: number;
gameType: GameType;
raceTo: number;
breakRule: BreakRule;
breakOrder: number[];
currentBreakerIdx: number;
}
export type GameFilter = 'all' | 'active' | 'completed';
+79 -1
View File
@@ -1,5 +1,5 @@
import { APP_CONFIG, VALIDATION_MESSAGES } from './constants';
import type { NewGameData } from './types';
import type { GameSetupData, NewGameData } from './types';
export interface ValidationResult {
isValid: boolean;
@@ -80,6 +80,84 @@ export function sanitizePlayerName(name: string): string {
.replace(/[^\w\s-]/g, ''); // Remove special characters except spaces and hyphens
}
function activePlayerCountFromSetup(data: GameSetupData): number {
return data.player3?.trim() ? 3 : 2;
}
function isValidScore(value: number | undefined, required: boolean): boolean {
if (value === undefined) return !required;
return Number.isInteger(value) && value >= 0;
}
export function validateGameSetupData(data: GameSetupData): ValidationResult {
const errors: string[] = [];
const player1Validation = validatePlayerName(data.player1);
const player2Validation = validatePlayerName(data.player2);
errors.push(...player1Validation.errors);
errors.push(...player2Validation.errors);
const playerNames = [data.player1.trim(), data.player2.trim()];
const hasThirdPlayer = Boolean(data.player3?.trim());
if (hasThirdPlayer) {
const player3Validation = validatePlayerName(data.player3!);
errors.push(...player3Validation.errors);
playerNames.push(data.player3!.trim());
}
const nonEmptyNames = playerNames.filter((name) => name.length > 0);
if (new Set(nonEmptyNames).size !== nonEmptyNames.length) {
errors.push(VALIDATION_MESSAGES.DUPLICATE_PLAYER_NAMES);
}
const thirdScoreRequired = hasThirdPlayer;
if (!isValidScore(data.score1, true) || !isValidScore(data.score2, true) || !isValidScore(data.score3, thirdScoreRequired)) {
errors.push(VALIDATION_MESSAGES.SCORE_INVALID);
}
if (!data.gameType) {
errors.push(VALIDATION_MESSAGES.GAME_TYPE_REQUIRED);
}
const raceTo = data.raceTo;
if (raceTo !== Infinity && (!Number.isInteger(raceTo) || raceTo <= 0)) {
errors.push(VALIDATION_MESSAGES.RACE_TO_INVALID);
} else if (raceTo !== Infinity) {
const maxScore = Math.max(data.score1, data.score2, data.score3 ?? 0);
if (raceTo < maxScore) {
errors.push(VALIDATION_MESSAGES.RACE_TO_BELOW_SCORE);
}
}
if (!data.breakRule) {
errors.push(VALIDATION_MESSAGES.BREAK_RULE_REQUIRED);
}
const activeCount = activePlayerCountFromSetup(data);
const expectedPlayers = activeCount === 3 ? [1, 2, 3] : [1, 2];
const order = data.breakOrder ?? [];
const orderValid =
order.length === activeCount &&
new Set(order).size === activeCount &&
order.every((p) => expectedPlayers.includes(p)) &&
expectedPlayers.every((p) => order.includes(p));
if (!orderValid) {
errors.push(VALIDATION_MESSAGES.BREAK_ORDER_INVALID);
}
const breakerIdx = data.currentBreakerIdx;
if (!Number.isInteger(breakerIdx) || breakerIdx < 0 || breakerIdx >= order.length) {
errors.push(VALIDATION_MESSAGES.CURRENT_BREAKER_INVALID);
}
return {
isValid: errors.length === 0,
errors,
};
}
export function validateRaceTo(value: string): ValidationResult {
const errors: string[] = [];
@@ -3,8 +3,7 @@
.gameDetail {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
min-height: 100%;
padding: var(--space-md);
padding-bottom: calc(var(--space-md) + var(--safe-area-bottom));
user-select: none;
@@ -35,16 +34,15 @@
width: 40px;
height: 40px;
border-radius: var(--radius-md);
background: linear-gradient(135deg, var(--color-primary) 0%, #e65100 100%);
background: var(--color-primary);
color: #1a1a1a;
font-size: var(--font-size-xs);
font-weight: 900;
letter-spacing: 0.08em;
box-shadow: 0 0 12px rgba(255, 152, 0, 0.35);
}
.gameTitle {
font-size: clamp(1rem, 2.5vh, 1.5rem);
font-size: 1rem;
color: var(--color-text);
font-weight: 700;
letter-spacing: 0.06em;
@@ -68,15 +66,13 @@
.scoresContainer {
display: flex;
flex: 1;
justify-content: stretch;
align-items: stretch;
flex: 1 1 auto;
gap: var(--space-md);
min-height: 0;
min-height: 200px;
}
.playerScore {
flex: 1;
flex: 1 1 auto;
display: flex;
flex-direction: column;
align-items: stretch;
@@ -84,26 +80,25 @@
padding: var(--space-lg) var(--space-md);
border-radius: var(--radius-xl);
position: relative;
box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
min-width: 0;
min-height: 0;
min-height: 140px;
border: 3px solid transparent;
transition: border-color var(--transition-base), transform var(--transition-fast);
transition: border-color var(--transition-base);
overflow: hidden;
cursor: pointer;
touch-action: manipulation;
}
.player1 {
background: linear-gradient(180deg, #3a5a3d 0%, var(--color-player-1) 100%);
background: var(--color-player-1);
}
.player2 {
background: linear-gradient(180deg, #354d6a 0%, var(--color-player-2) 100%);
background: var(--color-player-2);
}
.player3 {
background: linear-gradient(180deg, #444 0%, var(--color-player-3) 100%);
background: var(--color-player-3);
}
.playerScore.completed {
@@ -117,12 +112,11 @@
}
.playerScore:active:not([aria-disabled="true"]) {
transform: scale(0.99);
opacity: 0.95;
}
.playerScore.winner {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary), 0 0 28px rgba(255, 152, 0, 0.45), var(--shadow-lg);
}
.playerScore.winner .playerName {
@@ -140,10 +134,9 @@
}
.playerName {
font-size: clamp(1.1rem, 3vh, 1.75rem);
font-size: 1.1rem;
font-weight: 700;
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@@ -154,30 +147,16 @@
.breakIndicator {
display: inline-block;
width: clamp(14px, 2.5vh, 22px);
height: clamp(14px, 2.5vh, 22px);
width: 16px;
height: 16px;
border-radius: 50%;
background: #fff;
flex-shrink: 0;
box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
animation: breakPulse 2s ease-in-out infinite;
}
@keyframes breakPulse {
0%, 100% {
opacity: 1;
box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}
50% {
opacity: 0.65;
box-shadow: 0 0 14px rgba(255, 255, 255, 0.95), 0 0 20px rgba(255, 152, 0, 0.4);
}
}
.winnerBadge {
font-size: clamp(1rem, 2.5vh, 1.5rem);
font-size: 1rem;
color: var(--color-primary);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
flex-shrink: 0;
}
@@ -195,67 +174,32 @@
height: 100%;
background: rgba(255, 255, 255, 0.9);
border-radius: var(--radius-sm);
transition: width var(--transition-slow);
}
.score {
font-size: clamp(4.5rem, 30vh, 14rem);
font-size: 3.5rem;
font-weight: 900;
line-height: 1;
color: #fff;
text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
flex: 1 1 0;
flex: 1 1 auto;
width: 100%;
min-height: 0;
border-radius: var(--radius-lg);
padding: var(--space-xs);
font-variant-numeric: tabular-nums;
position: relative;
pointer-events: none;
}
.score::after {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: radial-gradient(circle at center, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
opacity: 0;
transform: scale(0.5);
pointer-events: none;
}
.scoreTap::after {
animation: scoreRipple 0.35s ease-out forwards;
}
.scoreBump {
animation: scoreBump 0.25s ease-out;
}
@keyframes scoreRipple {
0% { opacity: 0.6; transform: scale(0.4); }
100% { opacity: 0; transform: scale(1.4); }
}
@keyframes scoreBump {
0% { transform: scale(1); }
40% { transform: scale(1.12); }
100% { transform: scale(1); }
}
.gameDetailControls {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: var(--space-md);
margin-top: var(--space-lg);
padding-bottom: calc(var(--space-md) + var(--keyboard-offset));
width: 100%;
justify-content: center;
flex-shrink: 0;
@@ -263,7 +207,7 @@
.gameDetailControls > * {
flex: 1;
min-width: min(160px, 100%);
min-width: 120px;
max-width: 280px;
}
@@ -288,15 +232,42 @@
}
}
/* Larger screens */
@media (min-width: 480px) {
.score {
font-size: 4.5rem;
}
}
@media (min-width: 768px) {
.gameTitle {
font-size: 1.25rem;
}
.playerName {
font-size: 1.5rem;
}
.winnerBadge {
font-size: 1.25rem;
}
.score {
font-size: 6rem;
}
}
@media (min-width: 1024px) {
.score {
font-size: 7rem;
}
}
/* Narrow portrait — stack players */
@media (max-width: 600px) {
.scoresContainer {
flex-direction: column;
}
.score {
font-size: clamp(3rem, 20vw, 6rem);
}
}
/* Landscape phone — keep scores readable, compact chrome */
@@ -317,18 +288,17 @@
}
.gameTitle {
font-size: clamp(0.85rem, 2.2vh, 1.1rem);
font-size: 0.85rem;
}
.scoresContainer {
flex-direction: row;
gap: var(--space-xs);
flex: 1 1 0;
min-height: 0;
}
.playerScore {
padding: var(--space-xs);
min-height: 100px;
}
.playerNameRow {
@@ -336,7 +306,7 @@
}
.playerName {
font-size: clamp(0.75rem, 2.2vh, 1rem);
font-size: 0.75rem;
}
.progressBar {
@@ -346,15 +316,12 @@
}
.score {
font-size: clamp(2rem, min(36vh, 24vw), 4.5rem);
padding: 0;
flex: 1 1 0;
font-size: 2rem;
}
.gameDetailControls {
margin-top: var(--space-xs);
gap: var(--space-xs);
padding-bottom: calc(var(--space-xs) + var(--keyboard-offset));
}
.gameDetailControls > * {
@@ -363,14 +330,3 @@
flex: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.breakIndicator {
animation: none;
}
.scoreTap::after,
.scoreBump {
animation: none;
}
}
+21 -38
View File
@@ -1,9 +1,11 @@
import { h } from 'preact';
import { useEffect, useRef, useState } from 'preact/hooks';
import { useState } from 'preact/hooks';
import styles from './GameDetail.module.css';
import { Button } from '@lib/ui/Button';
import { getGameWinner, isStandardGame } from '@lib/domain/gameUtils';
import type { Game, EndlosGame } from '@lib/domain/types';
import type { Game, EndlosGame, GameSetupData } from '@lib/domain/types';
import { SetupButton } from './SetupButton';
import { GameSetupModal } from './GameSetupModal';
interface GameDetailProps {
game: Game | undefined;
@@ -13,44 +15,14 @@ interface GameDetailProps {
onUndo?: () => void;
onForfeit?: () => void;
onBack: () => void;
}
interface AnimatedScoreProps {
value: number;
tapping: boolean;
}
function AnimatedScore({ value, tapping }: AnimatedScoreProps) {
const [bumping, setBumping] = useState(false);
const prevValue = useRef(value);
useEffect(() => {
if (prevValue.current !== value) {
setBumping(true);
const timer = window.setTimeout(() => setBumping(false), 250);
prevValue.current = value;
return () => window.clearTimeout(timer);
}
}, [value]);
const className = [
styles.score,
tapping ? styles.scoreTap : '',
bumping ? styles.scoreBump : '',
].filter(Boolean).join(' ');
return (
<span className={className} aria-hidden="true">
{value}
</span>
);
onUpdateGameSetup?: (setupData: GameSetupData) => void;
}
/**
* Game detail view for a single game.
*/
const GameDetail = ({ game, onFinishGame, onUpdateScore, onUndo, onBack }: GameDetailProps) => {
const [tappingPlayer, setTappingPlayer] = useState<number | null>(null);
const GameDetail = ({ game, onFinishGame, onUpdateScore, onUndo, onBack, onUpdateGameSetup }: GameDetailProps) => {
const [setupOpen, setSetupOpen] = useState(false);
if (!game || !isStandardGame(game)) return null;
@@ -103,8 +75,6 @@ const GameDetail = ({ game, onFinishGame, onUpdateScore, onUndo, onBack }: GameD
const handleScore = () => {
if (isCompleted) return;
setTappingPlayer(idx);
window.setTimeout(() => setTappingPlayer((current) => (current === idx ? null : current)), 350);
onUpdateScore(idx + 1, 1);
};
@@ -148,12 +118,25 @@ const GameDetail = ({ game, onFinishGame, onUpdateScore, onUndo, onBack }: GameD
</div>
)}
<AnimatedScore value={currentScore} tapping={tappingPlayer === idx} />
<span className={styles.score} aria-hidden="true">
{currentScore}
</span>
</div>
);
})}
</div>
<SetupButton onClick={() => setSetupOpen(true)} disabled={isCompleted} />
<GameSetupModal
game={standardGame}
open={setupOpen}
onSave={(data) => {
onUpdateGameSetup?.(data);
setSetupOpen(false);
}}
onCancel={() => setSetupOpen(false)}
/>
<div className={styles.gameDetailControls}>
<Button variant="secondary" size="medium" onClick={onBack} aria-label="Zurück zur Liste">
Zurück
@@ -0,0 +1,139 @@
.modalContent {
/* Inherits width/max-width/max-height/scroll from base Modal.module.css */
}
.section {
margin-bottom: var(--space-lg);
}
.sectionTitle {
display: block;
margin-bottom: var(--space-sm);
font-size: var(--font-size-lg);
font-weight: 600;
color: var(--color-text);
}
.playerRow {
display: flex;
flex-direction: column;
gap: var(--space-sm);
margin-bottom: var(--space-md);
padding: var(--space-md);
border: 2px solid var(--color-border);
border-radius: var(--radius-md);
background: var(--color-background);
}
.playerRow:focus-within {
border-color: var(--color-primary);
}
.fieldRow {
display: flex;
flex-wrap: wrap;
gap: var(--space-sm);
align-items: center;
}
.textInput,
.numberInput {
flex: 1 1 140px;
min-height: var(--touch-target-comfortable);
padding: var(--space-md);
border: 2px solid var(--color-border);
border-radius: var(--radius-md);
background: var(--color-surface);
color: var(--color-text);
font-size: var(--font-size-base);
font-family: inherit;
}
.textInput:focus,
.numberInput:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-light);
}
.numberInput {
flex: 0 1 100px;
max-width: 120px;
}
.choiceRow {
display: flex;
flex-wrap: wrap;
gap: var(--space-sm);
}
.choiceBtn {
min-width: 72px;
min-height: var(--touch-target-comfortable);
padding: var(--space-md) var(--space-lg);
border: 2px solid var(--color-border);
border-radius: var(--radius-md);
background: var(--color-secondary);
color: var(--color-text);
font-size: var(--font-size-base);
font-weight: 600;
font-family: inherit;
cursor: pointer;
touch-action: manipulation;
}
.choiceBtn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.choiceBtnSelected {
border-color: var(--color-primary);
background: var(--color-primary-light);
color: var(--color-text);
}
.raceGrid {
display: flex;
flex-wrap: wrap;
gap: var(--space-sm);
}
.endlosRow {
margin-bottom: var(--space-sm);
}
.togglePlayerBtn {
width: 100%;
min-height: var(--touch-target-comfortable);
margin-bottom: var(--space-md);
}
.errors {
color: var(--color-danger);
background: var(--color-surface);
border: 1px solid var(--color-danger);
border-radius: var(--radius-md);
padding: var(--space-md);
margin-bottom: var(--space-md);
font-size: var(--font-size-sm);
}
.errors ul {
margin: 0;
padding-left: var(--space-lg);
}
.footerActions {
display: flex;
flex-direction: column;
gap: var(--space-md);
width: 100%;
}
@media (min-width: 480px) {
.footerActions {
flex-direction: row;
justify-content: flex-end;
}
}
@@ -0,0 +1,358 @@
import { h } from 'preact';
import { useEffect, useState } from 'preact/hooks';
import modalStyles from '@lib/ui/Modal.module.css';
import styles from './GameSetupModal.module.css';
import { Button } from '@lib/ui/Button';
import { GAME_TYPES, RACE_TO_INFINITY, RACE_TO_QUICK_PICKS } from '@lib/domain/constants';
import { gameToSetupData } from '@lib/domain/gameUtils';
import { validateGameSetupData } from '@lib/domain/validation';
import type { BreakRule, GameSetupData, GameType, StandardGame } from '@lib/domain/types';
interface GameSetupModalProps {
game: StandardGame;
open: boolean;
onSave: (setupData: GameSetupData) => void;
onCancel: () => void;
}
type RaceToState = number | typeof RACE_TO_INFINITY;
interface FormState {
player1: string;
player2: string;
player3: string;
hasPlayer3: boolean;
score1: number;
score2: number;
score3: number;
gameType: GameType;
raceTo: RaceToState;
raceToInput: string;
breakRule: BreakRule;
breakOrder: number[];
currentBreakerIdx: number;
}
function setupToFormState(setup: GameSetupData): FormState {
const hasPlayer3 = Boolean(setup.player3?.trim());
const raceToIsInfinity = setup.raceTo === Infinity;
return {
player1: setup.player1,
player2: setup.player2,
player3: setup.player3 ?? '',
hasPlayer3,
score1: setup.score1,
score2: setup.score2,
score3: setup.score3 ?? 0,
gameType: setup.gameType,
raceTo: raceToIsInfinity ? RACE_TO_INFINITY : setup.raceTo,
raceToInput: raceToIsInfinity ? '' : String(setup.raceTo),
breakRule: setup.breakRule,
breakOrder: [...setup.breakOrder],
currentBreakerIdx: setup.currentBreakerIdx,
};
}
function parseRaceToValue(raceTo: RaceToState, raceToInput: string): number {
if (raceTo === RACE_TO_INFINITY) return Infinity;
if (typeof raceTo === 'number' && Number.isFinite(raceTo)) return raceTo;
const parsed = parseInt(raceToInput, 10);
return Number.isFinite(parsed) ? parsed : 0;
}
function formToSetupData(form: FormState): GameSetupData {
const data: GameSetupData = {
player1: form.player1,
player2: form.player2,
score1: form.score1,
score2: form.score2,
gameType: form.gameType,
raceTo: parseRaceToValue(form.raceTo, form.raceToInput),
breakRule: form.breakRule,
breakOrder: form.breakOrder,
currentBreakerIdx: form.currentBreakerIdx,
};
if (form.hasPlayer3) {
data.player3 = form.player3;
data.score3 = form.score3;
}
return data;
}
function choiceClass(selected: boolean): string {
return `${styles.choiceBtn} ${selected ? styles.choiceBtnSelected : ''}`;
}
export function GameSetupModal({ game, open, onSave, onCancel }: GameSetupModalProps) {
const [form, setForm] = useState<FormState>(() => setupToFormState(gameToSetupData(game)));
const [errors, setErrors] = useState<string[]>([]);
useEffect(() => {
if (open) {
setForm(setupToFormState(gameToSetupData(game)));
setErrors([]);
}
}, [open, game]);
if (!open) return null;
const activeBreakerPlayer = form.breakOrder[form.currentBreakerIdx] ?? form.breakOrder[0];
const playerLabels = [
{ num: 1, name: form.player1, score: form.score1 },
{ num: 2, name: form.player2, score: form.score2 },
...(form.hasPlayer3 ? [{ num: 3, name: form.player3, score: form.score3 }] : []),
];
const updateForm = (patch: Partial<FormState>) => setForm((prev) => ({ ...prev, ...patch }));
const togglePlayer3 = () => {
if (form.hasPlayer3) {
const order = [1, 2];
let idx = form.currentBreakerIdx;
const currentPlayer = form.breakOrder[idx];
if (currentPlayer === 3) idx = 0;
else idx = Math.min(idx, order.length - 1);
updateForm({
hasPlayer3: false,
player3: '',
score3: 0,
breakOrder: order,
currentBreakerIdx: idx,
});
} else {
const order = [1, 2, 3];
updateForm({
hasPlayer3: true,
player3: 'Spieler 3',
score3: 0,
breakOrder: order,
currentBreakerIdx: Math.min(form.currentBreakerIdx, order.length - 1),
});
}
};
const selectBreaker = (playerNum: number) => {
const idx = form.breakOrder.indexOf(playerNum);
if (idx >= 0) updateForm({ currentBreakerIdx: idx });
};
const handleRaceQuickPick = (value: number) => {
updateForm({ raceTo: value, raceToInput: String(value) });
};
const handleRaceInfinity = () => {
updateForm({ raceTo: RACE_TO_INFINITY, raceToInput: '' });
};
const handleRaceInput = (e: Event) => {
const value = (e.target as HTMLInputElement).value;
const parsed = parseInt(value, 10);
if (value === '') {
updateForm({ raceToInput: '', raceTo: 0 });
return;
}
if (!Number.isNaN(parsed)) {
updateForm({ raceToInput: value, raceTo: parsed });
}
};
const handleSave = () => {
const data = formToSetupData(form);
const result = validateGameSetupData(data);
if (!result.isValid) {
setErrors(result.errors);
return;
}
setErrors([]);
onSave(data);
};
const raceToNumber =
form.raceTo === RACE_TO_INFINITY ? null : typeof form.raceTo === 'number' ? form.raceTo : parseInt(form.raceToInput, 10);
return (
<div
className={`${modalStyles.modal} ${modalStyles.show}`}
role="dialog"
aria-modal="true"
aria-labelledby="game-setup-modal-title"
>
<div className={`${modalStyles['modal-content']} ${styles.modalContent}`}>
<div className={modalStyles['modal-header']}>
<span className={modalStyles['modal-title']} id="game-setup-modal-title">
Spiel einrichten
</span>
<button
type="button"
className={modalStyles['close-button']}
onClick={onCancel}
aria-label="Schließen"
>
×
</button>
</div>
<div className={modalStyles['modal-body']}>
<Button
variant="secondary"
size="medium"
className={styles.togglePlayerBtn}
onClick={togglePlayer3}
type="button"
>
{form.hasPlayer3 ? '3. Spieler entfernen' : '3. Spieler hinzufügen'}
</Button>
{playerLabels.map(({ num, name, score }) => (
<div key={num} className={styles.playerRow}>
<span className={styles.sectionTitle}>Spieler {num}</span>
<div className={styles.fieldRow}>
<input
type="text"
className={styles.textInput}
value={num === 1 ? form.player1 : num === 2 ? form.player2 : form.player3}
onInput={(e) => {
const v = (e.target as HTMLInputElement).value;
if (num === 1) updateForm({ player1: v });
else if (num === 2) updateForm({ player2: v });
else updateForm({ player3: v });
}}
aria-label={`Name Spieler ${num}`}
autoComplete="off"
/>
<input
type="number"
min={0}
step={1}
inputMode="numeric"
className={styles.numberInput}
value={score}
onInput={(e) => {
const v = parseInt((e.target as HTMLInputElement).value, 10);
const safe = Number.isNaN(v) ? 0 : Math.max(0, v);
if (num === 1) updateForm({ score1: safe });
else if (num === 2) updateForm({ score2: safe });
else updateForm({ score3: safe });
}}
aria-label={`Punkte Spieler ${num}`}
/>
</div>
</div>
))}
<section className={styles.section} aria-labelledby="setup-game-type">
<span className={styles.sectionTitle} id="setup-game-type">Spieltyp</span>
<div className={styles.choiceRow}>
{GAME_TYPES.map(({ value, label }) => (
<button
key={value}
type="button"
className={choiceClass(form.gameType === value)}
onClick={() => updateForm({ gameType: value })}
>
{label}
</button>
))}
</div>
</section>
<section className={styles.section} aria-labelledby="setup-race-to">
<span className={styles.sectionTitle} id="setup-race-to">Race To</span>
<div className={styles.endlosRow}>
<button
type="button"
className={choiceClass(form.raceTo === RACE_TO_INFINITY)}
onClick={handleRaceInfinity}
>
Endlos
</button>
</div>
<div className={styles.raceGrid}>
{RACE_TO_QUICK_PICKS.map((value) => (
<button
key={value}
type="button"
className={choiceClass(raceToNumber === value)}
onClick={() => handleRaceQuickPick(value)}
>
{value}
</button>
))}
</div>
<div className={styles.fieldRow} style={{ marginTop: 'var(--space-sm)' }}>
<input
type="number"
min={1}
step={1}
inputMode="numeric"
className={styles.textInput}
value={form.raceTo === RACE_TO_INFINITY ? '' : form.raceToInput}
onInput={handleRaceInput}
placeholder="Eigener Wert"
aria-label="Race To manuelle Eingabe"
/>
</div>
</section>
<section className={styles.section} aria-labelledby="setup-break-rule">
<span className={styles.sectionTitle} id="setup-break-rule">Break-Regel</span>
<div className={styles.choiceRow}>
{(
[
{ key: 'winnerbreak' as BreakRule, label: 'Winnerbreak' },
{ key: 'wechselbreak' as BreakRule, label: 'Wechselbreak' },
] as const
).map((opt) => (
<button
key={opt.key}
type="button"
className={choiceClass(form.breakRule === opt.key)}
onClick={() => updateForm({ breakRule: opt.key })}
>
{opt.label}
</button>
))}
</div>
</section>
<section className={styles.section} aria-labelledby="setup-breaker">
<span className={styles.sectionTitle} id="setup-breaker">Wer breakt?</span>
<div className={styles.choiceRow}>
{playerLabels.map(({ num, name }) => (
<button
key={num}
type="button"
className={choiceClass(activeBreakerPlayer === num)}
onClick={() => selectBreaker(num)}
>
{name.trim() || `Spieler ${num}`}
</button>
))}
</div>
</section>
{errors.length > 0 && (
<div className={styles.errors} role="alert">
<ul>
{errors.map((err) => (
<li key={err}>{err}</li>
))}
</ul>
</div>
)}
</div>
<div className={modalStyles['modal-footer']}>
<div className={styles.footerActions}>
<Button variant="secondary" size="large" onClick={onCancel} type="button">
Abbrechen
</Button>
<Button variant="primary" size="large" onClick={handleSave} type="button">
Übernehmen
</Button>
</div>
</div>
</div>
</div>
);
}
@@ -0,0 +1,52 @@
/* SetupButton — bottom-left; mirrors FullscreenToggle placement */
.setupButton {
position: absolute;
bottom: calc(var(--space-md) + var(--safe-area-bottom));
left: calc(var(--space-md) + var(--safe-area-left));
width: var(--touch-target-comfortable);
height: var(--touch-target-comfortable);
border-radius: 50%;
background-color: var(--color-secondary);
border: 2px solid var(--color-border);
color: var(--color-primary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-md);
z-index: 9999;
transition: background-color var(--transition-base), opacity var(--transition-base);
touch-action: manipulation;
}
.setupButton:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.setupButton:active:not(:disabled) {
opacity: 0.8;
background-color: var(--color-secondary-hover);
}
.setupButton:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.setupButton svg {
width: 24px;
height: 24px;
}
@media (min-width: 768px) {
.setupButton {
width: var(--touch-target-large);
height: var(--touch-target-large);
}
.setupButton svg {
width: 28px;
height: 28px;
}
}
@@ -0,0 +1,28 @@
import { h } from 'preact';
import styles from './SetupButton.module.css';
interface SetupButtonProps {
onClick: () => void;
disabled?: boolean;
}
export function SetupButton({ onClick, disabled }: SetupButtonProps) {
return (
<button
type="button"
className={styles.setupButton}
onClick={onClick}
disabled={disabled}
title="Spiel einrichten"
aria-label="Spiel einrichten"
>
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
<path
fill="currentColor"
d="M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"
/>
</svg>
<span className="sr-only">Spiel einrichten</span>
</button>
);
}
@@ -5,7 +5,10 @@
.confetti {
position: absolute;
inset: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
overflow: hidden;
z-index: 1;
@@ -18,8 +21,6 @@
height: 8px;
border-radius: 2px;
opacity: 0;
animation: confettiFall 1.5s ease-out forwards;
animation-delay: calc(var(--i, 0) * 0.06s);
left: calc(8% + var(--i, 0) * 7%);
}
@@ -38,7 +39,6 @@
@keyframes confettiFall {
0% {
opacity: 1;
transform: translateY(0) rotate(0deg) scale(1);
}
100% {
opacity: 0;
@@ -81,7 +81,7 @@
}
.finalScore .score {
font-size: clamp(1.75rem, 5vw, 2.5rem);
font-size: 1.75rem;
font-weight: 800;
color: var(--color-primary);
font-variant-numeric: tabular-nums;
@@ -91,33 +91,22 @@
text-align: center;
margin-top: var(--space-lg);
padding: var(--space-xl) var(--space-lg);
background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
background: var(--color-primary);
border-radius: var(--radius-lg);
color: #1a1a1a;
font-weight: 700;
box-shadow: var(--shadow-md), 0 0 24px rgba(255, 152, 0, 0.35);
box-shadow: var(--shadow-md);
position: relative;
z-index: 2;
animation: winnerGlow 2s ease-in-out infinite;
}
@keyframes winnerGlow {
0%, 100% {
box-shadow: var(--shadow-md), 0 0 20px rgba(255, 152, 0, 0.3);
}
50% {
box-shadow: var(--shadow-md), 0 0 32px rgba(255, 152, 0, 0.55);
}
}
.winnerAnnouncement h3 {
margin: 0;
font-size: clamp(1.1rem, 3vw, 1.6rem);
font-size: 1.1rem;
color: #1a1a1a;
text-align: center;
font-weight: 800;
line-height: 1.3;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}
.modalActions {
@@ -139,14 +128,18 @@
flex: 1;
min-width: 120px;
}
.finalScore .score {
font-size: 2.5rem;
}
.winnerAnnouncement h3 {
font-size: 1.6rem;
}
}
@media (prefers-reduced-motion: reduce) {
.confettiPiece {
display: none;
}
.winnerAnnouncement {
animation: none;
}
}
+5 -25
View File
@@ -2,7 +2,6 @@
width: 100%;
display: flex;
flex-direction: column;
min-height: 0;
flex: 1;
}
@@ -21,7 +20,7 @@
.filterButtons > * {
flex: 1 1 auto;
min-width: min(160px, calc(50% - var(--space-sm)));
min-width: 120px;
min-height: var(--touch-target-large);
}
@@ -31,10 +30,8 @@
flex-direction: column;
gap: var(--space-md);
flex: 1;
overflow-y: auto;
overflow-x: hidden;
overflow: visible;
min-height: 0;
padding-bottom: calc(var(--space-md) + var(--keyboard-offset));
-webkit-overflow-scrolling: touch;
}
@@ -49,7 +46,7 @@
}
.gameItem:active {
transform: scale(0.99);
opacity: 0.92;
}
.gameItem.active {
@@ -103,12 +100,6 @@
height: 10px;
border-radius: 50%;
background: #fff;
animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.5; transform: scale(0.85); }
}
.statusActive {
@@ -162,7 +153,7 @@
padding: var(--space-xxl) var(--space-lg);
color: var(--color-text-muted);
font-size: var(--font-size-lg);
background: linear-gradient(180deg, #2a2a2a 0%, var(--color-surface) 100%);
background: var(--color-surface);
border-radius: var(--radius-lg);
border: 2px dashed var(--color-border);
width: 100%;
@@ -172,7 +163,6 @@
font-size: 3rem;
line-height: 1;
margin-bottom: var(--space-md);
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}
.emptyHint {
@@ -211,7 +201,7 @@
}
.filterButtons > * {
min-width: calc(33% - var(--space-sm));
min-width: 100px;
}
.deleteWrapper {
@@ -222,13 +212,3 @@
width: 100% !important;
}
}
@media (prefers-reduced-motion: reduce) {
.liveDot {
animation: none;
}
.gameItem:active {
transform: none;
}
}
+118 -199
View File
@@ -1,42 +1,22 @@
/* NewGame-specific styles only. Shared utility classes are now in global CSS. */
.screen {
position: absolute;
top: 0;
left: 0;
width: 100%;
min-height: var(--app-height);
display: none;
opacity: 0;
transform: translateX(100%);
transition: transform var(--transition-slow), opacity var(--transition-slow);
}
.screen-content {
display: flex;
flex-direction: column;
height: 100%;
padding: var(--space-lg);
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
min-height: 0;
}
.screen-title {
font-size: clamp(1.25rem, 3vh, 1.5rem);
font-size: 1.25rem;
font-weight: 700;
color: var(--color-text);
margin-bottom: clamp(0.5rem, 2vh, 2rem);
margin-bottom: 1rem;
letter-spacing: 0.5px;
text-align: center;
}
.player-inputs {
display: flex;
flex-direction: column;
gap: var(--space-lg);
width: 100%;
margin-bottom: var(--space-xl);
flex-shrink: 1;
min-height: 0;
}
.player-input {
background: var(--color-background);
border-radius: var(--radius-md);
@@ -45,25 +25,28 @@
transition: border-color var(--transition-base);
position: relative;
flex-shrink: 1;
min-height: 0;
overflow: hidden;
}
.player-input:focus-within {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-light);
}
.player-input label {
display: block;
margin-bottom: clamp(0.5rem, 2vh, 1rem);
margin-bottom: var(--space-md);
color: var(--color-text);
font-size: clamp(1rem, 2.5vh, 1.125rem);
font-size: var(--font-size-base);
font-weight: 600;
}
.name-input-container {
display: flex;
gap: var(--space-md);
position: relative;
}
.name-input {
flex: 1;
padding: var(--space-md);
@@ -73,21 +56,25 @@
font-size: var(--font-size-base);
min-height: var(--touch-target-comfortable);
border-radius: var(--radius-md);
transition: all var(--transition-base);
transition: border-color var(--transition-base);
}
.name-input:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-light);
}
.game-settings {
margin-top: 0;
width: 100%;
margin-bottom: var(--space-xl);
}
.setting-group {
margin-bottom: var(--space-lg);
}
.setting-group label {
display: block;
margin-bottom: var(--space-md);
@@ -95,6 +82,7 @@
font-size: var(--font-size-lg);
font-weight: 600;
}
.setting-group select, .setting-group input {
width: 100%;
padding: var(--space-md);
@@ -106,11 +94,13 @@
border-radius: var(--radius-md);
transition: border-color var(--transition-base);
}
.setting-group input:focus, .setting-group select:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-light);
}
.validation-error {
color: var(--color-danger);
background: var(--color-surface);
@@ -122,128 +112,51 @@
text-align: center;
font-weight: 500;
}
/* NewGame-specific styles only. Shared utility classes are now in global CSS. */
.wizardShell {
flex: 1;
display: flex;
align-items: stretch;
justify-content: center;
display: block;
width: 100%;
min-height: 0;
max-height: 100%;
overflow: hidden;
padding: var(--space-sm) 0;
}
.new-game-form {
width: min(94vw, 720px);
max-height: 100%;
width: 100%;
max-width: 720px;
margin: 0 auto;
background: linear-gradient(180deg, #2a2a2a 0%, var(--color-surface) 100%);
background: var(--color-surface);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
border: 1px solid var(--color-border);
padding: 0;
display: flex;
flex-direction: column;
border: 1px solid var(--color-border);
flex-shrink: 1;
min-height: 0;
overflow: hidden;
animation: wizardStepIn var(--transition-slow) ease-out;
}
/* Per-step wizard backgrounds — visually distinct per step */
.new-game-form.step-player1 {
background: linear-gradient(180deg, #3a5a3d 0%, #2e4631 100%);
border-color: rgba(255, 255, 255, 0.12);
}
.new-game-form.step-player2 {
background: linear-gradient(180deg, #354d6a 0%, #2a3b52 100%);
border-color: rgba(255, 255, 255, 0.12);
}
.new-game-form.step-player3 {
background: linear-gradient(180deg, #444 0%, #333 100%);
border-color: rgba(255, 255, 255, 0.12);
}
.new-game-form.step-gameType {
background: linear-gradient(180deg, #5a2323 0%, #4a1c1c 100%);
border-color: rgba(255, 255, 255, 0.12);
}
.new-game-form.step-raceTo {
background: linear-gradient(180deg, #3d245e 0%, #2d1b4e 100%);
border-color: rgba(255, 255, 255, 0.12);
}
.new-game-form.step-breakRule {
background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
border-color: rgba(255, 255, 255, 0.12);
}
.new-game-form.step-breakOrder {
background: linear-gradient(180deg, #5a3a10 0%, #3d260a 100%);
border-color: rgba(255, 152, 0, 0.25);
}
.new-game-form[class*="step-"] .form-footer {
background: rgba(0, 0, 0, 0.35);
border-top-color: rgba(255, 255, 255, 0.12);
}
.new-game-form[class*="step-"] .wizard-summary {
background: rgba(0, 0, 0, 0.35);
border-color: rgba(255, 255, 255, 0.15);
}
.new-game-form[class*="step-"] .screen-title {
color: #fff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.new-game-form[class*="step-"] .player-input {
background: rgba(0, 0, 0, 0.25);
border-color: rgba(255, 255, 255, 0.15);
}
.new-game-form[class*="step-"] .name-input,
.new-game-form[class*="step-"] .game-type-btn,
.new-game-form[class*="step-"] .race-to-btn,
.new-game-form[class*="step-"] .quick-pick-btn {
background: rgba(0, 0, 0, 0.3);
border-color: rgba(255, 255, 255, 0.15);
}
@keyframes wizardStepIn {
from {
opacity: 0;
transform: translateX(12px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* Step class placeholders are kept so NewGameScreen can still pass them. */
.step-player1 {}
.step-player2 {}
.step-player3 {}
.step-gameType {}
.step-raceTo {}
.step-breakRule {}
.step-breakOrder {}
.form-header {
flex-shrink: 0;
padding: clamp(0.4rem, 1.5vh, 1.25rem) var(--space-lg) clamp(0.2rem, 0.8vh, 0.75rem) var(--space-lg);
padding: var(--space-sm) var(--space-lg);
}
.wizard-summary {
margin-top: clamp(0.25rem, 0.8vh, 0.5rem);
margin-bottom: clamp(0.25rem, 0.8vh, 0.5rem);
padding: clamp(0.5rem, 1.2vh, 0.75rem) var(--space-md);
background: rgba(0, 0, 0, 0.25);
margin-top: var(--space-xs);
margin-bottom: var(--space-xs);
padding: var(--space-sm) var(--space-md);
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
}
.wizard-summary-hint {
margin: 0;
font-size: clamp(0.85rem, 2.2vw, 0.95rem);
font-size: var(--font-size-sm);
line-height: 1.35;
color: var(--color-text-muted, #aaa);
}
@@ -252,7 +165,7 @@
margin: 0;
display: flex;
flex-direction: column;
gap: clamp(0.2rem, 0.6vh, 0.35rem);
gap: var(--space-xs);
}
.wizard-summary-row {
@@ -266,7 +179,7 @@
.wizard-summary-label {
margin: 0;
flex: 0 0 auto;
font-size: clamp(0.8rem, 2vw, 0.9rem);
font-size: var(--font-size-sm);
font-weight: 600;
color: var(--color-text-muted, #aaa);
text-transform: none;
@@ -275,7 +188,7 @@
.wizard-summary-value {
margin: 0;
flex: 1 1 auto;
font-size: clamp(0.95rem, 2.5vw, 1.05rem);
font-size: var(--font-size-base);
line-height: 1.35;
color: var(--color-text, #eee);
font-weight: 500;
@@ -283,51 +196,49 @@
.form-content {
flex: 1;
overflow-y: auto;
overscroll-behavior: contain;
overflow: visible;
padding: 0 var(--space-lg);
padding-bottom: var(--space-sm);
min-height: 0;
display: flex;
flex-direction: column;
}
.form-footer {
flex-shrink: 0;
position: sticky;
bottom: 0;
z-index: 2;
position: static;
background: var(--color-surface);
padding: var(--space-sm) var(--space-lg) calc(var(--space-sm) + var(--safe-area-bottom) + var(--keyboard-offset)) var(--space-lg);
padding: var(--space-sm) var(--space-lg) calc(var(--space-sm) + var(--safe-area-bottom));
border-top: 1px solid var(--color-border);
}
.progress-indicator {
display: flex;
justify-content: center;
align-items: center;
gap: clamp(0.5rem, 1.5vw, 1rem);
margin-bottom: clamp(0.5rem, 2vh, 1.5rem);
gap: var(--space-sm);
margin-bottom: var(--space-md);
}
.progress-dot {
width: clamp(12px, 2vh, 18px);
height: clamp(12px, 2vh, 18px);
width: 14px;
height: 14px;
border-radius: 50%;
background: var(--color-border);
opacity: 0.4;
transition: background var(--transition-slow), opacity var(--transition-slow), transform var(--transition-slow), box-shadow var(--transition-slow);
transition: background var(--transition-slow), opacity var(--transition-slow);
position: relative;
}
.progress-dot.completed {
background: var(--color-primary);
opacity: 0.55;
transform: scale(0.9);
}
.progress-dot.active {
background: var(--color-primary);
opacity: 1;
transform: scale(1.25);
box-shadow: 0 0 0 4px var(--color-primary-light), 0 0 12px rgba(255, 152, 0, 0.4);
}
.quick-pick-container {
flex: 1;
overflow: hidden;
@@ -346,27 +257,26 @@
border: 2px solid var(--color-border);
cursor: pointer;
padding: var(--space-md) var(--space-lg);
transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
transition: border-color var(--transition-base), background-color var(--transition-base);
font-weight: 600;
font-family: inherit;
flex-shrink: 0;
touch-action: manipulation;
}
.quick-pick-btn:active:not(.selected) {
transform: scale(0.97);
}
.quick-pick-btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
border-color: var(--color-primary);
}
.choice-btn {
min-width: 160px;
min-height: var(--touch-target-large);
font-size: var(--font-size-lg);
flex: 1;
}
.arrow-nav {
display: flex;
justify-content: space-between;
@@ -375,11 +285,13 @@
width: 100%;
gap: var(--space-sm);
}
.arrow-nav-actions {
display: flex;
align-items: center;
gap: var(--space-md);
}
.arrow-btn {
font-size: 28px;
width: var(--touch-target-comfortable);
@@ -399,18 +311,22 @@
touch-action: manipulation;
flex-shrink: 0;
}
.arrow-btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.arrow-btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
border-color: var(--color-primary);
}
.arrow-btn:active:not(:disabled) {
background: var(--color-secondary-hover);
}
.clear-input-btn {
position: absolute;
right: var(--space-sm);
@@ -431,6 +347,7 @@
align-items: center;
justify-content: center;
}
.clear-input-btn:focus-visible {
color: var(--color-text);
background: var(--color-secondary);
@@ -442,26 +359,31 @@
color: var(--color-text);
background: var(--color-secondary-hover);
}
.name-input-wrapper {
position: relative;
width: 100%;
}
.character-counter {
font-size: 0.875rem;
margin-top: 4px;
text-align: right;
}
.quick-picks-row {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 4px;
}
.quick-pick-action-btn {
background: var(--color-primary);
border-color: var(--color-primary);
color: #fff;
}
.quick-pick-action-btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
@@ -471,19 +393,23 @@
background: var(--color-primary-hover);
border-color: var(--color-primary-hover);
}
.quick-pick-actions-separator {
width: 10px;
height: 1px;
margin: 0 4px;
}
.choice-heading {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
}
.choice-heading:first-child {
margin-top: 0;
}
.game-type-selection {
display: grid;
grid-template-columns: 1fr 1fr;
@@ -491,6 +417,7 @@
width: 100%;
margin: var(--space-md) 0;
}
.game-type-btn {
background: var(--color-background);
border: 2px solid var(--color-border);
@@ -501,33 +428,37 @@
border-radius: var(--radius-lg);
cursor: pointer;
text-align: center;
transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
transition: border-color var(--transition-base), background-color var(--transition-base);
min-height: var(--touch-target-large);
font-family: inherit;
touch-action: manipulation;
}
.game-type-btn:active:not(.selected) {
transform: scale(0.97);
}
.game-type-btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.game-type-btn.selected {
background: var(--color-primary);
border-color: var(--color-primary);
color: #fff;
box-shadow: var(--shadow-md), 0 0 0 3px var(--color-primary-light);
transform: scale(1.03);
}
.race-to-selection {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
display: flex;
flex-wrap: wrap;
gap: var(--space-md);
width: 100%;
margin: var(--space-md) 0;
}
.race-to-selection .race-to-btn {
flex: 1 1 calc(25% - var(--space-md));
min-width: 72px;
}
.race-to-btn {
background: var(--color-background);
border: 2px solid var(--color-border);
@@ -538,7 +469,7 @@
border-radius: var(--radius-lg);
cursor: pointer;
text-align: center;
transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
transition: border-color var(--transition-base), background-color var(--transition-base);
min-height: var(--touch-target-large);
display: flex;
align-items: center;
@@ -546,21 +477,19 @@
font-family: inherit;
touch-action: manipulation;
}
.race-to-btn:active:not(.selected) {
transform: scale(0.97);
}
.race-to-btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.race-to-btn.selected {
background: var(--color-primary);
border-color: var(--color-primary);
color: #fff;
box-shadow: var(--shadow-md), 0 0 0 3px var(--color-primary-light);
transform: scale(1.03);
}
/* Match selected styling for quick pick buttons used in BreakRuleStep */
.quick-pick-btn.selected {
background: var(--color-primary);
@@ -568,88 +497,88 @@
color: #fff;
box-shadow: var(--shadow-md), 0 0 0 3px var(--color-primary-light);
font-weight: 700;
transform: scale(1.02);
}
.custom-race-to {
display: flex;
gap: var(--space-md);
margin-top: var(--space-lg);
align-items: center;
}
.custom-race-to input {
flex-grow: 1;
}
.custom-race-to .arrow-btn {
width: 60px;
height: 60px;
font-size: 32px;
flex-shrink: 0;
}
.endlos-container {
width: 100%;
margin-bottom: 12px;
}
.endlos-btn {
width: 100%;
}
.player1-input.player-input,
.player2-input.player-input,
.player3-input.player-input {
border-color: var(--color-border);
background: var(--color-surface);
}
@media (min-width: 768px) and (max-width: 1024px) {
.wizardShell {
padding: var(--space-md) 0;
}
.new-game-form {
min-height: min(82vh, 680px);
max-height: 100%;
}
.screen-title {
font-size: var(--font-size-xxxl);
}
.arrow-btn {
width: 56px;
height: 56px;
font-size: 34px;
}
.game-type-btn,
.race-to-btn {
padding: var(--space-xl);
font-size: var(--font-size-xl);
min-height: var(--touch-target-comfortable);
}
.quick-pick-btn {
min-height: var(--touch-target-comfortable);
font-size: var(--font-size-lg);
padding: var(--space-md) var(--space-lg);
}
}
@media (min-height: 720px) {
.new-game-form {
min-height: min(88vh, 720px);
}
}
@media (max-width: 767px) {
.wizardShell {
padding: var(--space-xs) 0;
align-items: stretch;
}
.new-game-form {
width: min(96vw, 720px);
min-height: 0;
max-height: 100%;
}
.game-type-selection {
grid-template-columns: 1fr;
}
.race-to-selection {
grid-template-columns: repeat(3, 1fr);
}
.arrow-nav {
gap: var(--space-md);
}
.arrow-btn {
width: var(--touch-target-min);
height: var(--touch-target-min);
@@ -657,60 +586,50 @@
}
}
@media (prefers-reduced-motion: reduce) {
.new-game-form {
animation: none;
}
.game-type-btn.selected,
.race-to-btn.selected,
.quick-pick-btn.selected {
transform: none;
}
}
@media (max-height: 560px) {
.screen-title {
margin-bottom: 0.35rem;
}
.progress-indicator {
margin-bottom: 0.35rem;
}
.wizard-summary {
padding: 0.35rem var(--space-sm);
margin-bottom: 0.25rem;
}
.wizard-summary-value {
font-size: clamp(0.9rem, 2.2vw, 1rem);
font-size: var(--font-size-base);
}
.player-input {
padding: var(--space-sm);
}
.form-header {
padding-top: 0.4rem;
padding-bottom: 0.3rem;
}
.form-footer {
padding-top: 0.3rem;
padding-bottom: calc(0.35rem + var(--safe-area-bottom) + var(--keyboard-offset));
padding-bottom: calc(0.35rem + var(--safe-area-bottom));
}
}
@media (max-height: 500px) {
.wizardShell {
padding: 0;
}
.new-game-form {
min-height: 0;
max-height: 100%;
width: min(98vw, 720px);
}
.form-header {
padding: var(--space-xs) var(--space-md) var(--space-xs);
padding: var(--space-xs) var(--space-md);
}
.screen-title {
font-size: clamp(1rem, 3.5vh, 1.25rem);
font-size: 1rem;
margin-bottom: 0.25rem;
}
@@ -723,7 +642,7 @@
.choice-heading {
margin-top: 0.5rem;
margin-bottom: 0.35rem;
font-size: clamp(0.95rem, 3vh, 1.1rem);
font-size: 1rem;
}
.quick-picks-row {
@@ -737,6 +656,6 @@
}
.form-footer {
padding: var(--space-xs) var(--space-md) calc(var(--space-xs) + var(--safe-area-bottom) + var(--keyboard-offset));
padding: var(--space-xs) var(--space-md) calc(var(--space-xs) + var(--safe-area-bottom));
}
}
@@ -1,6 +1,9 @@
.modalOverlay {
position: fixed;
inset: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
@@ -9,18 +12,23 @@
padding: var(--space-lg);
padding-top: calc(var(--space-lg) + var(--safe-area-top));
padding-bottom: calc(var(--space-lg) + var(--safe-area-bottom));
padding-left: calc(var(--space-lg) + var(--safe-area-left));
padding-right: calc(var(--space-lg) + var(--safe-area-right));
overflow: hidden;
}
.modalContent {
background: var(--color-surface);
padding: var(--space-xl);
border-radius: var(--radius-xl);
width: min(480px, 100%);
max-height: calc(var(--app-height) - var(--space-xl) * 2);
width: 100%;
max-width: 480px;
max-height: 90%;
box-shadow: var(--shadow-lg);
display: flex;
flex-direction: column;
border: 1px solid var(--color-border);
overflow: hidden;
}
.modalHeader {
@@ -60,7 +68,7 @@
}
.playerList {
max-height: 60vh;
max-height: 400px;
overflow-y: auto;
display: flex;
flex-direction: column;
@@ -1,6 +1,9 @@
.modalOverlay {
position: fixed;
inset: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
@@ -9,18 +12,25 @@
padding: var(--space-lg);
padding-top: calc(var(--space-lg) + var(--safe-area-top));
padding-bottom: calc(var(--space-lg) + var(--safe-area-bottom));
padding-left: calc(var(--space-lg) + var(--safe-area-left));
padding-right: calc(var(--space-lg) + var(--safe-area-right));
overflow: hidden;
}
.modalContent {
width: min(420px, 100%);
background: linear-gradient(180deg, #2a2a2a 0%, var(--color-surface) 100%);
width: 100%;
max-width: 420px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
box-shadow: var(--shadow-lg);
padding: var(--space-xl);
display: flex;
flex-direction: column;
gap: var(--space-md);
max-height: 90%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.modalTitle {
@@ -33,7 +43,7 @@
.modalInput {
width: 100%;
min-height: var(--touch-target-comfortable);
font-size: max(16px, var(--font-size-base));
font-size: 16px;
}
.modalActions {
+5 -13
View File
@@ -4,7 +4,7 @@
cursor: pointer;
font-weight: 600;
font-family: inherit;
transition: background-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast), opacity var(--transition-base);
transition: background-color var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
touch-action: manipulation;
display: inline-flex;
align-items: center;
@@ -14,7 +14,7 @@
user-select: none;
-webkit-user-select: none;
width: 100%;
box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
box-shadow: var(--shadow-sm);
}
.button:focus-visible {
@@ -23,15 +23,13 @@
}
.button:active:not(.disabled) {
transform: scale(0.97);
opacity: 0.92;
}
/* Variants */
.primary {
background: linear-gradient(180deg, #ffb74d 0%, var(--color-primary) 100%);
background: var(--color-primary);
color: #fff;
box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255, 152, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.primary:not(.disabled):active {
@@ -39,7 +37,7 @@
}
.secondary {
background: linear-gradient(180deg, #3a3a3a 0%, var(--color-secondary) 100%);
background: var(--color-secondary);
color: var(--color-text);
border: 2px solid var(--color-border);
}
@@ -49,7 +47,7 @@
}
.danger {
background: linear-gradient(180deg, #ef5350 0%, var(--color-danger) 100%);
background: var(--color-danger);
color: #fff;
}
@@ -106,9 +104,3 @@
opacity: 0.45;
cursor: not-allowed;
}
@media (prefers-reduced-motion: reduce) {
.button:active:not(.disabled) {
transform: none;
}
}
+4 -11
View File
@@ -1,8 +1,7 @@
.card {
border-radius: var(--radius-lg);
transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
background: linear-gradient(180deg, #2a2a2a 0%, var(--color-surface) 100%);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
transition: border-color var(--transition-base), box-shadow var(--transition-base);
background: var(--color-surface);
}
.default {
@@ -11,7 +10,7 @@
.elevated {
border: 1px solid var(--color-border);
box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
box-shadow: var(--shadow-md);
}
.outlined {
@@ -29,7 +28,7 @@
}
.clickable:active {
transform: scale(0.99);
opacity: 0.92;
}
.clickable:focus-visible {
@@ -52,9 +51,3 @@
.padding-large {
padding: var(--space-lg);
}
@media (prefers-reduced-motion: reduce) {
.clickable:active {
transform: none;
}
}
+11 -25
View File
@@ -1,14 +1,20 @@
.layout {
height: var(--app-height);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
background-color: var(--color-background);
color: var(--color-text);
display: flex;
flex-direction: column;
}
.content {
flex: 1;
flex: 1 1 auto;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
max-width: 1100px;
margin: 0 auto;
padding: var(--space-md);
@@ -16,33 +22,13 @@
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
.screen {
width: 100%;
height: 100%;
min-height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
animation: screenFadeIn var(--transition-slow) ease-out;
}
@keyframes screenFadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.screen {
animation: none;
}
}
@media (min-width: 768px) {
+13 -7
View File
@@ -1,8 +1,11 @@
/* Consolidated modal styles */
/* Consolidated modal styles — viewport-bound, scrollable content */
.modal {
display: none;
position: fixed;
inset: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
z-index: 1000;
padding: var(--space-lg);
@@ -22,9 +25,11 @@
background-color: var(--color-surface);
padding: var(--space-xl);
border-radius: var(--radius-xl);
width: min(500px, 100%);
max-height: calc(var(--app-height) - var(--space-xl) * 2);
width: 100%;
max-width: 500px;
max-height: 100%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
position: relative;
border: 1px solid var(--color-border);
box-shadow: var(--shadow-lg);
@@ -36,6 +41,7 @@
align-items: center;
margin-bottom: var(--space-lg);
gap: var(--space-md);
flex-shrink: 0;
}
.modal-title {
@@ -82,6 +88,7 @@
flex-direction: column;
justify-content: stretch;
gap: var(--space-md);
flex-shrink: 0;
}
@media (min-width: 480px) {
@@ -95,11 +102,10 @@
.modal-button {
min-height: var(--touch-target-large);
padding: var(--space-md) var(--space-xl);
font-size: var(--font-size-lg);
font-size: var(--font-size-base);
border: none;
border-radius: var(--radius-md);
cursor: pointer;
font-size: var(--font-size-base);
font-weight: 600;
font-family: inherit;
touch-action: manipulation;
+10 -2
View File
@@ -7,7 +7,7 @@ import App from "../components/App";
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-content">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<title>BSC Score – Live-Scoring am Billardtisch</title>
<meta name="description" content="Live-Scoring für 8-, 9- und 10-Ball am Billardtisch. Offline, schnell, ein Tipp pro Punkt.">
@@ -25,8 +25,11 @@ import App from "../components/App";
<link rel="apple-touch-icon" href="/icon-192.png">
<style>
#app-root {
height: var(--app-height, 100dvh);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
@@ -34,6 +37,11 @@ import App from "../components/App";
<body>
<div id="app-root">
<noscript>
<div style="padding: 2rem; color: #fff; text-align: center;">
BSC Score benötigt JavaScript.
</div>
</noscript>
<App client:only="preact" />
</div>
<script>
+20 -16
View File
@@ -8,15 +8,19 @@
-webkit-tap-highlight-color: transparent;
}
/* Design system tokens */
/* Design system tokens
Keep values plain; avoid CSS calc() in variable defaults where old parsers choke. */
:root {
--app-height: 100dvh;
--keyboard-offset: 0px;
/* Safe area insets */
/* Safe area insets — env() with literal px fallback */
--safe-area-top: 0px;
--safe-area-top: env(safe-area-inset-top, 0px);
--safe-area-right: 0px;
--safe-area-right: env(safe-area-inset-right, 0px);
--safe-area-bottom: 0px;
--safe-area-bottom: env(safe-area-inset-bottom, 0px);
--safe-area-left: 0px;
--safe-area-left: env(safe-area-inset-left, 0px);
/* Colors */
@@ -110,10 +114,19 @@
}
html,
body,
body {
height: 100%;
overflow: hidden;
}
#app-root {
height: var(--app-height, 100dvh);
min-height: var(--app-height, 100dvh);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: var(--color-background);
}
body {
@@ -127,14 +140,6 @@ body {
padding-top: var(--safe-area-top);
padding-left: var(--safe-area-left);
padding-right: var(--safe-area-right);
overflow: hidden;
}
#app-root {
width: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* Interactive elements — touch-friendly */
@@ -170,7 +175,7 @@ button,
input, select {
min-height: var(--touch-target-comfortable);
padding: var(--space-md);
font-size: max(16px, var(--font-size-base));
font-size: 16px;
font-family: inherit;
border: 2px solid var(--color-border);
border-radius: var(--radius-md);
@@ -227,7 +232,6 @@ input:focus-visible, select:focus-visible {
.btn:active:not(:disabled) {
opacity: 0.9;
transform: scale(0.98);
}
.btn-primary:active:not(:disabled) {
+2 -5
View File
@@ -1,7 +1,4 @@
{
"status": "failed",
"failedTests": [
"b5da854a7c119c37c9d5-8782df6f17e49724b9a2",
"1012373defdfca68178e-d28214002c7ecee79090"
]
"status": "passed",
"failedTests": []
}