commit 04

This commit is contained in:
Moritz Ruth 2024-12-26 21:16:52 +01:00
parent 9a71f52528
commit 55aa013e1d
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
4 changed files with 17 additions and 6 deletions

View file

@ -6,7 +6,7 @@
"start:ui": "vite preview --host --port 4000", "start:ui": "vite preview --host --port 4000",
"start:server": "NODE_ENV=production tsx ./src/server/main.ts", "start:server": "NODE_ENV=production tsx ./src/server/main.ts",
"build:ui": "vite build", "build:ui": "vite build",
"dev:ui": "vite", "dev:ui": "vite --host",
"dev:server": "NODE_ENV=development tsx watch --clear-screen=false ./src/server/main.ts" "dev:server": "NODE_ENV=development tsx watch --clear-screen=false ./src/server/main.ts"
}, },
"devDependencies": { "devDependencies": {

View file

@ -1,12 +1,12 @@
<template> <template>
<div class="bg-gray-900 h-100vh w-100vw overflow-hidden text-white"> <div class="bg-gray-900 h-[100dvh] overflow-hidden text-white">
<div :class="$style.noise"/> <div :class="$style.noise"/>
<div :class="$style.vignette"/> <div :class="$style.vignette"/>
<div v-if="isLoading" class="flex flex-col justify-center items-center text-lg inset-0 absolute"> <div v-if="isLoading" class="flex flex-col justify-center items-center text-lg inset-0 absolute">
<span class="text-center">Verbindung wird hergestellt</span> <span class="text-center">Verbindung wird hergestellt</span>
</div> </div>
<div class="h-full relative flex flex-col"> <div class="h-full relative flex flex-col">
<nav class="mx-auto py-4"> <nav class="mx-auto py-4 flex gap-4">
<div class="flex items-center rounded-lg bg-dark-400 overflow-hidden"> <div class="flex items-center rounded-lg bg-dark-400 overflow-hidden">
<button <button
class="px-4 py-2 bg-gray-700" class="px-4 py-2 bg-gray-700"
@ -23,6 +23,9 @@
Abstimmen Abstimmen
</button> </button>
</div> </div>
<button v-if="!isFullscreen" class="px-3 rounded-lg bg-dark-400 flex items-center justify-center" @click="enterFullscreen()">
<CornersOutIcon/>
</button>
</nav> </nav>
<main class="flex-grow"> <main class="flex-grow">
<InteractionsScreen v-if="activeTab === 'interactions'"/> <InteractionsScreen v-if="activeTab === 'interactions'"/>
@ -33,8 +36,9 @@
</template> </template>
<style module lang="scss"> <style module lang="scss">
body { html, body {
user-select: none; user-select: none;
height: 100%;
} }
.noise, .vignette { .noise, .vignette {
@ -94,11 +98,15 @@
import { useGame } from "./game" import { useGame } from "./game"
import InteractionsScreen from "./screens/InteractionsScreen.vue" import InteractionsScreen from "./screens/InteractionsScreen.vue"
import QueueScreen from "./screens/QueueScreen.vue" import QueueScreen from "./screens/QueueScreen.vue"
import CornersOutIcon from "virtual:icons/ph/corners-out-bold"
import { useFullscreen } from "@vueuse/core"
const isLoading = ref(true) const isLoading = ref(true)
const activeTab = ref<"interactions" | "queue">("interactions") const activeTab = ref<"interactions" | "queue">("interactions")
const game = useGame() const game = useGame()
const { isFullscreen, enter: enterFullscreen } = useFullscreen()
trpcClient.join.subscribe(undefined, { trpcClient.join.subscribe(undefined, {
onStarted: () => { onStarted: () => {
isLoading.value = false isLoading.value = false

View file

@ -24,7 +24,8 @@ export const useGame = defineStore("gameState", () => {
currentRoom, currentRoom,
allObjectsById: computed(() => { allObjectsById: computed(() => {
const map = new Map<string, GameObject>() const map = new Map<string, GameObject>()
currentRoom.value.initialObjects.union(currentRoom.value.hiddenObjects).forEach(o => map.set(o.id, o)) currentRoom.value.initialObjects.forEach(o => map.set(o.id, o))
currentRoom.value.hiddenObjects.forEach(o => map.set(o.id, o))
return map return map
}), }),
currentInteraction, currentInteraction,

View file

@ -1,9 +1,11 @@
<template> <template>
<transition-group tag="div" name="list" class="h-full flex flex-col gap-4 p-4 pt-0 relative"> <transition-group tag="div" name="list" class="h-full flex flex-col gap-4 p-4 pt-0 relative">
<InteractionQueueItemCard <InteractionQueueItemCard
v-for="item in game.sortedInteractionQueue" v-for="(item, index) in game.sortedInteractionQueue"
:key="item.id" :key="item.id"
:item="item" :item="item"
class="relative"
:style="{ zIndex: 1000 - index }"
/> />
</transition-group> </transition-group>
</template> </template>