added a new site and a gamefield component

This commit is contained in:
jhim
2026-02-13 10:20:18 +01:00
committed by Jonas
parent 4dfabb2e1e
commit 8e99bbca0e
12 changed files with 51 additions and 1 deletions
+2
View File
@@ -4,6 +4,7 @@ let buttons = [
name: "Lokaler Multiplayer",
icon: "mdi-account-switch",
color: "red",
componentName: "LocalMode"
},
{
name: "Lokal gegen Bot",
@@ -31,6 +32,7 @@ let buttons = [
v-for="button of buttons"
:key="button.name"
:color="button.color"
:to="{ name: button.componentName }"
size="x-large"
min-width="340"
rounded="xl"
View File
+5 -1
View File
@@ -6,7 +6,11 @@
<template v-slot:image>
<v-img gradient="to top right, rgba(5, 5, 5, 0.6), rgba(50, 50, 60, 0.6)"></v-img>
</template>
<v-app-bar-title class="font-weight-semibold text-white">
<v-app-bar-title
class="font-weight-semibold text-white"
@click="$router.push('/')"
style="cursor: pointer;"
>
4-Gewinnt
</v-app-bar-title>
</v-app-bar>
+15
View File
@@ -0,0 +1,15 @@
<script setup lang="ts">
const gameState = defineModel<number[][]>('gameState', {
required: true
})
</script>
<template>
<div id="spielfeld" class="d-flex flex-collum">
<div v-for="row in gameState">
<v-img v-for="field in row" src="./Game/Gamefield/Gamefield.svg" height="100px" width="100px"></v-img>
</div>
</div>
</template>
<style scoped></style>
+6
View File
@@ -1,5 +1,6 @@
import Home from '@/Home.vue'
import NotFound from '@/NotFound.vue'
import LocalMode from '@/routes/LocalMode.vue'
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
@@ -10,6 +11,11 @@ const router = createRouter({
name: 'Startseite',
component: Home,
},
{
path: "/localMode",
name: "LocalMode",
component: LocalMode
},
{ path: '/:pathMatch(.*)*', name: 'Nicht gefunden', component: NotFound },
],
})
+20
View File
@@ -0,0 +1,20 @@
<script setup lang="ts">
import Field from '@/components/Game/Field.vue';
const gameField = [
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
];
</script>
<template>
<Field :game-state="gameField"></Field>
</template>
<style scoped>
</style>