Added lobby-music

This commit is contained in:
Mawoka
2022-09-18 11:28:28 +02:00
parent 7b677f5eba
commit 1d6dceab82
7 changed files with 128 additions and 31 deletions
@@ -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);
});
</script>
<div class="w-screen p-8">