File size: 1,977 Bytes
bb88c4d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<script lang="ts">
	import RoomsSelector from '$lib/Buttons/RoomsSelector.svelte';
	import AboutButton from '$lib/Buttons/AboutButton.svelte';
	import { toggleAbout } from '$lib/store';
	import { createEventDispatcher } from 'svelte';

	const dispatch = createEventDispatcher();
	// const broadcast = useBroadcastEvent();

	export let isLoading = false;
</script>

<svelte:window
	on:keypress={(e) => {
		if (e.key === 'Enter') {
			dispatch('showModal', { showModal: true });
		}
	}}
/>
<div class="flex flex-col md:flex-row items-center justify-between px-4 md:px-12 gap-3 md:gap-0">
	<AboutButton
		{isLoading}
		on:click={() => {
			$toggleAbout = !$toggleAbout;
		}}
	/>

	<button
		on:click={() => dispatch('showModal', { showModal: true })}
		title="Click to prompt, and paint. The generated image will show up in the frame."
		disabled={isLoading}
		class="{isLoading
			? 'cursor-wait'
			: 'cursor-pointer'} order-first md:order-none text-xl md:text-3xl bg-blue-600 text-white px-4 py-1 md:px-6 md:py-2 rounded-2xl ring ring-blue-500 font-semibold shadow-2xl shadow-blue-500 self-center flex items-center hover:saturate-150"
		><span class="mr-3">🖍</span>Paint
		<span
			class="bg-blue-800 text-gray-300 rounded-lg px-2 py-0.5 text-base ml-4 hidden sm:flex items-center translate-y-[2px]"
			><svg
				class="text-sm mr-1.5"
				width="1em"
				height="1em"
				viewBox="0 0 10 13"
				fill="currentColor"
				xmlns="http://www.w3.org/2000/svg"
			>
				<path
					fill-rule="evenodd"
					clip-rule="evenodd"
					d="M8.5 8.5V0H9.5V9.5H1.70711L4.03553 11.8284C4.2308 12.0237 4.2308 12.3403 4.03553 12.5355C3.84027 12.7308 3.52369 12.7308 3.32843 12.5355L0.146447 9.35355C-0.0488155 9.15829 -0.0488155 8.84171 0.146447 8.64645L3.32843 5.46447C3.52369 5.2692 3.84027 5.2692 4.03553 5.46447C4.2308 5.65973 4.2308 5.97631 4.03553 6.17157L1.70711 8.5H8.5Z"
					fill="currentColor"
				/>
			</svg>
			Enter</span
		></button
	>
	<RoomsSelector {isLoading} />
</div>