Better reporting
This commit is contained in:
parent
6a8168e171
commit
a545c37515
|
@ -30,8 +30,8 @@ return function($data, $headers, $db) {
|
||||||
$imagesHostName = 'https://geohry.skolazdola.cz/';
|
$imagesHostName = 'https://geohry.skolazdola.cz/';
|
||||||
|
|
||||||
if(!isset($data['gameurl']) || empty($data['gameurl'])) return [
|
if(!isset($data['gameurl']) || empty($data['gameurl'])) return [
|
||||||
|
"success" => false,
|
||||||
"data" => [
|
"data" => [
|
||||||
"success" => false,
|
|
||||||
"message" => "Property 'gameurl' is not set."
|
"message" => "Property 'gameurl' is not set."
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
@ -43,8 +43,8 @@ return function($data, $headers, $db) {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if(!$gameDetails) return [
|
if(!$gameDetails) return [
|
||||||
|
"success" => false,
|
||||||
"data" => [
|
"data" => [
|
||||||
"success" => false,
|
|
||||||
"message" => "Invalid 'gameurl'."
|
"message" => "Invalid 'gameurl'."
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 585 KiB |
|
@ -3,6 +3,7 @@
|
||||||
import './main.scss'
|
import './main.scss'
|
||||||
|
|
||||||
import Game from './routes/game.svelte'
|
import Game from './routes/game.svelte'
|
||||||
|
import Index from './routes/index.svelte'
|
||||||
import Play from './routes/play.svelte'
|
import Play from './routes/play.svelte'
|
||||||
|
|
||||||
if ('serviceWorker' in window.navigator) {
|
if ('serviceWorker' in window.navigator) {
|
||||||
|
@ -14,9 +15,7 @@
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<Router>
|
<Router>
|
||||||
<Route path="/">
|
<Route path="/" component={Index} />
|
||||||
<h1 class="flex items-center justify-center">Nebyla vybrána žádná hra</h1>
|
|
||||||
</Route>
|
|
||||||
|
|
||||||
<Route path="/play" component={Play} />
|
<Route path="/play" component={Play} />
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
justify-self: center;
|
justify-self: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 768px;
|
max-width: 500px;
|
||||||
/*overflow: hidden;*/
|
/*overflow: hidden;*/
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
<div class="lds-ring">
|
||||||
|
<div />
|
||||||
|
<div />
|
||||||
|
<div />
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.lds-ring {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
.lds-ring div {
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
margin: 8px;
|
||||||
|
border: 8px solid #4263eb;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
||||||
|
border-color: #4263eb transparent transparent transparent;
|
||||||
|
}
|
||||||
|
.lds-ring div:nth-child(1) {
|
||||||
|
animation-delay: -0.45s;
|
||||||
|
}
|
||||||
|
.lds-ring div:nth-child(2) {
|
||||||
|
animation-delay: -0.3s;
|
||||||
|
}
|
||||||
|
.lds-ring div:nth-child(3) {
|
||||||
|
animation-delay: -0.15s;
|
||||||
|
}
|
||||||
|
@keyframes lds-ring {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -25,6 +25,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
clip-path: inset(0);
|
||||||
|
|
||||||
.overlay {
|
.overlay {
|
||||||
min-height: 75vh;
|
min-height: 75vh;
|
||||||
|
@ -46,7 +47,7 @@
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height: 25%;
|
min-height: 35vh;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<script>
|
||||||
|
import { onMount } from 'svelte'
|
||||||
|
import { navigate } from 'svelte-routing'
|
||||||
|
|
||||||
|
export let to = '/'
|
||||||
|
|
||||||
|
onMount(() => navigate(to))
|
||||||
|
</script>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<script>
|
||||||
|
import Heading from '../lib/Components/game/Heading.svelte'
|
||||||
|
import Overlay from '../lib/Components/Overlay.svelte'
|
||||||
|
import Section from '../lib/Components/Section.svelte'
|
||||||
|
import Button from '../lib/Components/Button.svelte'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Overlay img="/assets/images/main.jpg">
|
||||||
|
<Heading>
|
||||||
|
<span>Erant</span>
|
||||||
|
</Heading>
|
||||||
|
|
||||||
|
<Section title="Nastala chyba">
|
||||||
|
<p>Je nám líto ale tato hra nebyla nalezena.</p>
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
<Button href="/" primary>Hlavní menu</Button>
|
||||||
|
</Overlay>
|
|
@ -9,6 +9,8 @@
|
||||||
import IconPoint from '../lib/Components/Icons/Point.svelte'
|
import IconPoint from '../lib/Components/Icons/Point.svelte'
|
||||||
import Map from '../lib/Components/game/Map/Map.svelte'
|
import Map from '../lib/Components/game/Map/Map.svelte'
|
||||||
import ImageSlider from '$lib/Components/ImageSlider.svelte'
|
import ImageSlider from '$lib/Components/ImageSlider.svelte'
|
||||||
|
import Redirect from '$lib/Components/Redirect.svelte'
|
||||||
|
import Loading from '../lib/Components/Loading.svelte'
|
||||||
|
|
||||||
import * as api from '$lib/utils/api'
|
import * as api from '$lib/utils/api'
|
||||||
import { data } from '$lib/stores/game'
|
import { data } from '$lib/stores/game'
|
||||||
|
@ -31,8 +33,11 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<h1 class="flex items-center justify-center">Hra se načítá</h1>
|
<h1 class="flex items-center justify-center flex-col">
|
||||||
{:else if !('success' in $data)}
|
<span>Hra se načítá...</span>
|
||||||
|
<Loading />
|
||||||
|
</h1>
|
||||||
|
{:else if $data?.success === true}
|
||||||
<Overlay shareData={{ url: window.location.href }} img={$data?.thumbnail}>
|
<Overlay shareData={{ url: window.location.href }} img={$data?.thumbnail}>
|
||||||
{#if $data}
|
{#if $data}
|
||||||
<Heading>
|
<Heading>
|
||||||
|
@ -52,8 +57,9 @@
|
||||||
<Section title="Popis">
|
<Section title="Popis">
|
||||||
<span>
|
<span>
|
||||||
{@html $data.start}
|
{@html $data.start}
|
||||||
</span></Section
|
</span>
|
||||||
>
|
</Section>
|
||||||
|
|
||||||
<Section title="Fotky">
|
<Section title="Fotky">
|
||||||
<ImageSlider images={assets} />
|
<ImageSlider images={assets} />
|
||||||
</Section>
|
</Section>
|
||||||
|
@ -68,7 +74,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
</Overlay>
|
</Overlay>
|
||||||
{:else}
|
{:else}
|
||||||
<h1 class="flex items-center justify-center">Tato hra neexistuje</h1>
|
<Redirect to="/error" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<script>
|
||||||
|
import Heading from '../lib/Components/game/Heading.svelte'
|
||||||
|
import Overlay from '../lib/Components/Overlay.svelte'
|
||||||
|
import Section from '../lib/Components/Section.svelte'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Overlay img="/assets/images/main.jpg">
|
||||||
|
<Heading>
|
||||||
|
<span>Erant</span>
|
||||||
|
</Heading>
|
||||||
|
|
||||||
|
<Section title="Spuštění hry">
|
||||||
|
<p>Pro spuštění hry najděte QR kód hry.</p>
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
<Section>
|
||||||
|
<p>Nechť dobrodružství započne.</p>
|
||||||
|
</Section>
|
||||||
|
</Overlay>
|
Loading…
Reference in New Issue