-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add quiz settings dialog with toggle for question shuffling
- Loading branch information
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
export let checked = false; | ||
export let label = ''; | ||
export let icon: any = undefined; | ||
</script> | ||
|
||
<label class="flex items-center gap-4 cursor-pointer"> | ||
{#if icon} | ||
<div class="w-6 h-6"> | ||
<svelte:component this={icon} /> | ||
</div> | ||
{/if} | ||
<div class="flex items-center"> | ||
<input type="checkbox" bind:checked class="sr-only peer" on:change /> | ||
<div | ||
class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-thw-200 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-thw-500" | ||
></div> | ||
{#if label} | ||
<span class="ms-3">{label}</span> | ||
{/if} | ||
</div> | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import Dialog from '$lib/Dialog.svelte'; | ||
import Button from '$lib/Button.svelte'; | ||
import Toggle from '$lib/Toggle.svelte'; | ||
import shuffleQuiz from '$lib/shared/stores/shuffleQuiz'; | ||
export let onClose: () => void = () => {}; | ||
</script> | ||
|
||
<Dialog title="Quiz Einstellungen"> | ||
<div slot="content" class="flex flex-col gap-4"> | ||
<div class="text-sm text-gray-600"> | ||
Hier kannst du einstellen, wie die Fragen angezeigt werden sollen. | ||
</div> | ||
<Toggle bind:checked={$shuffleQuiz} label="Fragen in zufälliger Reihenfolge anzeigen" /> | ||
</div> | ||
<div slot="footer" class="flex flex-row justify-end w-full"> | ||
<Button click={onClose}>Schließen</Button> | ||
</div> | ||
</Dialog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters