fixing bugs

This commit is contained in:
ota-prokopec 2022-09-15 16:03:27 +02:00
parent a5602fea84
commit 274d57de5b
4 changed files with 15 additions and 9 deletions

View File

@ -1,10 +1,12 @@
<script> <script>
import Overlay from '$lib/Components/Overlay.svelte' import Overlay from '$lib/Components/Overlay.svelte'
import Button from '$lib/Components/Button.svelte'
export let img export let img
</script> </script>
<Overlay {img}> <Overlay {img}>
<div class="h-full w-full flex justify-self-center justify-center relative top-20"><slot /></div> <div class="h-full w-full flex justify-self-center justify-center relative top-20"><slot /></div>
<div><Button href="/">ukončit hru</Button></div>
</Overlay> </Overlay>
<style> <style>

View File

@ -13,14 +13,14 @@
<div style="overflow-y: {overflow}" bind:offsetWidth={windowsize} class="imageSlider"> <div style="overflow-y: {overflow}" bind:offsetWidth={windowsize} class="imageSlider">
{#each images as image, i} {#each images as image, i}
{#if Math.floor(windowsize / (94 + 10)) >= i + 1} <!--{#if Math.floor(windowsize / (94 + 10)) >= i + 1}-->
<div> <div>
<Image src={image} class="w-24 h-24" /> <Image src={image} class="w-24 h-24" />
{#if Math.floor(windowsize / (94 + 10)) === i + 1 && images.length !== i + 1} <!--{#if Math.floor(windowsize / (94 + 10)) === i + 1 && images.length !== i + 1}
<span on:click={nextImages} class="imageCounter">{`+${images.length - Math.floor(windowsize / (94 + 10))}`}</span> <span on:click={nextImages} class="imageCounter">{`+${images.length - Math.floor(windowsize / (94 + 10))}`}</span>
{/if} {/if}-->
</div> </div>
{/if} <!--{/if}-->
{/each} {/each}
</div> </div>

View File

@ -26,5 +26,6 @@
line-height: 20px; line-height: 20px;
padding: 28px 20px; padding: 28px 20px;
outline: none; outline: none;
appearance: none;
} }
</style> </style>

View File

@ -13,7 +13,10 @@
export let gameurl export let gameurl
let assets = Array.from(Array(6).keys()).map((_, i) => `/assets/temp/kar${i + 1}.png`) $: assets = $data?.questions
.filter((q) => q.thumbnail !== null)
.slice(0, 8)
.map((q) => q.thumbnail)
let loading = true let loading = true
;(async () => { ;(async () => {
@ -29,7 +32,7 @@
{#if loading} {#if loading}
<h1 class="flex items-center justify-center">Hra se načítá</h1> <h1 class="flex items-center justify-center">Hra se načítá</h1>
{:else if !('success' in $data)} {:else if !('success' in $data)}
<Overlay shareData={{}} img={$data?.thumbnail}> <Overlay shareData={{ url: window.location.href }} img={$data?.thumbnail}>
{#if $data} {#if $data}
<Heading> <Heading>
<span>{$data.name}</span> <span>{$data.name}</span>