Skip to content

Commit

Permalink
Patch build problem and finish session overview
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Feb 26, 2024
1 parent dbbc910 commit 6f48a6c
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 71 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Fleet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ onMounted(() => {
}
})
function getRandomEnum<T>(anEnum: T): T[keyof T] {
function getRandomEnum<T>(anEnum: any): T[keyof T] {
const enumValues = Object.values(anEnum) as T[keyof T][];
const randomIndex = Math.floor(Math.random() * enumValues.length);
return enumValues[randomIndex];
Expand Down
156 changes: 86 additions & 70 deletions frontend/src/components/fleet/FleetLobby.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
<template>
<section class="lobby-wrapper">
<div class="header">
<div class="content">
<img src="@/assets/icons/sot.svg">
<p>{{ session.sessionName }}</p>
</div>
<button>TODO</button>
</div>
<BannerTemplate>
<template #content>
<div class="header-content">
<img src="@/assets/icons/sot.svg">
<p>{{ session.sessionName }}</p>
</div>
</template>
<template #left-content>
<button class="session-starter">TODO</button>
</template>
</BannerTemplate>
<div class="lobby-content">
<div class="player-table">
<PlayerFleet
v-for="player in session.players.sort((a,b)=>{return (a.isMaster === b.isMaster)? 0 : a.isMaster? -1 : 1;})"
:player="player"/>
</div>
<div class="lobby-details">
<div class="header-information">
<h2>{{ t('session.informations.title') }}</h2>
</div>

<div class="information-data">
<h3>{{ t('session.informations.totalPlayer') }}</h3>
<p>{{ session.players.length }}</p>
</div>

<div class="information-data important">
<h3>{{ t('session.informations.totalPlayer') }}</h3>
<p>{{ session.players.filter(x => x.isReady).length }} / <span>{{ session.players.length }}</span></p>
<div class="top-content">
<div class="header-information">
<h2>{{ t('session.informations.title') }}</h2>
</div>

<div class="information-data">
<h3>{{ t('session.informations.totalPlayer') }}</h3>
<p>{{ session.players.length }}</p>
</div>

<div class="information-data important">
<h3>{{ t('session.informations.totalPlayer') }}</h3>
<p>{{ session.players.filter(x => x.isReady).length }} / <span>{{ session.players.length }}</span></p>
</div>
</div>

<div class="session-status">
<p>{{ t('session.status.' + SessionStatus[session.status].toString().toLowerCase()) }}</p>
</div>
Expand All @@ -42,6 +47,7 @@ import {PropType} from "vue";
import {Fleet, SessionStatus} from "@/objects/Fleet.ts";
import PlayerFleet from "@/vue/fleet/PlayerFleet.vue";
import {useI18n} from "vue-i18n";
import BannerTemplate from "@/vue/templates/BannerTemplate.vue";
const {t} = useI18n()
defineProps({
Expand All @@ -59,37 +65,36 @@ defineProps({
height: 100%;
display: flex;
flex-direction: column;
gap: 24px;
gap: 12px;
.header {
border-radius: 5px;
background: var(--secondary-background) url("@/assets/banners/lobby.png");
background-size: cover;
overflow: hidden;
.header-content {
display: flex;
justify-content: space-between;
height: 100%;
align-items: center;
height: 140px;
margin-left: 36px;
gap: 32px;
.content {
display: flex;
align-items: center;
margin-left: 36px;
gap: 32px;
img {
width: 64px;
height: 64px;
}
img {
width: 64px;
height: 64px;
}
p {
font-family: BrushTip, sans-serif;
font-size: 31px;
align-self: end;
}
p {
font-family: BrushTip, sans-serif;
margin-top: 18px;
font-size: 31px;
}
}
button.session-starter {
all: unset;
cursor: pointer;
height: 100%;
background: linear-gradient(270deg, rgba(50, 212, 153, 0.20) 0%, rgba(50, 212, 153, 0.00) 108.45%);
padding: 0 16px;
}
.lobby-content {
height: calc(100% - 140px); // Minus header height
display: flex;
Expand Down Expand Up @@ -119,47 +124,58 @@ defineProps({
gap: 20px;
overflow: hidden;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.header-information {
background: rgba(23, 26, 33, 0.50);
padding: 20px 8px;
.top-content {
width: 100%;
h2 {
font-size: 16px;
font-weight: 500;
text-align: center;
}
}
.header-information {
background: rgba(23, 26, 33, 0.50);
padding: 20px 0;
width: 100%;
.information-data {
display: flex;
flex-direction: column;
width: 100%;
align-items: center;
padding: 20px 8px;
gap: 12px;
h3 {
height: 14px;
color: var(--primary);
white-space: nowrap;
h2 {
font-size: 16px;
font-weight: 500;
text-align: center;
}
}
&.important {
background: rgba(50, 212, 153, 0.10);;
}
p {
span {
.information-data {
display: flex;
flex-direction: column;
width: 100%;
align-items: center;
padding: 20px 0;
gap: 12px;
h3 {
height: 14px;
color: var(--primary);
white-space: nowrap;
}
&.important {
background: rgba(50, 212, 153, 0.10);;
}
p {
span {
color: var(--primary);
}
}
}
}
}
.session-status {
justify-self: end;
padding: 20px 0;
background: rgba(212, 147, 50, 0.50);
width: 100%;
text-align: center;
}
}
Expand Down
30 changes: 30 additions & 0 deletions frontend/src/vue/templates/BannerTemplate.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div class="header-wrapper">
<div class="header">
<slot name="content" />
</div>
<slot name="left-content" />
</div>
</template>

<script setup lang="ts">
</script>

<style scoped lang="scss">
.header-wrapper {
overflow: hidden;
border-radius: 5px;
height: 120px;
width: 100%;
display: flex;
.header {
background: var(--secondary-background) url("@/assets/banners/lobby.png");
background-size: cover;
overflow: hidden;
height: 100%;
width: 100%;
}
}
</style>

0 comments on commit 6f48a6c

Please sign in to comment.