diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 592329e..f242a9e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - - id: check-added-large-files +# - id: check-added-large-files - repo: https://github.com/psf/black rev: 22.8.0 diff --git a/frontend/src/lib/assets/music/1-128.mp3 b/frontend/src/lib/assets/music/1-128.mp3 new file mode 100644 index 0000000..af1c0ae Binary files /dev/null and b/frontend/src/lib/assets/music/1-128.mp3 differ diff --git a/frontend/src/lib/assets/music/1_original.mp3 b/frontend/src/lib/assets/music/1_original.mp3 new file mode 100644 index 0000000..088da92 Binary files /dev/null and b/frontend/src/lib/assets/music/1_original.mp3 differ diff --git a/frontend/src/lib/dashboard/main_slider.svelte b/frontend/src/lib/dashboard/main_slider.svelte index fae683d..70ba792 100644 --- a/frontend/src/lib/dashboard/main_slider.svelte +++ b/frontend/src/lib/dashboard/main_slider.svelte @@ -12,6 +12,7 @@ import { QuizQuestionType } from '$lib/quiz_types.js'; import { getLocalization } from '../i18n'; import StartGamePopup from './start_game.svelte'; + import { onMount } from 'svelte'; let start_game = null; const { t } = getLocalization(); @@ -26,6 +27,14 @@ }); window.location.reload(); }; + const close_start_game_if_esc_is_pressed = (key: KeyboardEvent) => { + if (key.code === 'Escape') { + start_game = null; + } + }; + onMount(() => { + document.body.addEventListener('keydown', close_start_game_if_esc_is_pressed); + });
diff --git a/frontend/src/lib/dashboard/start_game.svelte b/frontend/src/lib/dashboard/start_game.svelte index 3502ce0..540c925 100644 --- a/frontend/src/lib/dashboard/start_game.svelte +++ b/frontend/src/lib/dashboard/start_game.svelte @@ -7,6 +7,7 @@ import { alertModal } from '$lib/stores'; import { captcha_enabled } from '$lib/config'; import StartGameBackground from './start_game_background.svg'; + import { fade } from 'svelte/transition'; export let quiz_id; let captcha_selected = false; @@ -48,7 +49,10 @@ }; -
+
+ + +
+ {#if play} + + {:else} + + {/if} + +
diff --git a/frontend/src/routes/admin/+page.svelte b/frontend/src/routes/admin/+page.svelte index b2a04ea..6967a66 100644 --- a/frontend/src/routes/admin/+page.svelte +++ b/frontend/src/routes/admin/+page.svelte @@ -11,6 +11,7 @@ import { navbarVisible } from '$lib/stores'; import type { PlayerAnswer, Player } from '$lib/admin.ts'; import SomeAdminScreen from '$lib/admin.svelte'; + import AudioPlayer from '$lib/play/audio_player.svelte'; import { browser } from '$app/environment'; import { onMount } from 'svelte'; @@ -36,6 +37,7 @@ let success = false; let dataexport_download_a; let warnToLeave = true; + let play_music = false; const connect = async () => { socket.emit('register_as_admin', { @@ -128,37 +130,40 @@

{errorMessage}

{/if} {:else if !game_started} - QR code to join the game -

{$t('words.pin')}: {quiz_data.game_pin}

-
-
    - {#if players.length > 0} - {#each players as player} -
  • - {player.username} - -
  • - {/each} - {/if} -
-
- {#if players.length > 0} +
+ + QR code to join the game +

{$t('words.pin')}: {quiz_data.game_pin}

- +
    + {#if players.length > 0} + {#each players as player} +
  • + {player.username} + +
  • + {/each} + {/if} +
- {/if} + {#if players.length > 0} +
+ +
+ {/if} +
{:else}