Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97b7df2a75 | ||
| 06f27d6813 | |||
|
|
7c8cf6503b | ||
| f05f10ea56 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -93,3 +93,13 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* FRO-24 Create Played Cards Component ([#17](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/17)) ([21db939](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/21db939d342c72f5ad5fad3b4f873e902d1e5a0f))
|
* FRO-24 Create Played Cards Component ([#17](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/17)) ([21db939](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/21db939d342c72f5ad5fad3b4f873e902d1e5a0f))
|
||||||
|
## [0.0.0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/compare/0.10.0...0.0.0) (2025-12-10)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **ui:** FRO-13 User Component ([#18](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/18)) ([f05f10e](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/f05f10ea56b21f15cefbc76277ead5806eb1cf18))
|
||||||
|
## [0.0.0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/compare/0.11.0...0.0.0) (2025-12-10)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* FRO-25 Create Game Info Component ([#19](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/19)) ([06f27d6](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/06f27d6813f625af25e734de3dcbcf07b10f3a1a))
|
||||||
|
|||||||
81
src/components/User.vue
Normal file
81
src/components/User.vue
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useUserInfo } from "@/composables/useUserInfo.ts";
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import {useQuasar} from "quasar";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
const api = window?.__RUNTIME_CONFIG__?.API_URL;
|
||||||
|
const $q = useQuasar()
|
||||||
|
let userinfo = useUserInfo();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const handleLogoff = () => {
|
||||||
|
|
||||||
|
axios.post(`${api}/logout`, {}, {withCredentials: true}).then((response) => {
|
||||||
|
const responseData = response.data
|
||||||
|
console.log("Response" + responseData.status)
|
||||||
|
$q.notify({
|
||||||
|
message: `You successfully logged out!`,
|
||||||
|
color: 'green-6',
|
||||||
|
icon: 'check_circle',
|
||||||
|
position: 'top'
|
||||||
|
});
|
||||||
|
router.push({ name: 'login' });
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log("ERROR:" + err)
|
||||||
|
$q.notify({
|
||||||
|
message: `Something went wrong`,
|
||||||
|
color: 'red-6',
|
||||||
|
icon: 'cancel',
|
||||||
|
position: 'top'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="row items-center q-gutter-x-md">
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="userinfo.username"
|
||||||
|
class="text-body1 text-weight-medium row items-center q-gutter-x-sm cursor-pointer relative-position"
|
||||||
|
>
|
||||||
|
<div id="user-menu-target" class="row items-center q-gutter-x-sm" style="min-width: 150px">
|
||||||
|
<q-icon name="account_circle" size="md" />
|
||||||
|
<span>{{ userinfo.username }}</span>
|
||||||
|
<q-icon name="arrow_drop_down" size="sm" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<q-menu
|
||||||
|
target="#user-menu-target"
|
||||||
|
anchor="bottom right"
|
||||||
|
self="top right"
|
||||||
|
>
|
||||||
|
<q-list style="max-width: 150px" class="bg-dark">
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="handleLogoff"
|
||||||
|
class="text-negative"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="logout" color="negative" />
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>Log Off</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="text-caption text-grey-4">
|
||||||
|
Not Logged In
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
#user-menu-target:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
57
src/components/ingame/GameInfo.vue
Normal file
57
src/components/ingame/GameInfo.vue
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import type {Card} from "@/types/GameSubTypes.ts";
|
||||||
|
import {computed, toRefs} from "vue";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
trumpsuit: Card
|
||||||
|
firstCard: Card | null
|
||||||
|
}>()
|
||||||
|
const {trumpsuit, firstCard} = toRefs(props)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const trumpName = computed(() => {
|
||||||
|
switch (trumpsuit.value.path.charAt(trumpsuit.value.path.length - 1)) {
|
||||||
|
case 'S':
|
||||||
|
return 'Spades'
|
||||||
|
case 'H':
|
||||||
|
return 'Hearts'
|
||||||
|
case 'D':
|
||||||
|
return 'Diamonds'
|
||||||
|
case 'C':
|
||||||
|
return 'Clubs'
|
||||||
|
default:
|
||||||
|
return 'Unknown'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="q-mb-sm">
|
||||||
|
<div class="text-h6 q-mb-xs q-font-medium">Trumpsuit</div>
|
||||||
|
<div id="trumpsuit" class="text-h5 text-primary">{{ trumpName }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="q-mt-md">
|
||||||
|
<div class="text-subtitle1 q-mb-xs q-font-medium">First Card</div>
|
||||||
|
<div id="first-card-container" class="q-pa-sm bg-grey-2 rounded shadow-2"
|
||||||
|
style="display:inline-block;">
|
||||||
|
<q-img v-if="firstCard" :src="firstCard.path" alt="First Card" class="firstbox"
|
||||||
|
style="width: 80px; border-radius: 6px;"/>
|
||||||
|
<div v-else class="q-pa-sm"
|
||||||
|
style="width: 80px; height: 120px; display:flex; align-items:center; justify-content:center; border-radius:6px; background: #ffffff; color: #666;">
|
||||||
|
No image
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.firstbox {
|
||||||
|
width: 80px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,14 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import MainMenuBoxes from "@/components/MainMenuBoxes.vue";
|
import UserStatusArea from '../components/User.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-layout view="hHh lpR fFf" class="font-roboto">
|
<q-layout view="hHh lpR fFf" class="font-roboto">
|
||||||
<q-page-container>
|
<q-header elevated class="bg-dark text-white">
|
||||||
<q-page class="flex justify-start items-center column">
|
<q-toolbar>
|
||||||
|
<q-toolbar-title class="q-ml-md">
|
||||||
|
</q-toolbar-title>
|
||||||
|
|
||||||
<header class="text-center q-mb-xl">
|
<UserStatusArea />
|
||||||
<h1 class="game-title text-white q-my-none">
|
</q-toolbar>
|
||||||
|
</q-header>
|
||||||
|
|
||||||
|
<q-page-container>
|
||||||
|
<q-page class="flex justify-start items-center column q-pa-md"> <header class="text-center q-mb-xl q-mt-md"> <h1 class="game-title text-white q-my-none">
|
||||||
KnockOutWhist
|
KnockOutWhist
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
MAJOR=0
|
MAJOR=0
|
||||||
MINOR=10
|
MINOR=12
|
||||||
PATCH=0
|
PATCH=0
|
||||||
|
|||||||
Reference in New Issue
Block a user