diff --git a/frontend/src/lib/components/buttons/brown.svelte b/frontend/src/lib/components/buttons/brown.svelte
index 459e25e..b9f4962 100644
--- a/frontend/src/lib/components/buttons/brown.svelte
+++ b/frontend/src/lib/components/buttons/brown.svelte
@@ -5,14 +5,29 @@ SPDX-License-Identifier: MPL-2.0
-->
{#if href}
@@ -24,21 +39,21 @@ SPDX-License-Identifier: MPL-2.0
class:cursor-not-allowed={disabled}
class:pointer-events-none={disabled}
class="text-black hover:bg-bg-[#B07156]/80 w-full px-4 py-2 leading-5 transition-all duration-200 transform bg-[#B07156] rounded-sm text-center outline-hidden hover:cursor-pointer"
- on:click
+ onclick={bubble('click')}
class:flex
class:justify-center={flex}
>
-
+ {@render children?.()}
{:else}
{/if}
diff --git a/frontend/src/lib/components/buttons/gray.svelte b/frontend/src/lib/components/buttons/gray.svelte
index dafe8b0..65705a6 100644
--- a/frontend/src/lib/components/buttons/gray.svelte
+++ b/frontend/src/lib/components/buttons/gray.svelte
@@ -5,11 +5,25 @@ SPDX-License-Identifier: MPL-2.0
-->
{#if href}
@@ -17,21 +31,21 @@ SPDX-License-Identifier: MPL-2.0
{href}
{target}
class="w-full px-4 py-2 leading-5 text-black dark:text-white transition-colors duration-200 transform bg-gray-50 dark:bg-gray-700 rounded-sm text-center hover:bg-gray-300 focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-gray-600"
- on:click
+ onclick={bubble('click')}
class:flex
class:block={!flex}
class:justify-center={flex}
>
-
+ {@render children?.()}
{:else}
{/if}
diff --git a/frontend/src/lib/components/commandpalette.svelte b/frontend/src/lib/components/commandpalette.svelte
index f0cd527..5bffadd 100644
--- a/frontend/src/lib/components/commandpalette.svelte
+++ b/frontend/src/lib/components/commandpalette.svelte
@@ -8,17 +8,19 @@ SPDX-License-Identifier: MPL-2.0
This should be okay, right?
-->
@@ -22,7 +26,7 @@ SPDX-License-Identifier: MPL-2.0
style="background-color: {color_map[
c.toLowerCase()
]}; width: 2rem; height: {c.toLowerCase() == c ? '2' : '4'}rem"
- />
+ >
{/each}
diff --git a/frontend/src/lib/components/popover/commandpalettenotice.svelte b/frontend/src/lib/components/popover/commandpalettenotice.svelte
index 4f419d1..e6d74ff 100644
--- a/frontend/src/lib/components/popover/commandpalettenotice.svelte
+++ b/frontend/src/lib/components/popover/commandpalettenotice.svelte
@@ -13,7 +13,7 @@ SPDX-License-Identifier: MPL-2.0
const { t } = getLocalization();
- let open = false;
+ let open = $state(false);
onMount(() => {
if (Cookies.get('commandpalette_notice')) {
return;
diff --git a/frontend/src/lib/components/popover/smalltop.svelte b/frontend/src/lib/components/popover/smalltop.svelte
index 9f1e091..822c528 100644
--- a/frontend/src/lib/components/popover/smalltop.svelte
+++ b/frontend/src/lib/components/popover/smalltop.svelte
@@ -5,6 +5,8 @@ SPDX-License-Identifier: MPL-2.0
-->
{#if open}
@@ -49,7 +56,7 @@ SPDX-License-Identifier: MPL-2.0
class="ml-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700"
data-dismiss-target="#toast-default"
aria-label="Close"
- on:click={() => {
+ onclick={() => {
open = false;
}}
>
diff --git a/frontend/src/lib/dashboard/main_slider.svelte b/frontend/src/lib/dashboard/main_slider.svelte
deleted file mode 100644
index 66ebca7..0000000
--- a/frontend/src/lib/dashboard/main_slider.svelte
+++ /dev/null
@@ -1,413 +0,0 @@
-
-
-
-
-{#if copy_toast_open || game_in_lobby}
-
-
-
- {#if copy_toast_open}ID copied to clipboard!
- {:else}A game is currently in the lobby. Click
here to join as a remote.
- {/if}
-
-
-
-
-{/if}
-
-
-
- {#each quizzes as quiz, i}
-
-
-
-
-
-
-
-
- {@html quiz.title}
-
-
-
- {@html quiz.description}
-
- {#if quiz.cover_image}
-
-
-

-
-
- {/if}
-
-
-
-
- {@html quiz.title}
-
-
-
-
-
- {quiz.questions.length}
- {$t('words.question', { count: quiz.questions.length })}
-
-
-
- {#if quiz.public}
-
-
{$t('words.public')}
- {:else}
-
-
{$t('words.private')}
- {/if}
-
-
-
-
{$t('words.edit')}
-
{
- start_game = quiz.id;
- }}
- >
- {$t('words.start')}
-
-
{
- deleteQuiz(quiz.id);
- }}
- flex={true}
- >
-
-
-
-
-
-
-
-
-
-
{
- copy_id(quiz.id);
- }}
- >
- {quiz.id}
-
-
-
- {#each quiz.questions as question, q}
-
-
-
- {@html question.question}
-
- {#if question.image}
-
{
- visibleImages[i][q] = true;
- }}
- on:exitViewport={() => {
- visibleImages[i][q] = false;
- }}
- class="flex justify-center align-middle items-center"
- >
-
- {#if visibleImages?.[i]?.[q]}
-

- {/if}
-
-
- {/if}
-
-
- {question.time}s
-
- {#if question.type === QuizQuestionType.ABCD || question.type === undefined}
-
- {#each question.answers as answer, index_answer}
-
-
- {answer.answer}
-
-
- {/each}
-
- {:else if question.type === QuizQuestionType.RANGE}
-
- All numbers between {question.answers.min_correct}
- and {question.answers.max_correct} are correct, where
- numbers between {question.answers.min} and {question
- .answers.max} can be selected.
-
- {:else if question.type === QuizQuestionType.VOTING}
-
- {#each question.answers as answer}
-
-
- {answer.answer}
-
-
- {/each}
-
- {:else if question.type === QuizQuestionType.ORDER}
-
- {#each question.answers as answer}
- -
-
- {answer.answer}
-
-
- {/each}
-
- {:else if question.type === QuizQuestionType.SLIDE}
-
{
- visibleImages[i][q] = true;
- }}
- on:exitViewport={() => {
- visibleImages[i][q] = false;
- }}
- class="flex justify-center align-middle items-center"
- >
- {#await import('$lib/play/admin/slide.svelte')}
-
- {:then c}
-
-
-
- {/await}
-
- {/if}
-
-
- {/each}
-
-
-
-
- {/each}
-
-
-
-{#if start_game !== null}
-
-{/if}
diff --git a/frontend/src/lib/dashboard/start_game.svelte b/frontend/src/lib/dashboard/start_game.svelte
index d663193..3e99827 100644
--- a/frontend/src/lib/dashboard/start_game.svelte
+++ b/frontend/src/lib/dashboard/start_game.svelte
@@ -15,13 +15,13 @@ SPDX-License-Identifier: MPL-2.0
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
- export let quiz_id;
- let captcha_selected = false;
- let selected_game_mode = 'kahoot';
- let loading = false;
- let custom_field = '';
- let cqcs_enabled = false;
- let randomized_answers = false;
+ let { quiz_id = $bindable() } = $props();
+ let captcha_selected = $state(false);
+ let selected_game_mode = $state('kahoot');
+ let loading = $state(false);
+ let custom_field = $state('');
+ let cqcs_enabled = $state(false);
+ let randomized_answers = $state(false);
const tippy = createTippy({
arrow: true,
@@ -96,7 +96,7 @@ SPDX-License-Identifier: MPL-2.0
+ >
Captcha {captcha_selected ? 'enabled' : 'disabled'}
@@ -136,7 +136,7 @@ SPDX-License-Identifier: MPL-2.0
{
+ onclick={() => {
selected_game_mode = 'kahoot';
}}
>
@@ -148,7 +148,7 @@ SPDX-License-Identifier: MPL-2.0
{
+ onclick={() => {
selected_game_mode = 'normal';
}}
>
@@ -176,7 +176,7 @@ SPDX-License-Identifier: MPL-2.0
/>
+ >
+ >
Randomize answers