File size: 930 Bytes
66ed450
7d4e291
4346adf
67cbe97
 
be26971
5bdc2c3
7d4e291
 
5636b7a
7d4e291
 
 
 
 
 
 
 
66ed450
 
67cbe97
5bdc2c3
536b6c6
d16a2c1
 
 
 
 
 
 
67cbe97
66ed450
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<script lang="ts">
	import { onMount, createEventDispatcher } from 'svelte';
	import PPButton from '$lib/Buttons/PPButton.svelte';
	import RoomsSelector from '$lib/Buttons/RoomsSelector.svelte';
	import LiveBlocks from '$lib/Icons/LiveBlocks.svelte';
	const dispatch = createEventDispatcher();
	export let isLoading = false;
	const onKeyup = (e: KeyboardEvent) => {
		if (e.key === 'Enter') {
			dispatch('prompt');
		}
	};
	onMount(() => {
		window.addEventListener('keyup', onKeyup);
		return () => {
			window.removeEventListener('keyup', onKeyup);
		};
	});
</script>

<div class="grid grid-cols-1 gap-1 w-max mx-auto place-items-center">
	<PPButton {isLoading} on:click={() => dispatch('prompt')} />
	<RoomsSelector {isLoading} />
	<a
		href="https://liveblocks.io"
		target="_blank"
		rel="noopener noreferrer"
		title="Multiplayer backend by LiveBlocks.io"
	>
		<LiveBlocks classList="max-h-8 md:max-h-fit" />
	</a>
</div>