From c18ed5954eda7c6a0a28e2ab50de59c118f4fd03 Mon Sep 17 00:00:00 2001
From: Jonas <77726472+kobolol@users.noreply.github.com>
Date: Sun, 8 Mar 2026 19:15:25 +0100
Subject: [PATCH] Add OnlineMode route and extract app styles
Introduce an OnlineMode route and placeholder component, wire it into the router and Home menu (replace the removed local-vs-bot entry). Rename utils/index.ts to router/index.ts and add the new /onlineMode route; update main.ts to import the router from ./router and include the new app.css. Extract shared #game and .game-content styles into GUI/src/app.css and remove the duplicate styles from LocalMode.vue. Make small UI tweaks: adjust GameEndedMenu width, minor formatting/attribute fixes in Layout.vue and LocalMode.vue.
---
GUI/src/Home.vue | 6 +---
GUI/src/Layout.vue | 8 ++---
GUI/src/app.css | 17 ++++++++++
GUI/src/components/GameEndedMenu.vue | 2 +-
GUI/src/main.ts | 4 ++-
GUI/src/{utils => router}/index.ts | 6 ++++
GUI/src/routes/LocalMode.vue | 48 ++++++++++++----------------
GUI/src/routes/OnlineMode.vue | 9 ++++++
8 files changed, 61 insertions(+), 39 deletions(-)
create mode 100644 GUI/src/app.css
rename GUI/src/{utils => router}/index.ts (79%)
create mode 100644 GUI/src/routes/OnlineMode.vue
diff --git a/GUI/src/Home.vue b/GUI/src/Home.vue
index bb87204..3eb1285 100644
--- a/GUI/src/Home.vue
+++ b/GUI/src/Home.vue
@@ -6,15 +6,11 @@ let buttons = [
color: "red",
componentName: "LocalMode"
},
- {
- name: "Lokal gegen Bot",
- icon: "mdi-robot-angry-outline",
- color: "green",
- },
{
name: "Online Multiplayer",
icon: "mdi-web",
color: "blue",
+ componentName: "OnlineMode"
},
]
diff --git a/GUI/src/Layout.vue b/GUI/src/Layout.vue
index edafb16..6847395 100644
--- a/GUI/src/Layout.vue
+++ b/GUI/src/Layout.vue
@@ -7,10 +7,10 @@
-
4-Gewinnt
@@ -22,4 +22,4 @@
-
\ No newline at end of file
+
diff --git a/GUI/src/app.css b/GUI/src/app.css
new file mode 100644
index 0000000..e7ec6c4
--- /dev/null
+++ b/GUI/src/app.css
@@ -0,0 +1,17 @@
+#game {
+ width: 100%;
+ min-height: calc(100dvh - var(--v-layout-top));
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 16px;
+ box-sizing: border-box;
+}
+
+.game-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 16px;
+ width: 100%;
+}
\ No newline at end of file
diff --git a/GUI/src/components/GameEndedMenu.vue b/GUI/src/components/GameEndedMenu.vue
index 6c13690..5d68136 100644
--- a/GUI/src/components/GameEndedMenu.vue
+++ b/GUI/src/components/GameEndedMenu.vue
@@ -21,7 +21,7 @@ const message = computed(() => {
-
+
{{ message}}
Spiele erneut oder beende das Spiel
diff --git a/GUI/src/main.ts b/GUI/src/main.ts
index 934aca6..fd00a01 100644
--- a/GUI/src/main.ts
+++ b/GUI/src/main.ts
@@ -1,6 +1,6 @@
import { createApp } from 'vue'
import App from './Layout.vue'
-import router from './utils'
+import router from './router'
// Vuetify
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
@@ -22,6 +22,8 @@ import '@fontsource/roboto/700-italic.css'
import '@fontsource/roboto/900-italic.css'
// Icons
import '@mdi/font/css/materialdesignicons.css'
+// Styles
+import "./app.css"
// Vuetify
const vuetify = createVuetify({
diff --git a/GUI/src/utils/index.ts b/GUI/src/router/index.ts
similarity index 79%
rename from GUI/src/utils/index.ts
rename to GUI/src/router/index.ts
index 32d9083..897f0c8 100644
--- a/GUI/src/utils/index.ts
+++ b/GUI/src/router/index.ts
@@ -1,6 +1,7 @@
import Home from '@/Home.vue'
import NotFound from '@/NotFound.vue'
import LocalMode from '@/routes/LocalMode.vue'
+import OnlineMode from '@/routes/OnlineMode.vue'
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
@@ -16,6 +17,11 @@ const router = createRouter({
name: "LocalMode",
component: LocalMode
},
+ {
+ path: "/onlineMode",
+ name: "OnlineMode",
+ component: OnlineMode
+ },
{ path: '/:pathMatch(.*)*', name: 'Nicht gefunden', component: NotFound },
],
})
diff --git a/GUI/src/routes/LocalMode.vue b/GUI/src/routes/LocalMode.vue
index 7536402..f25d338 100644
--- a/GUI/src/routes/LocalMode.vue
+++ b/GUI/src/routes/LocalMode.vue
@@ -33,7 +33,7 @@ game.value.onGameStateChanged = (gameState) => {
game.value.onGameEnded = (gameEndedInfo) => {
gameEndedInformation.value = gameEndedInfo;
currentState.value = CurrentState.EndScreen;
-}
+};
async function startGame() {
await game.value.start(settings.value);
@@ -41,50 +41,42 @@ async function startGame() {
currentState.value = CurrentState.Game;
}
-async function restart(){
+async function restart() {
await game.value.disconnectAll();
startGame();
}
-
-
+
-
-
+
+
-
+
diff --git a/GUI/src/routes/OnlineMode.vue b/GUI/src/routes/OnlineMode.vue
new file mode 100644
index 0000000..eec16c3
--- /dev/null
+++ b/GUI/src/routes/OnlineMode.vue
@@ -0,0 +1,9 @@
+
+
+
+ Online Modus
+
+
+
\ No newline at end of file