victor HF staff commited on
Commit
17dba7d
1 Parent(s): 10f1462

UI tweaks (#53)

Browse files

* logo

* add some icons

* size tweaks

* layout

src/lib/components/chat/ChatIntroduction.svelte CHANGED
@@ -2,6 +2,8 @@
2
  import { PUBLIC_DISABLE_INTRO_TILES, PUBLIC_MODEL_NAME } from '$env/static/public';
3
 
4
  import Logo from '$lib/components/icons/Logo.svelte';
 
 
5
  import { createEventDispatcher } from 'svelte';
6
 
7
  const dispatch = createEventDispatcher<{ message: string }>();
@@ -11,7 +13,7 @@
11
  <div class="lg:col-span-1">
12
  <div>
13
  <div class="text-2xl font-bold mb-3 flex items-center">
14
- <Logo classNames="mr-2 text-yellow-400 text-3xl" />
15
  HuggingChat
16
  </div>
17
  <p class="text-lg text-gray-600 dark:text-gray-400">
@@ -26,20 +28,36 @@
26
  <div class="font-semibold">{PUBLIC_MODEL_NAME}</div>
27
  </div>
28
  <div
29
- class="flex items-center gap-4 px-3 py-2 bg-gray-100 rounded-xl text-sm text-gray-600 dark:text-gray-300 dark:bg-gray-800"
30
  >
31
- <a href="https://huggingface.co/{PUBLIC_MODEL_NAME}" target="_blank" rel="noreferrer">
32
- Model page
 
 
 
 
 
 
 
33
  </a>
34
  <a
35
  href="https://huggingface.co/datasets/OpenAssistant/oasst1"
36
  target="_blank"
37
  rel="noreferrer"
 
38
  >
39
- Dataset page
 
 
40
  </a>
41
- <a href="https://open-assistant.io/" target="_blank" class="ml-auto" rel="noreferrer">
42
- Open Assistant website
 
 
 
 
 
 
43
  </a>
44
  </div>
45
  </div>
 
2
  import { PUBLIC_DISABLE_INTRO_TILES, PUBLIC_MODEL_NAME } from '$env/static/public';
3
 
4
  import Logo from '$lib/components/icons/Logo.svelte';
5
+ import CarbonArrowUpRight from '~icons/carbon/arrow-up-right';
6
+ import CarbonEarth from '~icons/carbon/earth';
7
  import { createEventDispatcher } from 'svelte';
8
 
9
  const dispatch = createEventDispatcher<{ message: string }>();
 
13
  <div class="lg:col-span-1">
14
  <div>
15
  <div class="text-2xl font-bold mb-3 flex items-center">
16
+ <Logo classNames="mr-1 text-yellow-400 text-4xl" />
17
  HuggingChat
18
  </div>
19
  <p class="text-lg text-gray-600 dark:text-gray-400">
 
28
  <div class="font-semibold">{PUBLIC_MODEL_NAME}</div>
29
  </div>
30
  <div
31
+ class="flex items-center gap-5 px-3 py-2 bg-gray-100 rounded-xl text-sm text-gray-600 dark:text-gray-300 dark:bg-gray-800"
32
  >
33
+ <a
34
+ href="https://huggingface.co/{PUBLIC_MODEL_NAME}"
35
+ target="_blank"
36
+ rel="noreferrer"
37
+ class="flex items-center hover:underline"
38
+ >
39
+ <CarbonArrowUpRight class="text-xs mr-1.5 text-gray-400" />
40
+ Model
41
+ <div class="max-sm:hidden">&nbsp;page</div>
42
  </a>
43
  <a
44
  href="https://huggingface.co/datasets/OpenAssistant/oasst1"
45
  target="_blank"
46
  rel="noreferrer"
47
+ class="flex items-center hover:underline"
48
  >
49
+ <CarbonArrowUpRight class="text-xs mr-1.5 text-gray-400" />
50
+ Dataset
51
+ <div class="max-sm:hidden">&nbsp;page</div>
52
  </a>
53
+ <a
54
+ href="https://open-assistant.io/"
55
+ target="_blank"
56
+ class="flex items-center hover:underline ml-auto"
57
+ rel="noreferrer"
58
+ >
59
+ <CarbonEarth class="text-xs mr-1.5 text-gray-400" />
60
+ Open Assistant Website
61
  </a>
62
  </div>
63
  </div>
src/lib/components/chat/ChatWindow.svelte CHANGED
@@ -2,7 +2,9 @@
2
  import type { Message } from '$lib/types/Message';
3
  import { createEventDispatcher } from 'svelte';
4
 
 
5
  import CarbonSendAltFilled from '~icons/carbon/send-alt-filled';
 
6
 
7
  import ChatMessages from './ChatMessages.svelte';
8
  import ChatInput from './ChatInput.svelte';
@@ -19,9 +21,9 @@
19
 
20
  <div class="relative h-screen">
21
  <nav class="sm:hidden flex items-center h-12 border-b px-4 justify-between dark:border-gray-800">
22
- <button>[ ]</button>
23
  <button>New Chat</button>
24
- <button>+</button>
25
  </nav>
26
  <ChatMessages {loading} {pending} {messages} on:message />
27
  <div
@@ -33,7 +35,7 @@
33
  dispatch('message', message);
34
  message = '';
35
  }}
