From ba9ec92d9cee370c80c52bef78f2faa51799f3f8 Mon Sep 17 00:00:00 2001 From: Clay Date: Wed, 2 Dec 2026 23:06:42 -0500 Subject: [PATCH] Classic chat: force left align; 15-color username palette --- public/index.html | 4 ++-- public/js/ui.js | 11 ++++++++--- public/style.css | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index 5716b07..99eabdf 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ Web OSCAR Chat - +
@@ -87,6 +87,6 @@
- + diff --git a/public/js/ui.js b/public/js/ui.js index cec99d4..6d2b980 100644 --- a/public/js/ui.js +++ b/public/js/ui.js @@ -21,12 +21,17 @@ export function getMessageStyle() { return v === 'classic' ? 'classic' : 'bubbles'; } +const NAME_COLORS = [ + '#6ee7ff', '#ff7ab6', '#7CFF6B', '#ffd166', '#c792ea', + '#ff9f43', '#4dd0e1', '#f78fb3', '#a8e063', '#82aaff', + '#f6c177', '#ff6b6b', '#5ad1a3', '#d4a5ff', '#f9f871', +]; + function nameColor(name) { let hash = 0; - const s = String(name || 'unknown'); + const s = String(name || 'unknown').toLowerCase(); for (let i = 0; i < s.length; i++) hash = ((hash << 5) - hash) + s.charCodeAt(i); - const hue = Math.abs(hash) % 360; - return `hsl(${hue} 70% 70%)`; + return NAME_COLORS[Math.abs(hash) % NAME_COLORS.length]; } export function setMessageStyle(style) { const v = style === 'classic' ? 'classic' : 'bubbles'; diff --git a/public/style.css b/public/style.css index d28a109..c010106 100644 --- a/public/style.css +++ b/public/style.css @@ -177,6 +177,7 @@ main { padding: 1rem; max-width: 1600px; margin: 0 auto; } padding: 0.1rem 0; background: transparent; border: none; + align-self: flex-start; } .messages.style-classic .msg .meta { display: inline;