radames commited on
Commit
5a291b2
β€’
2 Parent(s): f04048d d64cefe

Merge branch 'ui-update-2'

Browse files
frontend/src/lib/App.svelte CHANGED
@@ -190,7 +190,7 @@
190
  <!-- <div class="fixed top-0 right-0 z-10 p-2">
191
  <ShareWithCommunity />
192
  </div> -->
193
- <div class="fixed bottom-32 left-0 right-0 z-10 my-2">
194
  <Menu on:prompt={onPrompt} {isLoading} />
195
  </div>
196
 
 
190
  <!-- <div class="fixed top-0 right-0 z-10 p-2">
191
  <ShareWithCommunity />
192
  </div> -->
193
+ <div class="fixed bottom-4 md:bottom-32 left-0 right-0 z-10 my-2">
194
  <Menu on:prompt={onPrompt} {isLoading} />
195
  </div>
196
 
frontend/src/lib/Buttons/AboutButton.svelte CHANGED
@@ -1,5 +1,13 @@
1
- <button on:click title="Prompt and Paint" class="underline w-[210px] text-sm">
2
- <span>About</span>
 
 
 
 
 
 
 
 
3
  </button>
4
 
5
  <style lang="postcss" scoped>
 
1
+ <button on:click class="md:w-[210px] text-sm flex items-center order-last md:order-none">
2
+ <svg width=".9em" height=".9em" viewBox="0 0 24 24" class="mr-1"
3
+ ><path
4
+ fill="currentColor"
5
+ fill-rule="evenodd"
6
+ 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"
7
+ clip-rule="evenodd"
8
+ /></svg
9
+ >
10
+ About
11
  </button>
12
 
13
  <style lang="postcss" scoped>
frontend/src/lib/Buttons/RoomsSelector.svelte CHANGED
@@ -3,6 +3,7 @@
3
  import Room from '$lib/Icons/Room.svelte';
4
  import Pin from '$lib/Icons/Pin.svelte';
5
  import People from '$lib/Icons/People.svelte';
 
6
  import { onMount } from 'svelte';
7
  import { selectedRoomID } from '$lib/store';
8
  import { MAX_CAPACITY } from '$lib/constants';
@@ -42,8 +43,7 @@
42
  <div class="min-w-[25ch]">