36
- class="w-full relative flex items-center rounded-xl flex-1 max-w-4xl border bg-gray-100 focus-within:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:focus-within:border-gray-500 transition-all"
37
  >
38
  <div class="w-full flex flex-1 border-none bg-transparent">
39
  <ChatInput placeholder="Ask anything" bind:value={message} autofocus maxRows={10} />
 
2
  import type { Message } from '$lib/types/Message';
3
  import { createEventDispatcher } from 'svelte';
4
 
5
+ import CarbonAdd from '~icons/carbon/add';
6
  import CarbonSendAltFilled from '~icons/carbon/send-alt-filled';
7
+ import CarbonTextAlignJustify from '~icons/carbon/text-align-justify';
8
 
9
  import ChatMessages from './ChatMessages.svelte';
10
  import ChatInput from './ChatInput.svelte';
 
21
 
22
  <div class="relative h-screen">
23
  <nav class="sm:hidden flex items-center h-12 border-b px-4 justify-between dark:border-gray-800">
24
+ <button><CarbonTextAlignJustify /></button>
25
  <button>New Chat</button>
26
+ <button><CarbonAdd /></button>
27
  </nav>
28
  <ChatMessages {loading} {pending} {messages} on:message />
29
  <div
 
35
  dispatch('message', message);
36
  message = '';
37
  }}
38
+ class="w-full relative flex items-center rounded-xl flex-1 max-w-4xl border bg-gray-100 focus-within:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:focus-within:border-gray-500 "
39
  >
40
  <div class="w-full flex flex-1 border-none bg-transparent">
41
  <ChatInput placeholder="Ask anything" bind:value={message} autofocus maxRows={10} />
src/lib/components/icons/Logo.svelte CHANGED
@@ -3,14 +3,23 @@
3
  </script>
4
 
5
  <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
  width="1em"
8
  height="1em"
9
  class={classNames}
10
- viewBox="0 0 24 25"
 
 
11
  >
12
  <path
13
- fill="currentColor"
14
- d="M2.7 11.4c0-4.2 3.4-7.6 7.6-7.6h4a7 7 0 0 1 7 7v.6a7 7 0 0 1-7 7H5.6l-2.3 2.1c-.2.2-.5 0-.5-.2V11.4Z"
 
 
 
 
 
 
 
 
15
  />
16
  </svg>
 
3
  </script>
4
 
5
  <svg
 
6
  width="1em"
7
  height="1em"
8
  class={classNames}
9
+ viewBox="0 0 13 12"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
  >
13
  <path
