Skip to content

Commit

Permalink
✨ QR-Code for joining goes full-screen on click
Browse files Browse the repository at this point in the history
  • Loading branch information
mawoka-myblock committed Oct 21, 2023
1 parent 88a3c2e commit 2079b3f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions frontend/src/lib/play/admin/game_not_started.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ SPDX-License-Identifier: MPL-2.0
import ControllerCodeDisplay from '$lib/components/controller/code.svelte';
import { getLocalization } from '$lib/i18n';
import GrayButton from '$lib/components/buttons/gray.svelte';
import {fade} from 'svelte/transition';
export let game_pin: string;
export let players;
export let socket;
export let cqc_code: string;
let fullscreen_open = false
const { t } = getLocalization();
let play_music = false;
Expand Down Expand Up @@ -50,9 +52,10 @@ SPDX-License-Identifier: MPL-2.0
</p>
</div>
<img
on:click={() => fullscreen_open = true}
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"
class="block mx-auto w-1/2 dark:bg-white shadow-2xl rounded hover:cursor-pointer"
/>
{#if cqc_code}
<div class="m-auto">
Expand Down Expand Up @@ -108,3 +111,17 @@ SPDX-License-Identifier: MPL-2.0
{/if}
</div>
</div>

{#if fullscreen_open}
<div
class="fixed top-0 left-0 z-50 w-screen h-screen bg-black bg-opacity-50 fle p-2"
transition:fade={{ duration: 80 }}
on:click={() => (fullscreen_open = false)}
>
<img
alt="QR code to join the game"
src="/api/v1/utils/qr/{game_pin}"
class="object-contain rounded m-auto h-full bg-white"
/>
</div>
{/if}

0 comments on commit 2079b3f

Please sign in to comment.