diff --git a/astro.config.mjs b/astro.config.mjs index 10584f64..58852168 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -40,7 +40,7 @@ export default defineConfig({ name: 'Anse', short_name: 'Anse', description: 'Anse is a fully optimized UI for AI Chats.', - theme_color: '#212129', + theme_color: '#101010', background_color: '#ffffff', icons: [ { @@ -54,7 +54,7 @@ export default defineConfig({ type: 'image/png', }, { - src: 'icon.svg', + src: 'logo.svg', sizes: '32x32', type: 'image/svg', purpose: 'any maskable', diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index 23cd324e..b7d55ece 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/icon.svg b/public/icon.svg deleted file mode 100644 index 6b1e17f2..00000000 --- a/public/icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 00000000..071ce80b --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/pwa-192.png b/public/pwa-192.png index 636c9251..319d9c0b 100644 Binary files a/public/pwa-192.png and b/public/pwa-192.png differ diff --git a/public/pwa-512.png b/public/pwa-512.png index cab76357..7b29ff60 100644 Binary files a/public/pwa-512.png and b/public/pwa-512.png differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 00000000..c2a49f4f --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: / diff --git a/src/assets/zag-components.css b/src/assets/zag-components.css index db0bd7e9..2df5a667 100644 --- a/src/assets/zag-components.css +++ b/src/assets/zag-components.css @@ -83,10 +83,10 @@ * -----------------------------------------------------------------------------*/ [data-scope='select'][data-part='content'] { - @apply border border-darker + @apply border border-base-100 } [data-scope='select'][data-part='trigger'][data-expanded] { - @apply border border-darker + @apply border border-base-100 } /* ----------------------------------------------------------------------------- diff --git a/src/components/Main.astro b/src/components/Main.astro index a51a8bfc..77e2ef6e 100644 --- a/src/components/Main.astro +++ b/src/components/Main.astro @@ -10,7 +10,6 @@ import Conversation from './main/Conversation'
-
diff --git a/src/components/ModalsLayer.tsx b/src/components/ModalsLayer.tsx index 2c160407..885096dc 100644 --- a/src/components/ModalsLayer.tsx +++ b/src/components/ModalsLayer.tsx @@ -13,7 +13,7 @@ import Modal from './ui/Modal' export default () => { return ( <> - +
diff --git a/src/components/Send.tsx b/src/components/Send.tsx index e2eb5087..7e01c384 100644 --- a/src/components/Send.tsx +++ b/src/components/Send.tsx @@ -6,9 +6,10 @@ import { addConversation, conversationMap, currentConversationId } from '@/store import { loadingStateMap, streamsMap } from '@/stores/streams' import { handlePrompt } from '@/logics/conversation' import { globalAbortController } from '@/stores/settings' -import { useMobileScreen } from '@/hooks' +import { useI18n, useMobileScreen } from '@/hooks' export default () => { + const { t } = useI18n() let inputRef: HTMLTextAreaElement const $conversationMap = useStore(conversationMap) const $currentConversationId = useStore(currentConversationId) @@ -56,7 +57,7 @@ export default () => { inputRef.focus() }} > -
Enter Something...
+
{t('send.placeholder')}
) @@ -65,7 +66,7 @@ export default () => {
-
-
-
Temperature
-
-
-
-
- diff --git a/src/components/main/ConversationEmpty.tsx b/src/components/main/ConversationEmpty.tsx index ff5c4877..fe35e3f6 100644 --- a/src/components/main/ConversationEmpty.tsx +++ b/src/components/main/ConversationEmpty.tsx @@ -1,5 +1,6 @@ import { showConversationEditModal } from '@/stores/ui' import { getBotMetaById } from '@/stores/provider' +import Button from '../ui/Button' import type { Conversation } from '@/types/conversation' interface Props { @@ -9,17 +10,20 @@ interface Props { export default (props: Props) => { const botMeta = () => getBotMetaById(props.conversation.bot) || null return ( -
-
+
) } diff --git a/src/components/main/MessageItem.tsx b/src/components/main/MessageItem.tsx index 737d3b3a..1315e3b6 100644 --- a/src/components/main/MessageItem.tsx +++ b/src/components/main/MessageItem.tsx @@ -9,6 +9,7 @@ import { scrollController } from '@/stores/ui' import { globalAbortController } from '@/stores/settings' import StreamableText from '../StreamableText' import { DropDownMenu, Tooltip } from '../ui/base' +import Button from '../ui/Button' import type { MenuItem } from '../ui/base' import type { MessageInstance } from '@/types/message' @@ -98,7 +99,7 @@ export default (props: Props) => {
@@ -135,9 +136,9 @@ export default (props: Props) => { class="op-70 bg-darker py-4 px-[calc(max(1.5rem,(100%-48rem)/2))] w-full inset-0 scroll-pa-4 input-base rounded-md" /> -
-
setIsEditing(false)}>Cancel
-
handleSend()}>Submit
+
+ +
diff --git a/src/components/main/Welcome.tsx b/src/components/main/Welcome.tsx index 57da60de..a4461a35 100644 --- a/src/components/main/Welcome.tsx +++ b/src/components/main/Welcome.tsx @@ -17,7 +17,7 @@ export default () => { {instance => (
currentConversationId.set(instance.id)}> {instance.icon ? instance.icon :
} -
{instance.name || 'Untitled'}
+
{instance.name || t('conversations.untitled')}
)} diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx new file mode 100644 index 00000000..88090890 --- /dev/null +++ b/src/components/ui/Button.tsx @@ -0,0 +1,45 @@ +import { Show } from 'solid-js' +import type { JSXElement } from 'solid-js' + +interface Props { + icon?: string + text?: string + size?: 'sm' | 'md' | 'lg' + variant?: 'normal' | 'ghost' + children?: JSXElement + onClick: () => void +} + +export default (props: Props) => { + const buttonSizeClass = { + sm: 'px-2 h-7.5 text-xs', + md: 'px-3 h-10 text-sm', + lg: 'px-3 h-10 text-sm', + }[props.size || 'md'] + const buttonVariantClass = { + normal: 'bg-base-100 border border-base hover:(bg-base-200 border-base-100)', + ghost: 'bg-transparent border border-base hover:(bg-base-100 border-base-100)', + }[props.variant || 'normal'] + const iconSizeClass = { + sm: 'text-xs', + md: 'text-sm', + lg: 'text-sm', + }[props.size || 'md'] + return ( +
+ +
+ + +
{props.text || props.children}
+
+
+ ) +} diff --git a/src/components/ui/EmojiPickerModal.tsx b/src/components/ui/EmojiPickerModal.tsx index 151c14cf..dc81bf98 100644 --- a/src/components/ui/EmojiPickerModal.tsx +++ b/src/components/ui/EmojiPickerModal.tsx @@ -23,7 +23,7 @@ export default () => {
{ diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index 62002c52..4c201ef6 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -44,7 +44,7 @@ export default (props: Props) => {
api().close()} />
-
+
diff --git a/src/components/ui/SettingsApiKey.tsx b/src/components/ui/SettingsApiKey.tsx index 286df043..e5a62796 100644 --- a/src/components/ui/SettingsApiKey.tsx +++ b/src/components/ui/SettingsApiKey.tsx @@ -18,11 +18,11 @@ export default ({ settings, editing, value, setValue }: Props) => { return (
{editing() && ( -
+
setValue(e.currentTarget.value)} />
{ setIsOpen(!isOpen()) }}> diff --git a/src/components/ui/SettingsInput.tsx b/src/components/ui/SettingsInput.tsx index 6bc02ccc..508f0ed6 100644 --- a/src/components/ui/SettingsInput.tsx +++ b/src/components/ui/SettingsInput.tsx @@ -17,7 +17,7 @@ export default ({ settings, editing, value, setValue }: Props) => { setValue(e.currentTarget.value)} /> )} diff --git a/src/components/ui/Sidebar.tsx b/src/components/ui/Sidebar.tsx index 677a729b..51776a8b 100644 --- a/src/components/ui/Sidebar.tsx +++ b/src/components/ui/Sidebar.tsx @@ -8,7 +8,7 @@ interface Props { export default (props: Props) => { const containerBaseClass = { - left: 'w-[300px] h-100dvh border-r', + left: 'w-[260px] h-100dvh border-r', right: 'w-[300px] h-100dvh border-l', }[props.direction] diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index d0e14010..f4832157 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -11,10 +11,10 @@ const { title } = Astro.props; - + - - + + {title} diff --git a/src/locale/lang/en.ts b/src/locale/lang/en.ts index 24229c7f..2cd7ee7b 100644 --- a/src/locale/lang/en.ts +++ b/src/locale/lang/en.ts @@ -20,9 +20,13 @@ export const en = { }, conversations: { title: 'Conversations', - add: 'New Conversation', + add: 'New', recent: 'Recents', noRecent: 'No recents', + untitled: 'Untitled', + }, + send: { + placeholder: 'Enter Something...', }, }, } as language diff --git a/src/locale/lang/zh-cn.ts b/src/locale/lang/zh-cn.ts index decee665..66c3cd64 100644 --- a/src/locale/lang/zh-cn.ts +++ b/src/locale/lang/zh-cn.ts @@ -20,9 +20,13 @@ export const zhCN = { }, conversations: { title: '对话列表', - add: '创建新对话', + add: '新对话', recent: '最近对话', noRecent: '暂无最近对话', + untitled: '未命名对话', + }, + send: { + placeholder: '输入内容...', }, }, } as language diff --git a/unocss.config.ts b/unocss.config.ts index 7fe52918..db08cef1 100644 --- a/unocss.config.ts +++ b/unocss.config.ts @@ -43,22 +43,21 @@ export default defineConfig({ ], transformers: [transformerVariantGroup(), transformerDirectives()], shortcuts: [{ - 'bg-base': 'bg-light-100 dark:bg-[#1c1c1c]', - 'bg-base-100': 'bg-light-200 dark:bg-[#222222]', - 'bg-blur': 'bg-light-200/85 dark:bg-[#222222]/85 backdrop-blur-xl backdrop-saturate-150', - 'bg-sidebar': 'bg-light-400 dark:bg-[#191919]', - 'bg-modal': 'bg-base dark:bg-base-100', + 'bg-base': 'bg-white dark:bg-[#101010]', + 'bg-base-100': 'bg-light-200/50 dark:bg-[#181818]', + 'bg-base-200': 'bg-light-400 dark:bg-[#202020]', + 'bg-blur': 'bg-light-200/85 dark:bg-[#101010]/85 backdrop-blur-xl backdrop-saturate-150', + 'bg-sidebar': 'bg-white dark:bg-[#101010]', + 'bg-modal': 'bg-white dark:bg-[#181818]', 'bg-darker': 'bg-black/4 dark:bg-white/4', 'fg-base': 'text-dark dark:text-[#dadada]', - 'border-base': 'border-black/8 dark:border-white/8', - 'border-b-base': 'border-b-black/8 dark:border-b-white/8', - 'border-lighter': 'border-light-600 dark:border-dark-300', - 'border-darker': 'border-black/50 dark:border-white/50', - 'placeholder-base': 'placeholder:op-50 dark:placeholder:op-30', + 'border-base': 'border-light-700 dark:border-[#2a2a2a]', + 'border-b-base': 'border-b-light-700 dark:border-b-[#2a2a2a]', + 'border-base-100': 'border-light-900 dark:border-[#404040]', 'hv-base': 'transition-colors cursor-pointer hover:bg-darker', 'hv-foreground': 'transition-opacity cursor-pointer op-70 hover:op-100', 'input-base': 'bg-transparent placeholder:op-50 dark:placeholder:op-20 focus:(ring-0 outline-none) resize-none', - 'button': 'mt-4 px-3 py-2 text-xs border border-base rounded-lg hv-base hover:border-darker', + 'button': 'mt-4 px-3 py-2 text-xs border border-base rounded-lg hv-base hover:border-base-100', 'max-w-base': 'max-w-3xl mx-auto', 'text-error': 'text-red-700 dark:text-red-400/80', 'border-error': 'border border-red-700 dark:border-red-400/80', @@ -68,35 +67,6 @@ export default defineConfig({ 'fi': 'flex items-center', 'fcc': 'fc items-center', 'fb': 'flex justify-between', - - // TODO: remove below - 'fie': 'fi justify-end', - 'col-fcc': 'flex-col fcc', - 'inline-fcc': 'inline-flex items-center justify-center', - 'base-focus': 'focus:(bg-op-20 ring-0 outline-none)', - 'b-slate-link': 'border-b border-(slate none) hover:border-dashed', - 'gpt-title': 'text-2xl font-extrabold mr-1', - 'gpt-subtitle': 'text-(2xl transparent) font-extrabold bg-(clip-text gradient-to-r) from-sky-400 to-emerald-600', - 'gpt-copy-btn': 'absolute top-12px right-12px z-3 fcc border b-transparent w-8 h-8 p-2 bg-light-300 dark:bg-dark-300 op-90 cursor-pointer', - 'gpt-copy-tips': 'op-0 h-7 bg-black px-2.5 py-1 box-border text-xs c-white fcc rounded absolute z-1 transition duration-600 whitespace-nowrap -top-8', - 'gpt-retry-btn': 'fi gap-1 px-2 py-0.5 op-70 border border-slate rounded-md text-sm cursor-pointer hover:bg-slate/10', - 'gpt-back-top-btn': 'fcc p-2.5 text-base rounded-md hover:bg-slate/10 fixed bottom-60px right-20px z-10 cursor-pointer transition-colors', - 'gpt-back-bottom-btn': 'gpt-back-top-btn bottom-20px transform-rotate-180deg', - 'gpt-password-input': 'px-4 py-3 h-12 rounded-sm bg-(slate op-15) base-focus', - 'gpt-password-submit': 'fcc h-12 w-12 bg-slate cursor-pointer bg-op-20 hover:bg-op-50', - 'gen-slate-btn': 'h-12 px-4 py-2 bg-(slate op-15) hover:bg-op-20 rounded-sm', - 'gen-cb-wrapper': 'h-12 my-4 fcc gap-4 bg-(slate op-15) rounded-sm', - 'gen-cb-stop': 'px-2 py-0.5 border border-slate rounded-md text-sm op-70 cursor-pointer hover:bg-slate/10', - 'gen-text-wrapper': 'my-4 fc gap-2 transition-opacity', - 'gen-textarea': 'w-full px-3 py-3 min-h-12 max-h-36 rounded-sm bg-(slate op-15) resize-none base-focus placeholder:op-50 dark:(placeholder:op-30) scroll-pa-8px', - 'sys-edit-btn': 'inline-fcc gap-1 text-sm bg-slate/20 px-2 py-1 rounded-md transition-colors cursor-pointer hover:bg-slate/50', - 'gpt-toggle-wrapper': 'inline-flex rounded border border-gray-100 bg-gray-100 p-1 cursor-pointer', - 'gpt-toggle-item': 'inline-block rounded font-semibold px-2 py-1 text-xs text-gray-500 focus:relative', - 'gpt-toggle-active': 'bg-emerald-500 text-white', - - 'icon-base': 'md:(w-6 h-6) w-5 h-5', - 'icon--off': 'group-hover:hidden inline-block', - 'icon--on': 'hidden group-hover:inline-block', }], preflights: [{ layer: 'base',