From e6b4eef5d538d80a5d9facf509164fedd4d87711 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Fri, 2 Oct 2026 22:07:06 +0100 Subject: [PATCH] web/home: give chat bubbles and stickers gradient depth Signed-off-by: oppiliappan --- web/src/lib/components/home/ChatBubble.svelte | 12 ++++++--- web/src/lib/components/home/Sticker.svelte | 27 +++++++------------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/web/src/lib/components/home/ChatBubble.svelte b/web/src/lib/components/home/ChatBubble.svelte index ab3335577..01e4761ad 100644 --- a/web/src/lib/components/home/ChatBubble.svelte +++ b/web/src/lib/components/home/ChatBubble.svelte @@ -2,11 +2,17 @@ import { tv } from "tailwind-variants"; export const chatBubble = tv({ - base: "max-w-[80%] rounded-3xl px-md py-sm typography-paragraph-large", + base: "max-w-[80%] rounded-3xl bg-linear-to-b px-md py-sm typography-paragraph-large", variants: { side: { - sent: "bg-background-info-emphasis text-foreground-on-emphasis", - received: "bg-background-muted text-foreground-default" + sent: [ + "from-background-info-emphasis to-background-info-emphasis-hover text-foreground-on-emphasis dark:from-background-info-emphasis-hover dark:to-background-info-emphasis", + "shadow-[inset_0_-2px_0_0_var(--color-alpha-dark-25),inset_0_1px_0_0_var(--color-alpha-light-20)] dark:shadow-[inset_0_-2px_0_0_var(--color-alpha-light-25),inset_0_1px_0_0_var(--color-alpha-dark-20)]" + ], + received: [ + "from-background-inset to-background-muted text-foreground-default dark:from-background-strong dark:to-background-muted", + "shadow-[inset_0_-2px_0_0_var(--color-alpha-dark-10)] dark:shadow-[inset_0_-2px_0_0_var(--color-shadow-inner-strong)]" + ] }, tail: { true: "", false: "" } }, diff --git a/web/src/lib/components/home/Sticker.svelte b/web/src/lib/components/home/Sticker.svelte index 5db8db395..3a5998781 100644 --- a/web/src/lib/components/home/Sticker.svelte +++ b/web/src/lib/components/home/Sticker.svelte @@ -2,25 +2,18 @@ import { tv, type VariantProps } from "tailwind-variants"; export const sticker = tv({ - base: "relative z-0 inline-flex rotate-(--sticker-tilt) items-center justify-center border-4 border-background-canvas bg-linear-to-b bg-clip-padding px-md py-1 text-2xl font-bold whitespace-nowrap transition-[rotate,scale] duration-500 ease-spring hover:z-20 hover:scale-110 hover:rotate-0 motion-reduce:transition-none md:text-4xl", + base: [ + "relative z-0 inline-flex rotate-(--sticker-tilt) items-center justify-center border-4 border-background-canvas bg-clip-padding px-md py-1 text-2xl font-bold whitespace-nowrap transition-[rotate,scale] duration-500 ease-spring hover:z-20 hover:scale-110 hover:rotate-0 motion-reduce:transition-none md:text-4xl", + "[--sticker-from:color-mix(in_oklch,var(--sticker-brand),white_15%)] [--sticker-highlight:color-mix(in_oklch,var(--sticker-brand),white_30%)]", + "bg-(--sticker-highlight) bg-linear-to-b from-(--sticker-from) to-(--sticker-brand)", + "shadow-[inset_0_1px_0_0_var(--sticker-highlight),0_1px_2px_0_rgb(0_0_0/0.05)]" + ], variants: { tone: { - deep: [ - "from-inverse-border to-inverse-shadow-inner text-inverse-foreground dark:from-inverse-background", - "shadow-[inset_0_-2px_0_0_var(--color-alpha-dark-25),inset_0_1px_0_0_var(--color-alpha-light-20)] dark:shadow-[inset_0_-2px_0_0_var(--color-alpha-light-25),inset_0_1px_0_0_var(--color-alpha-dark-20)]" - ], - soft: [ - "from-background-inset to-background-muted text-foreground-default border border-border-default dark:from-background-strong dark:to-background-muted", - "shadow-[inset_0_-2px_0_0_var(--color-shadow-inner-strong)]" - ], - accent: [ - "from-background-info-emphasis to-background-info-emphasis-hover text-foreground-on-emphasis dark:from-background-info-emphasis-hover dark:to-background-info-emphasis", - "shadow-[inset_0_-2px_0_0_var(--color-alpha-dark-25),inset_0_1px_0_0_var(--color-alpha-light-20)] dark:shadow-[inset_0_-2px_0_0_var(--color-alpha-light-25),inset_0_1px_0_0_var(--color-alpha-dark-20)]" - ], - paper: [ - "from-background-default to-background-muted text-foreground-default dark:from-background-muted dark:to-background-default", - "shadow-[inset_0_-2px_0_0_var(--color-shadow-inner-subtle)]" - ] + deep: "text-inverse-foreground [--sticker-brand:var(--color-inverse-background)]", + soft: "text-foreground-default [--sticker-brand:var(--color-background-muted)]", + accent: "text-white [--sticker-brand:var(--color-background-info-emphasis)]", + paper: "text-foreground-default [--sticker-brand:var(--color-background-default)]" }, round: { true: "aspect-square rounded-full px-sm", -- knotmirror 0.0.1