Chat: paper slips under the camera, Twitch + 7TV emotes

- public/chat/chat.css + chat.js (window.HSChat): cream paper slips with the
  name on a washi-tape label, newest on top sliding out from under the webcam,
  older ones glide down and fade at the bottom; message_timeout / max_messages
- Emotes: Twitch (tags.emotes) and 7TV global + channel sets (refreshed every
  10 min), zero-width 7TV emotes stack, emote-only messages get bigger emotes
- Deleted messages, timeouts, bans and /clear remove slips at once
- overlay.ejs: old chat CSS/JS removed, new files load only for ?parts=chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-11-21 12:08:12 +02:00
parent 0cc53e1d73
commit 463c6580f4
4 changed files with 264 additions and 55 deletions

View file

@ -120,10 +120,20 @@ const flt = (v, d) => { const n = parseFloat(v); return isNaN(n) ? d : n; };
## Overlay chat position and style
The layout editor was removed (2026-11-20). Chat box position/size/font and the legacy text/video action alert
position are fixed CSS custom properties in the `:root` block of `views/overlay.ejs` (values copied from the last
saved layout). Change them there, or override with Custom CSS in Settings. The `overlay_layout` table is still
created but unused, so old data is kept.
The layout editor was removed (2026-11-20); the `overlay_layout` table is still created but unused, so old data is kept.
The legacy text/video action alert position lives in the `:root` block of `views/overlay.ejs`.
Chat (`?parts=chat`) is `public/chat/chat.css` + `public/chat/chat.js` (window.HSChat), fed by tmi.js in overlay.ejs:
- Look: cream paper slips, name on a washi-tape label tinted with the chatter's Twitch colour, slight random tilt.
- Flow: the box sits under the webcam (Game scene camera group 1920,600 640x360 on the 2560 canvas), newest on top;
a new message slides out from under the camera, the rest glide down (FLIP with the `translate` property) and the
oldest dissolve at the bottom (mask-image fade). Expire after `message_timeout` s, cap `max_messages`.
- Move/resize with Custom CSS: `#chat { --chat-top: 63%; --chat-right: 2%; --chat-width: 20%; --chat-height: 34%; }`.
- Emotes: Twitch (from `tags.emotes`, code-point ranges) + 7TV global and channel sets (`7tv.io/v3`, channel by
`room-id` from ROOMSTATE, refreshed every 10 min). 7TV zero-width emotes (data flag 256) stack on the emote before.
Emote-only messages (up to 3 emotes) get bigger emotes.
- Moderation: deleted messages, timeouts, bans and /clear remove the matching slips at once.
- Design preview with other styles: `~/Desktop/Stream/chat/index.html` (not in the repo).
## Gap / new-message audio