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>
import Overlay from '$lib/Components/Overlay.svelte'
import Button from '$lib/Components/Button.svelte'
export let img
</script>
<Overlay {img}>
<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>
<style>

View File

@ -13,14 +13,14 @@
<div style="overflow-y: {overflow}" bind:offsetWidth={windowsize} class="imageSlider">
{#each images as image, i}
{#if Math.floor(windowsize / (94 + 10)) >= i + 1}
<!--{#if Math.floor(windowsize / (94 + 10)) >= i + 1}-->
<div>
<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>
{/if}
{/if}-->
</div>
{/if}
<!--{/if}-->
{/each}
</div>

View File

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

View File

@ -13,7 +13,10 @@
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
;(async () => {
@ -29,7 +32,7 @@
{#if loading}
<h1 class="flex items-center justify-center">Hra se načítá</h1>
{:else if !('success' in $data)}
<Overlay shareData={{}} img={$data?.thumbnail}>
<Overlay shareData={{ url: window.location.href }} img={$data?.thumbnail}>
{#if $data}
<Heading>
<span>{$data.name}</span>