From 81923c4f8c77ebd4d0546e4b35f1bc50ea3fc121 Mon Sep 17 00:00:00 2001 From: kritzl Date: Mon, 18 May 2026 16:49:24 +0200 Subject: [PATCH] improve chat ui --- app/src/assets/chat.ts | 137 ++++++++++++++++++++++++--------- app/src/assets/chatDict_de.ts | 11 ++- app/src/assets/chatDict_en.ts | 11 ++- app/src/assets/chatDict_uwu.ts | 9 ++- app/src/assets/main.ts | 11 ++- app/src/i18n/ui.ts | 6 ++ app/src/styles/global.css | 33 +++++++- 7 files changed, 170 insertions(+), 48 deletions(-) diff --git a/app/src/assets/chat.ts b/app/src/assets/chat.ts index bb5e548..d138d6d 100644 --- a/app/src/assets/chat.ts +++ b/app/src/assets/chat.ts @@ -1,4 +1,5 @@ -import {createIcons, Send, Stars} from "lucide" +import {Bot, createIcons, UserRound, Send, Stars} from "lucide" +import {useTranslations} from "../i18n/utils.ts" import removeDiacritics from "./removeDiacritics.ts" export type ResponseDictType = { @@ -16,6 +17,8 @@ const doors = window.doors const auth = window.auth const doorAction = window.doorAction +const t = useTranslations(lang) + const responses = lang === "de" ? (await import("./chatDict_de")).default @@ -25,19 +28,51 @@ const responses = const sortedResponses = responses.sort( (a, b) => b.priority - a.priority) +const chatAvatar = ` +
+
+ ${lang === 'uwu' ? '🥺' : ''} +
+
+` + +const chatHeader = ` +
+ ${t("chat.dooris")} +
+` + +const chatAvatarUser = ` +
+
+ ${lang === 'uwu' ? '🥺' : ''} +
+
+` + +const chatHeaderUser = ` +
+ ${t("chat.user")} +
+` + +const chatWait = ` +
+ ${chatAvatar} + ${chatHeader} +
+ +
+
+` + const templateInjectChat = ` -