refactor: restructure playfield button layout and move card data to JSON
- Reorganized PlayFieldButton component with new container structure and moved title outside button - Extracted card data from gameroom.vue into separate card_data.json file - Added session validation on index page with PocketBase integration
This commit is contained in:
+26
-4
@@ -1,3 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
const { pb } = usePocketbase()
|
||||
const url = useRequestURL()
|
||||
|
||||
let isValid = false
|
||||
|
||||
const sessionid = url.searchParams.get('sessionid')
|
||||
|
||||
if (sessionid) {
|
||||
|
||||
const movie_data = await pb.collection('game_sessions').getList(1,1, {filter: `id = '${sessionid}'`})
|
||||
if (movie_data.items.length > 0) {
|
||||
isValid = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="index-container">
|
||||
<header>
|
||||
@@ -5,16 +24,19 @@
|
||||
<h1>Paska Joululeffa 2025</h1>
|
||||
</header>
|
||||
<main>
|
||||
<img src="@/assets/img/reindeerpoop.webp" alt="">
|
||||
<NuxtImg v-if="isValid" format="avif,webp" quality="30" src="/reindeerpoop.webp" alt="" :placeholder="[50, 25, 75, 5]"/>
|
||||
<NuxtImg v-else format="avif,webp" quality="30" src="/reindeerpoop-angry.webp" alt="" :placeholder="[50, 25, 75, 5]" />
|
||||
<div class="warning">
|
||||
<div>
|
||||
<Icon name="mdi:warning" size="1.5rem"/>
|
||||
<h2>Varoitus!</h2>
|
||||
<h2 v-if="isValid">Varoitus!</h2>
|
||||
<h2 v-else>URPO!!!</h2>
|
||||
<Icon name="mdi:warning" size="1.5rem" />
|
||||
</div>
|
||||
<p>Täällä on vain tyhmää läppää. Herkkänahkaisille ei suositella.</p>
|
||||
<p v-if="isValid">Täällä on vain tyhmää läppää. Herkkänahkaisille ei suositella.</p>
|
||||
<p v-else>Virheellinen koodi</p>
|
||||
</div>
|
||||
<NuxtLink class="btn btn-primary" to="/info">Sisään</NuxtLink>
|
||||
<NuxtLink class="btn btn-primary" to="/info" v-if="isValid">Sisään</NuxtLink>
|
||||
</main>
|
||||
<footer><sup>©</sup> {{ new Date().getFullYear() }} Kessinen</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user