🔀 Merged ClassQuizController

This commit is contained in:
Mawoka
2023-06-30 01:36:48 +02:00
183 changed files with 10232 additions and 3260 deletions
@@ -5,6 +5,9 @@
-->
<script lang="ts">
import { onMount } from 'svelte';
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
export let data;
export let username;
@@ -53,8 +56,11 @@
style="font-size: {player_count_or_five - i / 2}rem"
class="text-center"
>
{i + 1}
: {player} with {data[player]} points
{$t('play_page.final_result_rank', {
place: i + 1,
username: player,
points: data[player]
})}
</p>
{/if}
{/each}
@@ -62,7 +68,7 @@
{#if data[username]}
<div class="fixed bottom-0 left-0 flex justify-center w-full mb-6">
<div class="mx-auto p-2 border-[#B07156] border-4 rounded">
<p>Your score: <b>{data[username]}</b></p>
<p>{$t('play_page.your_score', { score: data[username] })}</p>
</div>
</div>
{/if}
@@ -38,7 +38,13 @@
<div class="grid grid-cols-3 mt-12">
<div class="flex justify-center">
<p class="m-auto text-2xl">
Join at <b>{window.location.host}/play</b> and enter <b>{game_pin}</b>.
{$t('play_page.join_description', {
url:
window.location.host === 'classquiz.de'
? 'cquiz.de'
: `${window.location.host}/play`,
pin: game_pin
})}
</p>
</div>
<img
@@ -49,7 +55,7 @@
{#if cqc_code}
<div class="m-auto">
<div class="flex-col flex justify-center">
<p class="mx-auto">Join by entering the following code</p>
<p class="mx-auto">{$t('play_page.join_by_entering_code')}</p>
<ControllerCodeDisplay code={cqc_code} />
</div>
</div>
+7 -3
View File
@@ -7,6 +7,8 @@
import { flip } from 'svelte/animate';
import { fly } from 'svelte/transition';
import { onMount } from 'svelte';
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
export let data;
@@ -91,11 +93,13 @@
<div>
<table class="table-auto text-xl">
<tr>
<th class="p-2 border-r border-r-black border-b-2 border-b-black">Name</th>
<th class="p-2 border-b-2 border-b-black">Points</th>
<th class="p-2 border-r border-r-black border-b-2 border-b-black"
>{$t('words.name')}</th
>
<th class="p-2 border-b-2 border-b-black">{$t('words.point', { count: 2 })}</th>
{#if show_new_score_clicked}
<th in:fly={{ x: 300 }} class="p-2 border-b-2 border-b-black"
>Points added
>{$t('play_page.points_added')}
</th>
{/if}
</tr>