refactor: consolidate game components and add toast notifications

- Remove EndlosGame support and GameDetail141.jsx component
- Add Toast notification system with CSS styling
- Refactor GameCompletionModal with enhanced styling
- Improve GameDetail component structure and styling
- Add BaseLayout.astro for consistent page structure
- Update gameService with cleaner logic
- Enhance global styles and remove unused constants
- Streamline navigation components
This commit is contained in:
Frank Schwenk
2025-10-28 16:30:39 +01:00
parent d1e1616faa
commit 8bbe3b9b70
15 changed files with 532 additions and 433 deletions

View File

@@ -42,38 +42,20 @@ export class GameService {
undoStack: [],
};
if (gameData.gameType === '14/1 endlos') {
const players = [
{ name: gameData.player1, score: 0, consecutiveFouls: 0 },
{ name: gameData.player2, score: 0, consecutiveFouls: 0 }
];
if (gameData.player3) {
players.push({ name: gameData.player3, score: 0, consecutiveFouls: 0 });
}
const standardGame: StandardGame = {
...baseGame,
player1: gameData.player1,
player2: gameData.player2,
score1: 0,
score2: 0,
};
return {
...baseGame,
players,
currentPlayer: null,
ballsOnTable: 15,
} as EndlosGame;
} else {
const standardGame: StandardGame = {
...baseGame,
player1: gameData.player1,
player2: gameData.player2,
score1: 0,
score2: 0,
};
if (gameData.player3) {
standardGame.player3 = gameData.player3;
standardGame.score3 = 0;
}
return standardGame;
if (gameData.player3) {
standardGame.player3 = gameData.player3;
standardGame.score3 = 0;
}
return standardGame;
}
/**