Formatted files
This commit is contained in:
@@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
|
||||
SPDX-License-Identifier: MPL-2.0
|
||||
-->
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import AudioPlayer from '$lib/play/audio_player.svelte';
|
||||
import ControllerCodeDisplay from '$lib/components/controller/code.svelte';
|
||||
import { getLocalization } from '$lib/i18n';
|
||||
@@ -35,11 +35,11 @@ SPDX-License-Identifier: MPL-2.0
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class='w-full h-full'>
|
||||
<div class="w-full h-full">
|
||||
<AudioPlayer bind:play={play_music} />
|
||||
<div class='grid grid-cols-3 mt-12'>
|
||||
<div class='flex justify-center'>
|
||||
<p class='m-auto text-2xl'>
|
||||
<div class="grid grid-cols-3 mt-12">
|
||||
<div class="flex justify-center">
|
||||
<p class="m-auto text-2xl">
|
||||
{$t('play_page.join_description', {
|
||||
url:
|
||||
window.location.host === 'classquiz.de'
|
||||
@@ -50,45 +50,46 @@ SPDX-License-Identifier: MPL-2.0
|
||||
</p>
|
||||
</div>
|
||||
<img
|
||||
alt='QR code to join the game'
|
||||
src='/api/v1/utils/qr/{game_pin}'
|
||||
class='block mx-auto w-1/2 dark:bg-white shadow-2xl rounded'
|
||||
alt="QR code to join the game"
|
||||
src="/api/v1/utils/qr/{game_pin}"
|
||||
class="block mx-auto w-1/2 dark:bg-white shadow-2xl rounded"
|
||||
/>
|
||||
{#if cqc_code}
|
||||
<div class='m-auto'>
|
||||
<div class='flex-col flex justify-center'>
|
||||
<p class='mx-auto'>{$t('play_page.join_by_entering_code')}</p>
|
||||
<div class="m-auto">
|
||||
<div class="flex-col flex justify-center">
|
||||
<p class="mx-auto">{$t('play_page.join_by_entering_code')}</p>
|
||||
<ControllerCodeDisplay code={cqc_code} />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<p class='text-3xl text-center'>{$t('words.pin')}: <span class='select-all'>{game_pin}</span></p>
|
||||
<div class='flex justify-center w-full mt-4'>
|
||||
<p class="text-3xl text-center">
|
||||
{$t('words.pin')}: <span class="select-all">{game_pin}</span>
|
||||
</p>
|
||||
<div class="flex justify-center w-full mt-4">
|
||||
<div>
|
||||
<GrayButton
|
||||
disabled={players.length < 1}
|
||||
on:click={() => {
|
||||
socket.emit('start_game', '');
|
||||
}}
|
||||
>{$t('admin_page.start_game')}
|
||||
>{$t('admin_page.start_game')}
|
||||
</GrayButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class='flex flex-row w-full mt-4 px-10 flex-wrap'>
|
||||
<div class="flex flex-row w-full mt-4 px-10 flex-wrap">
|
||||
{#if players.length > 0}
|
||||
{#each players as player}
|
||||
<div class='p-2 m-2 border-2 border-[#B07156] rounded hover:cursor-pointer'>
|
||||
<span
|
||||
class='hover:line-through text-lg'
|
||||
on:click={() => {
|
||||
kick_player(player.username);
|
||||
}}>{player.username}</span
|
||||
>
|
||||
<div class="p-2 m-2 border-2 border-[#B07156] rounded hover:cursor-pointer">
|
||||
<span
|
||||
class="hover:line-through text-lg"
|
||||
on:click={() => {
|
||||
kick_player(player.username);
|
||||
}}>{player.username}</span
|
||||
>
|
||||
<!-- <button>{$t('words.kick')}</button>-->
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
|
||||
SPDX-License-Identifier: MPL-2.0
|
||||
-->
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import VotingResults from './voting_results.svelte';
|
||||
import { flip } from 'svelte/animate';
|
||||
import { fly } from 'svelte/transition';
|
||||
@@ -58,7 +58,7 @@ SPDX-License-Identifier: MPL-2.0
|
||||
}
|
||||
|
||||
$: data = sortObjectbyValue(data);
|
||||
$: player_names = Object.keys(data).sort(function(a, b) {
|
||||
$: player_names = Object.keys(data).sort(function (a, b) {
|
||||
return data[b] - data[a];
|
||||
});
|
||||
|
||||
@@ -94,30 +94,30 @@ SPDX-License-Identifier: MPL-2.0
|
||||
// https://svelte.dev/repl/96a58afdea2248a5b7e489160ffba887?version=3.44.2
|
||||
</script>
|
||||
|
||||
<div class='h-full flex flex-col'>
|
||||
<div class='flex justify-center'>
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="flex justify-center">
|
||||
<div>
|
||||
<table class='table-auto text-xl'>
|
||||
<table class="table-auto text-xl">
|
||||
<tr>
|
||||
<th class='p-2 border-r border-r-black border-b-2 border-b-black'
|
||||
>{$t('words.name')}</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>
|
||||
<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'
|
||||
>{$t('play_page.points_added')}
|
||||
<th in:fly={{ x: 300 }} class="p-2 border-b-2 border-b-black"
|
||||
>{$t('play_page.points_added')}
|
||||
</th>
|
||||
{/if}
|
||||
</tr>
|
||||
{#each player_names as player, i (player)}
|
||||
<tr animate:flip>
|
||||
<td class:hidden={i > 3} class='p-2 border-r border-r-black'>{player}</td>
|
||||
<td class:hidden={i > 3} class='p-2'>{data[player]}</td>
|
||||
<td class:hidden={i > 3} class="p-2 border-r border-r-black">{player}</td>
|
||||
<td class:hidden={i > 3} class="p-2">{data[player]}</td>
|
||||
{#if show_new_score_clicked}
|
||||
<td
|
||||
in:fly={{ x: 300 }}
|
||||
class:hidden={i > 3}
|
||||
class='p-2'
|
||||
class="p-2"
|
||||
class:text-red-600={score_by_username[player] === 0 ||
|
||||
score_by_username[player] === undefined}
|
||||
>
|
||||
@@ -130,7 +130,7 @@ SPDX-License-Identifier: MPL-2.0
|
||||
</div>
|
||||
</div>
|
||||
{#if [QuizQuestionType.ABCD, QuizQuestionType.VOTING, QuizQuestionType.TEXT].includes(question.type)}
|
||||
<div class='mt-12'>
|
||||
<div class="mt-12">
|
||||
<VotingResults data={new_data} {question} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user