43
  {#if loadingRooms}
44
  <div
45
- class="text-xs rounded md:text-smtext-gray-700 py-1 font-medium tracking-tight relative z-0
46
- {isLoading ? 'opacity-50' : ''}"
47
  title="Choose a different room"
48
  bind:this={boxEl}
49
  >
@@ -108,6 +108,12 @@
108
  {/if}
109
  </div>
110
  </div>
 
 
 
 
 
 
111
  {/if}
112
  </div>
113
 
 
3
  import Room from '$lib/Icons/Room.svelte';
4
  import Pin from '$lib/Icons/Pin.svelte';
5
  import People from '$lib/Icons/People.svelte';
6
+ import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
7
  import { onMount } from 'svelte';
8
  import { selectedRoomID } from '$lib/store';
9
  import { MAX_CAPACITY } from '$lib/constants';
 
43
  <div class="min-w-[25ch]">
44
  {#if loadingRooms}
45
  <div
46
+ class="text-sm rounded md:text-smtext-gray-700 py-1 font-medium tracking-tight relative"
 
47
  title="Choose a different room"
48
  bind:this={boxEl}
49
  >
 
108
  {/if}
109
  </div>
110
  </div>
111
+ {:else}
112
+ <div
113
+ class="bg-gradient-to-r from-transparent via-blue-900/20 to-transparent py-1.5 text-blue-700 rounded-full flex justify-center items-center"
114
+ >
115
+ <LoadingIcon classList="animate-spin mr-2 text-sm" /> loading rooms
116
+ </div>
117
  {/if}
118
  </div>
119
 
frontend/src/lib/Icons/Cursor.svelte CHANGED
@@ -18,7 +18,7 @@
18
  fill-rule="evenodd"
19
  clip-rule="evenodd"
20
  d="M3.66305 9.86091L0.856101 3.49392C0.119663 1.82347 1.82248 0.120639 3.49294 0.857077L9.85994 3.66402C11.5607 4.41383 11.4082 6.87562 9.62784 7.40973L7.92085 7.92182L7.40875 9.62881C6.87465 11.4092 4.41286 11.5617 3.66305 9.86091ZM1.77113 3.09053C1.40291 2.2553 2.25432 1.40388 3.08955 1.7721L9.45654 4.57905C10.3069 4.95395 10.2307 6.18485 9.34049 6.4519L7.6335 6.964C7.31152 7.06059 7.05961 7.3125 6.96302 7.63448L6.45093 9.34146C6.18387 10.2316 4.95298 10.3079 4.57807 9.45751L1.77113 3.09053Z"
21
- {fill}
22
- fill-opacity="0.2"
23
  />
24
  </svg>
 
18
  fill-rule="evenodd"
19
  clip-rule="evenodd"
20
  d="M3.66305 9.86091L0.856101 3.49392C0.119663 1.82347 1.82248 0.120639 3.49294 0.857077L9.85994 3.66402C11.5607 4.41383 11.4082 6.87562 9.62784 7.40973L7.92085 7.92182L7.40875 9.62881C6.87465 11.4092 4.41286 11.5617 3.66305 9.86091ZM1.77113 3.09053C1.40291 2.2553 2.25432 1.40388 3.08955 1.7721L9.45654 4.57905C10.3069 4.95395 10.2307 6.18485 9.34049 6.4519L7.6335 6.964C7.31152 7.06059 7.05961 7.3125 6.96302 7.63448L6.45093 9.34146C6.18387 10.2316 4.95298 10.3079 4.57807 9.45751L1.77113 3.09053Z"
21
+ fill="white"
22
+ fill-opacity="0.8"
23
  />
24
  </svg>
frontend/src/lib/Icons/Pin.svelte CHANGED
@@ -2,9 +2,15 @@
2
  export let classList = '';
3
  </script>
4
 
5
- <svg class={classList} height="1em" viewBox="0 0 7 9" fill="none" xmlns="http://www.w3.org/2000/svg">
 
 
 
 
 
 
6
  <path
7
  d="M3.5 4.58599C3.74063 4.58599 3.94669 4.4961 4.11819 4.31633C4.2894 4.13687 4.375 3.92102 4.375 3.66879C4.375 3.41656 4.2894 3.20056 4.11819 3.02079C3.94669 2.84132 3.74063 2.75159 3.5 2.75159C3.25937 2.75159 3.05346 2.84132 2.88225 3.02079C2.71075 3.20056 2.625 3.41656 2.625 3.66879C2.625 3.92102 2.71075 4.13687 2.88225 4.31633C3.05346 4.4961 3.25937 4.58599 3.5 4.58599ZM3.5 7.95669C4.38958 7.10064 5.04948 6.32285 5.47969 5.62334C5.9099 4.92413 6.125 4.30318 6.125 3.76051C6.125 2.92739 5.87154 2.24515 5.36462 1.71378C4.858 1.18273 4.23646 0.917197 3.5 0.917197C2.76354 0.917197 2.14185 1.18273 1.63494 1.71378C1.12831 2.24515 0.875 2.92739 0.875 3.76051C0.875 4.30318 1.0901 4.92413 1.52031 5.62334C1.95052 6.32285 2.61042 7.10064 3.5 7.95669ZM3.5 9C3.44167 9 3.38333 8.98853 3.325 8.9656C3.26667 8.94267 3.21562 8.9121 3.17188 8.87389C2.10729 7.8879 1.3125 6.97269 0.7875 6.12825C0.2625 5.28352 0 4.49427 0 3.76051C0 2.61401 0.351896 1.70064 1.05569 1.02038C1.75919 0.340127 2.57396 0 3.5 0C4.42604 0 5.24081 0.340127 5.94431 1.02038C6.6481 1.70064 7 2.61401 7 3.76051C7 4.49427 6.7375 5.28352 6.2125 6.12825C5.6875 6.97269 4.89271 7.8879 3.82812 8.87389C3.78438 8.9121 3.73333 8.94267 3.675 8.9656C3.61667 8.98853 3.55833 9 3.5 9Z"
8
- fill="#338D4C"
9
  />
10
  </svg>
 
2
  export let classList = '';
3
  </script>
4
 
5
+ <svg
6
+ class={classList}
7
+ height="1em"
8
+ viewBox="0 0 7 9"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ >
12
  <path
13
  d="M3.5 4.58599C3.74063 4.58599 3.94669 4.4961 4.11819 4.31633C4.2894 4.13687 4.375 3.92102 4.375 3.66879C4.375 3.41656 4.2894 3.20056 4.11819 3.02079C3.94669 2.84132 3.74063 2.75159 3.5 2.75159C3.25937 2.75159 3.05346 2.84132 2.88225 3.02079C2.71075 3.20056 2.625 3.41656 2.625 3.66879C2.625 3.92102 2.71075 4.13687 2.88225 4.31633C3.05346 4.4961 3.25937 4.58599 3.5 4.58599ZM3.5 7.95669C4.38958 7.10064 5.04948 6.32285 5.47969 5.62334C5.9099 4.92413 6.125 4.30318 6.125 3.76051C6.125 2.92739 5.87154 2.24515 5.36462 1.71378C4.858 1.18273 4.23646 0.917197 3.5 0.917197C2.76354 0.917197 2.14185 1.18273 1.63494 1.71378C1.12831 2.24515 0.875 2.92739 0.875 3.76051C0.875 4.30318 1.0901 4.92413 1.52031 5.62334C1.95052 6.32285 2.61042 7.10064 3.5 7.95669ZM3.5 9C3.44167 9 3.38333 8.98853 3.325 8.9656C3.26667 8.94267 3.21562 8.9121 3.17188 8.87389C2.10729 7.8879 1.3125 6.97269 0.7875 6.12825C0.2625 5.28352 0 4.49427 0 3.76051C0 2.61401 0.351896 1.70064 1.05569 1.02038C1.75919 0.340127 2.57396 0 3.5 0C4.42604 0 5.24081 0.340127 5.94431 1.02038C6.6481 1.70064 7 2.61401 7 3.76051C7 4.49427 6.7375 5.28352 6.2125 6.12825C5.6875 6.97269 4.89271 7.8879 3.82812 8.87389C3.78438 8.9121 3.73333 8.94267 3.675 8.9656C3.61667 8.98853 3.55833 9 3.5 9Z"
14
+ fill="white"
15
  />
16
  </svg>
frontend/src/lib/Menu.svelte CHANGED
@@ -1,42 +1,51 @@
1
  <script lang="ts">
2
- import { onMount, createEventDispatcher } from 'svelte';
3
- import PPButton from '$lib/Buttons/PPButton.svelte';
4
  import RoomsSelector from '$lib/Buttons/RoomsSelector.svelte';
5
  import AboutButton from '$lib/Buttons/AboutButton.svelte';
6
  import { toggleAbout } from '$lib/store';
7
- // import { useBroadcastEvent } from '$lib/liveblocks';
8
 
9
  // const broadcast = useBroadcastEvent();
10
 
11
  const dispatch = createEventDispatcher();
12
 
13
  export let isLoading = false;
14
-
15
- const onKeyup = (e: KeyboardEvent) => {
16
- if (e.key === 'Enter') {
17
- dispatch('prompt');
18
- }
19
- };
20
- onMount(() => {
21
- window.addEventListener('keyup', onKeyup);
22
- return () => {
23
- window.removeEventListener('keyup', onKeyup);
24
- };
25
- });
26
  </script>
27
 
28
- <div class="flex items-center justify-between px-12">
 
 
 
29
  <AboutButton
30
  on:click={() => {
31
  $toggleAbout = !$toggleAbout;
32
- // broadcast({ type: 'EMOJI', emoji: 'πŸ”₯' });
33
  }}
34
  />
35
 
36
  <button
37
  on:click={() => dispatch('prompt')}
38
- class="text-3xl bg-blue-600 text-white px-6 py-2 rounded-2xl ring ring-blue-500 font-semibold shadow-2xl self-center"
39
- >πŸ– Paint</button
40
- ><RoomsSelector {isLoading} />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  <!-- <PPButton {isLoading} on:click={() => dispatch('prompt')} /> -->
42
  </div>
 
1
  <script lang="ts">
2
+ import { createEventDispatcher } from 'svelte';
 
3
  import RoomsSelector from '$lib/Buttons/RoomsSelector.svelte';
4
  import AboutButton from '$lib/Buttons/AboutButton.svelte';
5
  import { toggleAbout } from '$lib/store';
 
6
 
7
  // const broadcast = useBroadcastEvent();
8
 
9
  const dispatch = createEventDispatcher();
10
 
11
  export let isLoading = false;
 
 
 
 
 
 
 
 
 
 
 
 
12
  </script>
13
 
14
+ <svelte:window
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-12 gap-4 md:gap-0">
18
  <AboutButton
19
  on:click={() => {
20
  $toggleAbout = !$toggleAbout;
 
21
  }}
22
  />
23
 
24
  <button
25
  on:click={() => dispatch('prompt')}
26
+ class="order-first md:order-none text-3xl bg-blue-600 text-white px-6 py-2 rounded-2xl ring ring-blue-500 font-semibold shadow-2xl self-center flex items-center hover:saturate-150"
27
+ ><span class="mr-3">πŸ–</span>Paint
28
+ <span
29
+ 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]"
30
+ ><svg
31
+ class="text-sm mr-1.5"
32
+ width="1em"
33
+ height="1em"
34
+ viewBox="0 0 10 13"
35
+ fill="currentColor"
36
+ xmlns="http://www.w3.org/2000/svg"
37
+ >
38
+ <path
39
+ fill-rule="evenodd"
40
+ clip-rule="evenodd"
41
+ 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"
42
+ fill="currentColor"
43
+ />
44
+ </svg>
45
+ Enter</span
46
+ ></button
47
+ >
48
+
49
+ <RoomsSelector {isLoading} />
50
  <!-- <PPButton {isLoading} on:click={() => dispatch('prompt')} /> -->
51
  </div>
frontend/src/lib/PaintCanvas.svelte CHANGED
@@ -153,13 +153,13 @@
153
 
154
  <div
155
  bind:this={containerEl}
156
- class="absolute top-0 left-0 right-0 bottom-0 overflow-hidden z-0 bg-gray-200"
157
  >
158
  <canvas
159
  bind:this={$canvasEl}
160
  {width}
161
  {height}
162
- class="absolute top-0 left-0 bg-white shadow-2xl"
163
  />
164
  <slot />
165
  </div>
 
153
 
154
  <div
155
  bind:this={containerEl}
156
+ class="absolute top-0 left-0 right-0 bottom-0 overflow-hidden z-0 bg-blue-200/20"
157
  >
158
  <canvas
159
  bind:this={$canvasEl}
160
  {width}
161
  {height}
162
+ class="absolute top-0 left-0 bg-white shadow-2xl shadow-blue-500/20"
163
  />
164
  <slot />
165
  </div>
frontend/src/lib/PaintFrame.svelte CHANGED
@@ -1,8 +1,4 @@
1
  <script lang="ts">
2
- import PPButton from '$lib/Buttons/PPButton.svelte';
3
- import DragButton from '$lib/Buttons/DragButton.svelte';
4
- import MaskButton from '$lib/Buttons/MaskButton.svelte';
5
- import UndoButton from '$lib/Buttons/UndoButton.svelte';
6
  import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
7
  import { CANVAS_SIZE, FRAME_SIZE } from '$lib/constants';
8
 
@@ -285,22 +281,6 @@
285
  /></svg
286
  >
287
  </button>
288
- <!-- <PPButton {isLoading} on:click={() => dispatch('prompt')} /> -->
289
-
290
- <!-- <DragButton className={'p-1'} {isLoading} isActive={dragEnabled} on:click={toggleDrag} /> -->
291
- <!-- <div class="bg-blue-700 rounded-lg shadow-lg">
292
- azeeza
293
- <MaskButton
294
- {isLoading}
295
- className={'p-1'}
296
- isActive={!dragEnabled}
297
- on:click={toggleDrawMask}
298
- />
299
- {#if !dragEnabled}
300
- <span class="border-gray-800 border-opacity-50 border-r-2 my-2" />
301
- <UndoButton className={'p-1'} {isLoading} on:click={cleanMask} />
302
- {/if}
303
- </div> -->
304
  </div>
305
  {/if}
306
  </div>
 
1
  <script lang="ts">
 
 
 
 
2
  import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
3
  import { CANVAS_SIZE, FRAME_SIZE } from '$lib/constants';
4
 
 
281
  /></svg
282
  >
283
  </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  </div>
285
  {/if}
286
  </div>
frontend/src/lib/PromptModal.svelte CHANGED
@@ -64,10 +64,10 @@
64
 
65
  <form
66
  class="fixed w-screen top-0 left-0 bottom-0 right-0 max-h-screen z-50 flex items-center justify-center bg-black bg-opacity-80"
67
- on:submit|preventDefault={onPrompt}
68
  >
69
  <div
70
- class="flex bg-white itemx-center overflow-hidden rounded-lg w-full max-w-lg 2xl:max-w-xl"
71
  bind:this={boxEl}
72
  >
73
  <input
@@ -75,16 +75,16 @@
75
  bind:this={inputEl}
76
  on:click|stopPropagation
77
  on:input={onInput}
78
- class="flex-1 outline-none ring-0 border-none text-xl 2xl:text-2xl"
79
  placeholder="Describe your prompt"
80
  title="Input prompt to generate image and obtain palette"
81
  type="text"
82
  name="prompt"
83
  />
84
  <button
85
- on:click|preventDefault={onPrompt}
86
- class="font-bold bg-blue-700 text-white border-l-2 px-5 text-xl 2xl:text-2xl spacing tracking-wide"
87
- type="submit"><span class="mr-2">πŸ–Œ</span> Paint</button
88
- >
89
  </div>
90
  </form>
 
64
 
65
  <form
66
  class="fixed w-screen top-0 left-0 bottom-0 right-0 max-h-screen z-50 flex items-center justify-center bg-black bg-opacity-80"
67
+ on:submit|preventDefault|stopPropagation={onPrompt}
68
  >
69
  <div
70
+ class="flex bg-white overflow-hidden rounded-2xl w-full max-w-lg 2xl:max-w-xl"
71
  bind:this={boxEl}
72
  >
73
  <input
 
75
  bind:this={inputEl}
76
  on:click|stopPropagation
77
  on:input={onInput}
78
+ class="flex-1 outline-none ring-0 border-none text-xl 2xl:text-2xl py-3 px-3"
79
  placeholder="Describe your prompt"
80
  title="Input prompt to generate image and obtain palette"
81
  type="text"
82
  name="prompt"
83
  />
84
  <button
85
+ class="font-semibold bg-blue-700 text-white border-l-2 px-5 text-xl 2xl:text-2xl spacing tracking-wide hover:saturate-150"
86
+ type="submit"
87
+ ><span class="mr-2">πŸ–</span> Paint
88
+ </button>
89
  </div>
90
  </form>
frontend/src/routes/+/+page.svelte CHANGED
@@ -56,7 +56,7 @@
56
  </script>
57
 
58
  <About
59
- classList={$toggleAbout || loading ? 'flex' : 'hidden'}
60
  on:click={() => ($toggleAbout = false)}
61
  {loading}
62
  />
 
56
  </script>
57
 
58
  <About
59
+ classList={$toggleAbout ? 'flex' : 'hidden'}
60
  on:click={() => ($toggleAbout = false)}
61
  {loading}
62
  />
frontend/src/routes/+page.svelte CHANGED
@@ -56,7 +56,7 @@
56
  </script>
57
 
58
  <About
59
- classList={$toggleAbout || loading ? 'flex' : 'hidden'}
60
  on:click={() => ($toggleAbout = false)}
61
  {loading}
62
  />
 
56
  </script>
57
 
58
  <About
59
+ classList={$toggleAbout ? 'flex' : 'hidden'}
60
  on:click={() => ($toggleAbout = false)}
61
  {loading}
62
  />