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:
@@ -1,12 +1,6 @@
|
||||
---
|
||||
import NewGame from "../components/NewGame.astro";
|
||||
import GameList from "../components/GameList.astro";
|
||||
import GameDetail from "../components/GameDetail.astro";
|
||||
import GameHistory from "../components/GameHistory.astro";
|
||||
import Modal from "../components/Modal.astro";
|
||||
import ValidationModal from "../components/ValidationModal.astro";
|
||||
import GameCompletionModal from "../components/GameCompletionModal.astro";
|
||||
import "../styles/index.css";
|
||||
import App from "../components/App.jsx";
|
||||
---
|
||||
|
||||
<html lang="de">
|
||||
@@ -25,19 +19,7 @@ import "../styles/index.css";
|
||||
</head>
|
||||
<body>
|
||||
<div class="screen-container">
|
||||
<NewGame />
|
||||
<GameList />
|
||||
<GameDetail />
|
||||
<GameHistory />
|
||||
<App client:only="preact" />
|
||||
</div>
|
||||
<button id="fullscreen-toggle" class="fullscreen-toggle">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<Modal />
|
||||
<ValidationModal />
|
||||
<GameCompletionModal />
|
||||
<script type="module" src="/scripts/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user