Merge pull request #55 from Erant-s-r-o/expiriences

přidání Info typu
This commit is contained in:
Ota-Prokopec 2023-02-23 22:55:28 +01:00 committed by GitHub
commit ee92afcf9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 23 deletions

View File

@ -1,8 +1,8 @@
on: on:
push: push:
branches: [ "deploy/prod" ] branches: ['deploy/prod']
pull_request: pull_request:
branches: [ "deploy/prod" ] branches: ['deploy/prod']
name: 🚀 Deploy website on push name: 🚀 Deploy website on push
jobs: jobs:

View File

@ -13,7 +13,7 @@
$: if (isReady && !$user) { $: if (isReady && !$user) {
if (!(location.pathname.startsWith('/login') || location.pathname.startsWith('/register'))) { if (!(location.pathname.startsWith('/login') || location.pathname.startsWith('/register'))) {
//navigate('/login') navigate('/login')
} }
} }

View File

@ -1,9 +1,10 @@
<script> <script lang="ts">
import Section from '../../../lib/components/Common/Section.svelte' import Section from '../../../lib/components/Common/Section.svelte'
import Button from '../../../lib/components/Buttons/Button.svelte' import Button from '../../../lib/components/Buttons/Button.svelte'
import Image from '../../../lib/components/Common/Image.svelte' import Image from '../../../lib/components/Common/Image.svelte'
export let control, nextQuestion export let control: null | false | true | 'not-control'
export let nextQuestion
export let imgSrc export let imgSrc
</script> </script>
@ -23,7 +24,7 @@
</div> </div>
<div class="flex items-center justify-center flex-col w-full gap-6"> <div class="flex items-center justify-center flex-col w-full gap-6">
<span class="relative"> <slot name="answers" /> </span> <span class="relative"> <slot name="answers" /> </span>
{#if control !== null}<!--jestli jsem už odpověděl--> {#if control !== null || control === 'not-control'}<!--jestli jsem už odpověděl-->
<Button on:submit={nextQuestion} primary class="w-3/4 max-w-sm min-w-[400px] h-16 bottom-0 fixed m-10 relative">Na další otázku</Button> <Button on:submit={nextQuestion} primary class="w-3/4 max-w-sm min-w-[400px] h-16 bottom-0 fixed m-10 relative">Na další otázku</Button>
{:else}<!--čeká na odpověd, na sejmutí--> {:else}<!--čeká na odpověd, na sejmutí-->
<Button on:submit primary class="w-3/4 max-w-sm min-w-[400px] h-16 bottom-0 fixed m-10 relative">Vyhodnotit</Button> <Button on:submit primary class="w-3/4 max-w-sm min-w-[400px] h-16 bottom-0 fixed m-10 relative">Vyhodnotit</Button>
@ -31,9 +32,11 @@
</div> </div>
</div> </div>
<div class="w-full relative bottom-[170px] flex justify-center h-fit size"> <div class="w-full relative bottom-[170px] flex justify-center h-fit size">
{#if control} {#if control === 'not-control' || control === null}
<span />
{:else if control}
<span style="color:greenyellow">správně</span> <span style="color:greenyellow">správně</span>
{:else if control !== null} {:else}
<span style="color:red">špatně</span> <span style="color:red">špatně</span>
{/if} {/if}
</div> </div>

View File

@ -0,0 +1,27 @@
<script lang="ts">
import Layout from '../Components/Layout.svelte'
import Input from '../../../lib/components/Inputs/Input.svelte'
import { checkPoint } from '$lib/TStypes/expiriences'
import { answer } from '$lib/utils/database/game'
export let data: { name: string; checkPoint: checkPoint }
const { checkPoint, name } = data
let myAnswer = ''
export let nextQuestion
</script>
<Layout
imgSrc={'gameData.question.thumbnail'}
control={'not-control'}
nextQuestion={() => {
nextQuestion()
myAnswer = ''
}}
>
<span slot="title">{name}</span>
<span slot="about">{@html checkPoint.CPText}</span>
</Layout>
<style lang="scss">
</style>

View File

@ -10,6 +10,7 @@
import Finish from './Finish.svelte' import Finish from './Finish.svelte'
import { data } from '$lib/stores/game' import { data } from '$lib/stores/game'
import Erantmap from '$lib/components/Map/Erantmap.svelte' import Erantmap from '$lib/components/Map/Erantmap.svelte'
import Info from './Info.svelte'
const components = { const components = {
TEXT: TextForm, TEXT: TextForm,
@ -18,6 +19,7 @@
CHECKBOX: MultiplyForm, CHECKBOX: MultiplyForm,
interval: IntervalForm, interval: IntervalForm,
qrcode: QrCode, qrcode: QrCode,
INFO: Info,
} }
let control = null // if true => spravne if false spatne let control = null // if true => spravne if false spatne