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:
111
src/components/NewGame.module.css
Normal file
111
src/components/NewGame.module.css
Normal file
@@ -0,0 +1,111 @@
|
||||
.screen {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.3s ease, opacity 0.3s ease;
|
||||
}
|
||||
.screen-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.screen-title {
|
||||
font-size: 24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.player-inputs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.player-input {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.player-input label {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
color: #ccc;
|
||||
font-size: 24px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.name-input {
|
||||
flex: 2;
|
||||
padding: 30px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
min-height: 44px;
|
||||
}
|
||||
.name-select:focus, .name-input:focus {
|
||||
outline: none;
|
||||
border-color: #666;
|
||||
}
|
||||
.game-settings {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
.setting-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.setting-group select {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
min-height: 44px;
|
||||
padding: 12px;
|
||||
}
|
||||
.setting-group input {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
border: 2px solid #333;
|
||||
background: #2a2a2a;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
}
|
||||
.setting-group input:focus {
|
||||
outline: none;
|
||||
border-color: #666;
|
||||
}
|
||||
.nav-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin: 20px 0 40px 0;
|
||||
}
|
||||
.btn {
|
||||
flex: 1;
|
||||
min-width: 100px;
|
||||
padding: 20px;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
Reference in New Issue
Block a user