14
+ fill="#FFD21E"
15
+ d="M1.76 5.63a3.7 3.7 0 0 1 3.7-3.7h1.7a3.43 3.43 0 0 1 0 6.87H3.07L2.01 9.83a.14.14 0 0 1-.25-.1v-4.1Z"
16
+ />
17
+ <path
18
+ fill="#32343D"
19
+ d="M7.37 4.8c.13.05.19.33.33.25a.54.54 0 0 0 .22-.73.54.54 0 0 0-.73-.22.54.54 0 0 0-.22.73c.06.13.27-.08.4-.03ZM4.83 4.8c-.14.05-.2.33-.33.25a.54.54 0 0 1-.23-.73A.54.54 0 0 1 5 4.1c.26.14.36.47.22.73-.06.13-.27-.08-.4-.03ZM6.12 7.4c1.06 0 1.4-.96 1.4-1.44 0-.49-.62.26-1.4.26-.77 0-1.4-.75-1.4-.26 0 .48.34 1.43 1.4 1.43Z"
20
+ />
21
+ <path
22
+ fill="#FF323D"
23
+ d="M6.97 7.12c-.2.16-.49.27-.85.27-.34 0-.6-.1-.81-.24a.94.94 0 0 1 .57-.49c.04-.01.09.06.13.14.05.07.1.15.14.15.05 0 .1-.08.14-.15.05-.08.1-.15.14-.13a.93.93 0 0 1 .54.45Z"
24
  />
25
  </svg>
src/routes/+layout.svelte CHANGED
@@ -92,34 +92,38 @@
92
  New Chat
93
  </a>
94
  </div>
95
- <div class="flex flex-col overflow-y-auto p-3 -mt-3 gap-2">
96
  {#each data.conversations as conv}
97
  <a
98
  data-sveltekit-noscroll
99
  href="{base}/conversation/{conv.id}"
100
- class="pl-3 pr-2 h-12 group rounded-lg flex-none text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-1 {conv.id ===
101
  $page.params.id
102
  ? 'bg-gray-100 dark:bg-gray-700'
103
  : ''}"
104
  >
105
- <div class="flex-1 truncate">{conv.title}</div>
106
 
107
  <button
108
  type="button"
109
- class="w-6 h-6 items-center justify-center hidden group-hover:flex hover:bg-gray-100"
110
  title="Share conversation"
111
  on:click|preventDefault={() => shareConversation(conv.id, conv.title)}
112
  >
113
- <CarbonExport class="text-gray-400 hover:text-gray-600" />
 
 
114
  </button>
115
 
116
  <button
117
  type="button"
118
- class="w-6 h-6 items-center justify-center hidden group-hover:flex hover:bg-gray-100"
119
  title="Delete conversation"
120
  on:click|preventDefault={() => deleteConversation(conv.id)}
121
  >
122
- <CarbonTrashCan class="text-gray-400 hover:text-gray-600" />
 
 
123
  </button>
124
  </a>
125
  {/each}
 
92
  New Chat
93
  </a>
94
  </div>
95
+ <div class="flex flex-col overflow-y-auto p-3 -mt-3 gap-1">
96
  {#each data.conversations as conv}
97
  <a
98
  data-sveltekit-noscroll
99
  href="{base}/conversation/{conv.id}"
100
+ class="pl-3 pr-2 h-12 group rounded-lg flex-none text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-1.5 {conv.id ===
101
  $page.params.id
102
  ? 'bg-gray-100 dark:bg-gray-700'
103
  : ''}"
104
  >
105
+ <div class="flex-1 truncate">azeza aze a ea zeazeazazeae</div>
106
 
107
  <button
108
  type="button"
109
+ class="w-5 h-5 items-center justify-center hidden group-hover:flex rounded"
110
  title="Share conversation"
111
  on:click|preventDefault={() => shareConversation(conv.id, conv.title)}
112
  >
113
+ <CarbonExport
114
+ class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300 text-xs"
115
+ />
116
  </button>
117
 
118
  <button
119
  type="button"
120
+ class="w-5 h-5 items-center justify-center hidden group-hover:flex rounded"
121
  title="Delete conversation"
122
  on:click|preventDefault={() => deleteConversation(conv.id)}
123
  >
124
+ <CarbonTrashCan
125
+ class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300 text-xs"
126
+ />
127
  </button>
128
  </a>
129
  {/each}