refactor: migrate UI to Preact components and remove legacy Astro/JS

- Replaced all .astro components with .jsx Preact components and added corresponding CSS modules.
- Updated index.astro to use the new App Preact component; removed legacy script and Astro imports.
- Deleted obsolete .astro component files and main JS logic (src/scripts/index.js, public/scripts/index.js).
- Updated astro.config.mjs for Preact integration.
- Updated package.json and package-lock.json to include @astrojs/preact and preact.
- Updated tsconfig.json for Preact JSX support.
- Refactored index.css to keep only global resets and utility styles.
- All changes relate to Gitea issue #1 (refactor to astro app).

Migrates the UI from Astro/vanilla JS to a modular Preact component architecture, removing all legacy code and aligning the project with modern best practices.
Refs #1
This commit is contained in:
Frank Schwenk
2025-06-06 11:58:29 +02:00
parent de07d6e7a2
commit 8384d08393
31 changed files with 1901 additions and 1891 deletions

View File

@@ -0,0 +1,85 @@
#game-completion-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 1000;
display: none;
justify-content: center;
align-items: center;
}
#game-completion-modal.show {
display: flex;
}
#game-completion-modal .modal-content {
background-color: #2a2a2a;
padding: 30px;
border-radius: 10px;
width: 90%;
max-width: 500px;
position: relative;
margin: auto;
transform: translateY(0);
}
.final-scores {
margin: 20px 0;
}
.final-score {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
margin-bottom: 10px;
background: #333;
border-radius: 5px;
font-size: 24px;
}
.final-score .player-name {
font-size: 24px;
font-weight: bold;
color: white;
}
.final-score .score {
font-size: 24px;
font-weight: bold;
color: white;
}
.winner-announcement {
text-align: center;
margin: 20px 0;
padding: 20px;
background: #4CAF50;
border-radius: 5px;
}
.winner-announcement h3 {
font-size: 24px;
margin: 0;
color: white;
}
.modal-buttons {
display: flex;
gap: 10px;
margin-top: 20px;
}
.modal-buttons .btn {
flex: 1;
padding: 20px;
font-size: 20px;
border: none;
border-radius: 0;
cursor: pointer;
color: white;
}
.modal-buttons .btn--warning {
background: #f44336;
}
.modal-buttons .btn:not(.btn--warning) {
background: #333;
}
#game-completion-modal h2 {
font-size: 24px;
margin-bottom: 20px;
color: white;
}