Spaces:
Runtime error
Runtime error
fix share to commnuity
Browse files
frontend/src/lib/App.svelte
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
import PromptModal from '$lib/PromptModal.svelte';
|
8 |
import { COLORS } from '$lib/constants';
|
9 |
import { PUBLIC_WS_INPAINTING } from '$env/static/public';
|
10 |
-
import type { PromptImgKey
|
11 |
import { Status } from '$lib/types';
|
12 |
import {
|
13 |
loadingState,
|
@@ -203,7 +203,7 @@
|
|
203 |
{/if}
|
204 |
</main>
|
205 |
</div>
|
206 |
-
<div class="fixed bottom-
|
207 |
<Menu on:prompt={onPrompt} {isLoading} />
|
208 |
</div>
|
209 |
|
|
|
7 |
import PromptModal from '$lib/PromptModal.svelte';
|
8 |
import { COLORS } from '$lib/constants';
|
9 |
import { PUBLIC_WS_INPAINTING } from '$env/static/public';
|
10 |
+
import type { PromptImgKey } from '$lib/types';
|
11 |
import { Status } from '$lib/types';
|
12 |
import {
|
13 |
loadingState,
|
|
|
203 |
{/if}
|
204 |
</main>
|
205 |
</div>
|
206 |
+
<div class="fixed bottom-0 md:bottom-16 left-0 right-0 z-10 my-2">
|
207 |
<Menu on:prompt={onPrompt} {isLoading} />
|
208 |
</div>
|
209 |
|
frontend/src/lib/Buttons/AboutButton.svelte
CHANGED
@@ -1,17 +1,24 @@
|
|
1 |
-
<
|
2 |
-
|
|
|
|
|
|
|
|
|
3 |
Instructions: move the <span class="text-blue-700 bg-blue-300/60 px-0.5">blue square</span>,
|
4 |
click "π Paint".
|
5 |
</p>
|
6 |
-
<
|
7 |
-
<
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
17 |
</div>
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import ShareWithCommunity from './ShareWithCommunity.svelte';
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<div class="md:w-[210px] text-sm md:flex flex-col order-last md:order-none">
|
6 |
+
<p class="inline">
|
7 |
Instructions: move the <span class="text-blue-700 bg-blue-300/60 px-0.5">blue square</span>,
|
8 |
click "π Paint".
|
9 |
</p>
|
10 |
+
<div class="flex justify-between py-2 gap-3">
|
11 |
+
<button on:click class="items-center inline-flex">
|
12 |
+
<svg width=".9em" height=".9em" viewBox="0 0 24 24" class="mr-1"
|
13 |
+
><path
|
14 |
+
fill="currentColor"
|
15 |
+
fill-rule="evenodd"
|
16 |
+
d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10s10-4.477 10-10S17.523 2 12 2zm0 7a1 1 0 0 0-1 1a1 1 0 1 1-2 0a3 3 0 1 1 4.44 2.633a1.404 1.404 0 0 0-.383.288a.303.303 0 0 0-.057.085v.494a1 1 0 1 1-2 0V13c0-.58.253-1.047.539-1.38c.281-.33.63-.572.94-.742A1 1 0 0 0 12 9zm.999 4.011v-.004v.005zM12 15a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H12z"
|
17 |
+
clip-rule="evenodd"
|
18 |
+
/></svg
|
19 |
+
>
|
20 |
+
About
|
21 |
+
</button>
|
22 |
+
<ShareWithCommunity classList={''} />
|
23 |
+
</div>
|
24 |
</div>
|
frontend/src/lib/Buttons/ShareWithCommunity.svelte
CHANGED
@@ -5,8 +5,9 @@
|
|
5 |
import { canvasEl, selectedRoomID } from '$lib/store';
|
6 |
import { nanoid } from 'nanoid';
|
7 |
|
8 |
-
let
|
9 |
|
|
|
10 |
async function handleClick() {
|
11 |
if (isUploading) {
|
12 |
return;
|
@@ -49,7 +50,7 @@ ${canvasImage}
|
|
49 |
|
50 |
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
51 |
<div
|
52 |
-
class="text-xs font-mono flex items-center justify-center bg-black gap-x-1 rounded-xl cursor-pointer px-2 py-1"
|
53 |
on:click={handleClick}
|
54 |
title="Share with community"
|
55 |
>
|
|
|
5 |
import { canvasEl, selectedRoomID } from '$lib/store';
|
6 |
import { nanoid } from 'nanoid';
|
7 |
|
8 |
+
export let classList = '';
|
9 |
|
10 |
+
let isUploading: boolean = false;
|
11 |
async function handleClick() {
|
12 |
if (isUploading) {
|
13 |
return;
|
|
|
50 |
|
51 |
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
52 |
<div
|
53 |
+
class="{classList} text-xs font-mono flex items-center justify-center bg-black gap-x-1 rounded-xl cursor-pointer px-2 py-1 whitespace-nowrap"
|
54 |
on:click={handleClick}
|
55 |
title="Share with community"
|
56 |
>
|
frontend/src/lib/Menu.svelte
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
import RoomsSelector from '$lib/Buttons/RoomsSelector.svelte';
|
4 |
import AboutButton from '$lib/Buttons/AboutButton.svelte';
|
5 |
import { toggleAbout } from '$lib/store';
|
6 |
-
import ShareWithCommunity from '$lib/Buttons/ShareWithCommunity.svelte';
|
7 |
// const broadcast = useBroadcastEvent();
|
8 |
|
9 |
const dispatch = createEventDispatcher();
|
@@ -15,16 +14,11 @@
|
|
15 |
on:keyup|preventDefault|stopPropagation={(e) => e.key === 'Enter' && dispatch('prompt')}
|
16 |
/>
|
17 |
<div class="flex flex-col md:flex-row items-center justify-between px-4 md:px-12 gap-3 md:gap-0">
|
18 |
-
<
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
/>
|
24 |
-
<div class="order-last max-w-[20ch]">
|
25 |
-
<ShareWithCommunity />
|
26 |
-
</div>
|
27 |
-
</div>
|
28 |
|
29 |
<button
|
30 |
on:click={() => dispatch('prompt')}
|
@@ -32,7 +26,7 @@
|
|
32 |
disabled={isLoading}
|
33 |
class="{isLoading
|
34 |
? 'cursor-wait'
|
35 |
-
: 'cursor-pointer'} order-first md:order-none text-xl md:text-3xl bg-blue-600 text-white px-6 py-2 rounded-2xl ring ring-blue-500 font-semibold shadow-2xl shadow-blue-500 self-center flex items-center hover:saturate-150"
|
36 |
><span class="mr-3">π</span>Paint
|
37 |
<span
|
38 |
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]"
|
|
|
3 |
import RoomsSelector from '$lib/Buttons/RoomsSelector.svelte';
|
4 |
import AboutButton from '$lib/Buttons/AboutButton.svelte';
|
5 |
import { toggleAbout } from '$lib/store';
|
|
|
6 |
// const broadcast = useBroadcastEvent();
|
7 |
|
8 |
const dispatch = createEventDispatcher();
|
|
|
14 |
on:keyup|preventDefault|stopPropagation={(e) => e.key === 'Enter' && dispatch('prompt')}
|
15 |
/>
|
16 |
<div class="flex flex-col md:flex-row items-center justify-between px-4 md:px-12 gap-3 md:gap-0">
|
17 |
+
<AboutButton
|
18 |
+
on:click={() => {
|
19 |
+
$toggleAbout = !$toggleAbout;
|
20 |
+
}}
|
21 |
+
/>
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
<button
|
24 |
on:click={() => dispatch('prompt')}
|
|
|
26 |
disabled={isLoading}
|
27 |
class="{isLoading
|
28 |
? 'cursor-wait'
|
29 |
+
: '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"
|
30 |
><span class="mr-3">π</span>Paint
|
31 |
<span
|
32 |
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]"
|
frontend/src/routes/+page.svelte
CHANGED
@@ -4,7 +4,6 @@
|
|
4 |
import type { Client } from '@liveblocks/client';
|
5 |
import LiveblocksProvider from '$lib/liveblocks/LiveblocksProvider.svelte';
|
6 |
import RoomProvider from '$lib/liveblocks/RoomProvider.svelte';
|
7 |
-
import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
|
8 |
import App from '$lib/App.svelte';
|
9 |
import About from '$lib/About.svelte';
|
10 |
import { PUBLIC_API_BASE } from '$env/static/public';
|
|
|
4 |
import type { Client } from '@liveblocks/client';
|
5 |
import LiveblocksProvider from '$lib/liveblocks/LiveblocksProvider.svelte';
|
6 |
import RoomProvider from '$lib/liveblocks/RoomProvider.svelte';
|
|
|
7 |
import App from '$lib/App.svelte';
|
8 |
import About from '$lib/About.svelte';
|
9 |
import { PUBLIC_API_BASE } from '$env/static/public';
|