🎨 prettier

This commit is contained in:
Mawoka
2022-04-14 11:34:04 +02:00
parent 293e7bbbf8
commit 22b51e70a6
+14 -14
View File
@@ -1,4 +1,4 @@
<script context='module' lang='ts'> <script context="module" lang="ts">
export async function load({ session, url }) { export async function load({ session, url }) {
if (!session.authenticated) { if (!session.authenticated) {
return { return {
@@ -22,7 +22,7 @@
} }
</script> </script>
<script lang='ts'> <script lang="ts">
import type { QuizData } from '../app'; import type { QuizData } from '../app';
import { socket } from '$lib/socket'; import { socket } from '$lib/socket';
@@ -41,7 +41,6 @@
export let auto_connect: boolean; export let auto_connect: boolean;
export let game_token: string; export let game_token: string;
interface Player { interface Player {
username: string; username: string;
} }
@@ -140,7 +139,7 @@
try { try {
data = JSON.parse(data); data = JSON.parse(data);
} catch (e) { } catch (e) {
console.log("Failed to parse question results"); console.log('Failed to parse question results');
return; return;
} }
question_results = data; question_results = data;
@@ -183,19 +182,19 @@
</svelte:head> </svelte:head>
{#if !success} {#if !success}
<input placeholder='game id' bind:value={game_token} /> <input placeholder="game id" bind:value={game_token} />
<input placeholder='game pin' bind:value={game_pin} /> <input placeholder="game pin" bind:value={game_pin} />
<button on:click={connect}>{$t('words.connect')}!</button> <button on:click={connect}>{$t('words.connect')}!</button>
{#if errorMessage !== ''} {#if errorMessage !== ''}
<p class='text-red-700'>{errorMessage}</p> <p class="text-red-700">{errorMessage}</p>
{/if} {/if}
{:else if !game_started} {:else if !game_started}
<img <img
alt='QR code to join the game' alt="QR code to join the game"
src='/api/v1/utils/qr/{quiz_data.game_pin}?ref=qr' src="/api/v1/utils/qr/{quiz_data.game_pin}?ref=qr"
class='block mx-auto w-1/6' class="block mx-auto w-1/6"
/> />
<p class='text-3xl text-center'>{$t('words.pin')}: {quiz_data.game_pin}</p> <p class="text-3xl text-center">{$t('words.pin')}: {quiz_data.game_pin}</p>
<ul> <ul>
{#if players.length > 0} {#if players.length > 0}
{#each players as player} {#each players as player}
@@ -243,12 +242,13 @@
> >
<br /> <br />
{/each}--> {/each}-->
<button disabled={!(timer_res === undefined || timer_res === '0')} <button
disabled={!(timer_res === undefined || timer_res === '0')}
on:click={() => { on:click={() => {
set_question_number(selected_question+1); set_question_number(selected_question + 1);
}}>{selected_question + 1}: {quiz_data.questions[selected_question + 1].question}</button }}>{selected_question + 1}: {quiz_data.questions[selected_question + 1].question}</button
> >
<br> <br />
{#if selected_question === quiz_data.questions.length} {#if selected_question === quiz_data.questions.length}
<button on:click={get_final_results}>Get final results</button> <button on:click={get_final_results}>Get final results</button>
{/if} {/if}