From d5f1ecfd263795404a672d722601faf784a36ee8 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Wed, 6 Aug 2025 21:12:27 +0200 Subject: [PATCH 01/19] feat: make sure every media is embedded in messages and only hide text if it's composed only of links --- components/Message.vue | 50 ++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/components/Message.vue b/components/Message.vue index c926616..fc62cf9 100644 --- a/components/Message.vue +++ b/components/Message.vue @@ -43,9 +43,9 @@ {{ date.toLocaleTimeString(undefined, { hour12: props.format == "12", timeStyle: "short" }) }} -
+
+ -
-
+
@@ -89,10 +89,10 @@ console.log("[MSG] reply message:", props.replyMessage); const linkRegex = /https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g; const linkMatches = props.message.message.matchAll(linkRegex).map(link => link[0]); -const mediaLinks: string[] = []; +const mediaLinks = ref([]); console.log("link matches:", linkMatches); -const hasEmbed = ref(false); +const hideText = ref(false); const sanitized = ref(); @@ -121,23 +121,35 @@ onMounted(async () => { console.log("added listeners"); } + const links: string[] = []; for (const link of linkMatches) { - console.log("link:", link); - try { - const res = await $fetch.raw(link); - if (res.ok && res.headers.get("content-type")?.match(/^image\/(apng|gif|jpeg|png|webp)$/)) { - console.log("link is image"); - mediaLinks.push(link); + console.log("link:", link); + try { + const res = await $fetch.raw(link); + if (res.ok && res.headers.get("content-type")?.match(/^image\/(apng|gif|jpeg|png|webp)$/)) { + console.log("link is image"); + links.push(link); + } + } catch (error) { + console.error(error); } - if (mediaLinks.length) { - hasEmbed.value = true - }; - } catch (error) { - console.error(error); - } -} -console.log("media links:", mediaLinks); + mediaLinks.value = [...links]; + } + + if (mediaLinks.value.length) { + const nonLinks = props.message.message.split(linkRegex); + let invalidContent = false; + for (const nonLink of nonLinks) { + if (nonLink != "" && nonLink != "\n" && nonLink != "
") { + invalidContent = true; + break; + } + } + hideText.value = !invalidContent; + }; + + console.log("media links:", mediaLinks); }); //function toggleTooltip(e: Event) { From 31b0d2e7eb7479ebeb74c10bf89c49f5880b5d20 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Wed, 6 Aug 2025 21:13:30 +0200 Subject: [PATCH 02/19] style(ui): improve styling of media-embedded messages --- components/MessageMedia.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/MessageMedia.vue b/components/MessageMedia.vue index ab62387..0a8ff16 100644 --- a/components/MessageMedia.vue +++ b/components/MessageMedia.vue @@ -34,9 +34,16 @@ function createModal(link: string) { \ No newline at end of file From 05c351feee4a9cd20cc1cd7c519402c1e3e0f148 Mon Sep 17 00:00:00 2001 From: Temmie Date: Mon, 11 Aug 2025 02:25:20 +0200 Subject: [PATCH 08/19] chore: update profile modal to fit new baes modal --- components/Modal/ProfilePopup.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/Modal/ProfilePopup.vue b/components/Modal/ProfilePopup.vue index b99a9ea..d04587e 100644 --- a/components/Modal/ProfilePopup.vue +++ b/components/Modal/ProfilePopup.vue @@ -114,16 +114,16 @@ function buttonEditProfile() { text-align: left; position: relative; - max-height: 60dvh; - max-width: 60dvw; + max-height: 70dvh; + max-width: 70dvw; height: 30em; width: 40em; display: flex; flex-direction: column; + color: var(--text-color); background-color: var(--chat-background-color); - border-radius: var(--standard-radius); overflow-y: scroll; } @@ -142,7 +142,6 @@ function buttonEditProfile() { z-index: 0; background-color: var(--primary-color); - border-radius: var(--standard-radius) var(--standard-radius) 0 0; /* top left and top right */ } #avatar { From 783eda56b14f661df2360b493b867857f38687d5 Mon Sep 17 00:00:00 2001 From: Temmie Date: Mon, 11 Aug 2025 02:36:57 +0200 Subject: [PATCH 09/19] style: add modal background colour to themes --- components/Modal/Base.vue | 3 ++- components/Modal/ProfilePopup.vue | 2 +- public/themes/style/ash.css | 1 + public/themes/style/dark.css | 1 + public/themes/style/description.css | 1 + public/themes/style/light.css | 1 + public/themes/style/rainbow-capitalism.css | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/Modal/Base.vue b/components/Modal/Base.vue index 42be98a..f2360bc 100644 --- a/components/Modal/Base.vue +++ b/components/Modal/Base.vue @@ -38,7 +38,8 @@ onMounted(() => { max-height: 90dvh; max-width: 90dvw; - border-radius: var(--standard-radius); + background-color: var(--modal-background-color); + border-radius: var(--standard-radius); border-width: 0; padding: 0; diff --git a/components/Modal/ProfilePopup.vue b/components/Modal/ProfilePopup.vue index d04587e..8eeee6c 100644 --- a/components/Modal/ProfilePopup.vue +++ b/components/Modal/ProfilePopup.vue @@ -123,7 +123,7 @@ function buttonEditProfile() { flex-direction: column; color: var(--text-color); - background-color: var(--chat-background-color); + background-color: var(--modal-background-color); overflow-y: scroll; } diff --git a/public/themes/style/ash.css b/public/themes/style/ash.css index 495fa15..d4ed893 100644 --- a/public/themes/style/ash.css +++ b/public/themes/style/ash.css @@ -17,6 +17,7 @@ complementaryColor = white --chat-featured-message-color: #4f3f2f60; --popup-background-color: #2f2828; --popup-highlighted-background-color: #382f2f; + --modal-background-color: #3a352f; --sidebar-background-color: #3e3a37; --sidebar-highlighted-background-color: #46423b; diff --git a/public/themes/style/dark.css b/public/themes/style/dark.css index d23ed76..4fddaf8 100644 --- a/public/themes/style/dark.css +++ b/public/themes/style/dark.css @@ -17,6 +17,7 @@ complementaryColor = white --chat-featured-message-color: #4f2f1f58; --popup-background-color: #2f1f1f; --popup-highlighted-background-color: #3f2f2f; + --modal-background-color: #28241f; --sidebar-background-color: #2e2a27; --sidebar-highlighted-background-color: #36322b; diff --git a/public/themes/style/description.css b/public/themes/style/description.css index 972821c..45829e0 100644 --- a/public/themes/style/description.css +++ b/public/themes/style/description.css @@ -18,6 +18,7 @@ complementaryColor = black --chat-featured-message-color: #4f2f1f58; --popup-background-color: #2f1f1f; --popup-highlighted-background-color: #3f2f2f; + --modal-background-color: #181f1f; --sidebar-background-color: #80808000; --sidebar-highlighted-background-color: #ffffff20; diff --git a/public/themes/style/light.css b/public/themes/style/light.css index 78bf2f9..6cfecf6 100644 --- a/public/themes/style/light.css +++ b/public/themes/style/light.css @@ -17,6 +17,7 @@ complementaryColor = black --chat-featured-message-color: #e8ac841f; --popup-background-color: #e8e4e0; --popup-highlighted-background-color: #dfdbd6; + --modal-background-color: #e8e4e0; --sidebar-background-color: #dbd8d4; --sidebar-highlighted-background-color: #d4d0ca; diff --git a/public/themes/style/rainbow-capitalism.css b/public/themes/style/rainbow-capitalism.css index 8ca3ed7..df01d39 100644 --- a/public/themes/style/rainbow-capitalism.css +++ b/public/themes/style/rainbow-capitalism.css @@ -17,6 +17,7 @@ complementaryColor = white --chat-featured-message-color: #4f8f4f80; --popup-background-color: #80808080; --popup-highlighted-background-color: #9f9f9f9f; + --modal-background-color: #7fa87fff; --sidebar-background-color: #80808000; --sidebar-highlighted-background-color: #ffffff20; From 002b6982a64d691ecccc7c874159ae9eab690e1a Mon Sep 17 00:00:00 2001 From: Temmie Date: Mon, 11 Aug 2025 02:46:49 +0200 Subject: [PATCH 10/19] feat: add embed radius --- components/MessageMedia.vue | 1 + public/themes/layout/gorb.css | 1 + 2 files changed, 2 insertions(+) diff --git a/components/MessageMedia.vue b/components/MessageMedia.vue index ab62387..48a076b 100644 --- a/components/MessageMedia.vue +++ b/components/MessageMedia.vue @@ -42,6 +42,7 @@ function createModal(link: string) { .media-item { cursor: pointer; max-width: 15dvw; + border-radius: var(--embed-radius); } \ No newline at end of file diff --git a/public/themes/layout/gorb.css b/public/themes/layout/gorb.css index 7b8e88b..86ea465 100644 --- a/public/themes/layout/gorb.css +++ b/public/themes/layout/gorb.css @@ -10,6 +10,7 @@ complementaryColor = white --sidebar-margin: .5em; --standard-radius: .5em; + --embed-radius: .3em; --button-radius: .6em; --guild-icon-radius: 15%; --pfp-radius: 50%; From 26ef3671e9b4e4517ae8757f848ebc1d6ca7a72a Mon Sep 17 00:00:00 2001 From: Temmie Date: Mon, 11 Aug 2025 02:57:17 +0200 Subject: [PATCH 11/19] style: increase message padding to make highlight more pleasant --- components/Message.vue | 10 +++++++--- components/MessageArea.vue | 8 ++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/Message.vue b/components/Message.vue index 80d7b9a..0e37895 100644 --- a/components/Message.vue +++ b/components/Message.vue @@ -188,15 +188,19 @@ function getDayDifference(date1: Date, date2: Date) { \ No newline at end of file