Commit graph

7 commits

Author SHA1 Message Date
b28e56f991 Add StreamElements tips and a Feishin now-playing helper (disabled)
- src/streamelements.js: StreamElements Astro websocket, channel.tips with SE_JWT.
  Only allowed + successful tips alert, deduped by id, follows reconnect tokens.
  Off unless SE_JWT is set.
- tools/nowplaying/: PC helper that reads Feishin over MPRIS and posts title,
  artist and a small cover thumbnail to /nowplaying (Bearer NOWPLAYING_KEY). The
  cover is fetched on the LAN so the Navidrome token never leaves the PC.
  Endpoint and overlay widget are kept but switched off for now.
- .env.example: SE_JWT, NOWPLAYING_KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 23:18:15 +02:00
553cc35b9e Add Redeems: channel points, built-in rewards and bits Power-ups
- reward_variations (src/db.js in the wiring commit): each trigger has variations,
  one is picked at random weighted by rarity (Common 50 / Uncommon 25 / Rare 12 /
  Ultra Rare 3), like Twitch alert variations.
- /redeems page: rewards listed live from Twitch, plus Power-ups and built-in
  rewards; per variation name, rarity (with % chance), sound + volume, show cassette
  or sound only, caption, sticker, on/off, play/test/two-click delete.
- Special styles: Gigantify -> giant emote, Celebration -> bouncing emotes,
  Highlight my message / Message Effect -> big taped note.
- redeems-seed.json: first-run defaults rebuilt from the Twitch alert setup
  (96 variations, 21 triggers); only loaded when the table is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 23:18:15 +02:00
1766e37336 Overlay: cassette redeems, emote effects, poll card, Hype Train bar, raid card
New overlay modules (taped-paper look, shared with the polaroid alerts):
- cassette.js: redeems as a cassette tape; rarity = shell colour (Ultra Rare gold
  with glow, foil and sparkles), reels spin for the sound's length, sticker corner.
- fx.js: Gigantify (viewer's emote grows giant), On-Screen Celebration (emote
  copies bounce around the screen), highlight / Message Effect (tall taped note).
- poll.js: live poll card with bars, countdown and a WINNER stamp.
- hypebar.js: persistent Hype Train strip (level, progress, time left).
- raidcard.js: silent raid send-off card that stays during the raid countdown.
- nowplaying.js: Feishin now-playing slip (not loaded yet, see overlay).

polaroid.js: shared queue now also drives cassettes/effects; test alerts replace
only other tests and never cut off real alerts; alerts stay up for the animation
+ 3 s or the sound's length; sound lengths measured in the browser for UI-picked
sounds; tip and Hype Train alerts; optional ALERTS_BASE for offline test pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 23:18:15 +02:00
8c649c5bce Add redeem sounds and cut-out stickers
- public/alerts/sounds/redeems/: every channel point / Power-up / highlight clip,
  two-pass loudness-normalized to -16 LUFS (peaks <= -1.5 dBFS), so all redeems
  play at the same volume with the default 0.8. Originals stay in Nextcloud.
- public/alerts/sounds/: remaining library clips (a-rat, emotional damage for
  tips, okay-meme, ...) at their original level, next to the built-in alert sounds.
- public/alerts/stickers/: per-redeem cassette stickers, cut out with rembg or
  hand-drawn masks (soft fade where a photo edge cut the subject), plus a drawn
  chat bubble and the default headset Streamer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 23:18:15 +02:00
d481fc4f69 Add polaroid alerts for follows, subs, gifts, streaks, raids and bits
Overlay
- public/alerts/polaroid.js + .css: animated polaroid (photo drops in, tape
  and heart stick on, caption writes in), randomized angles, per-event art,
  caption, tape colour, badge and sound, fanned photo stack for multi-month
  subs / community gifts / raids, and a queue so alerts never overlap.
- Bits: no alert under 5; sound tiers at 5/50/75/100/150/250.
- Watch streaks are read from chat (USERNOTICE viewermilestone) and reported
  to the server over the overlay WebSocket.

Server
- Subscribe to channel.chat.notification instead of channel.subscribe /
  subscription.message / subscription.gift / channel.raid: one event with
  Prime, months bought at once, gift recipient, resub message and community
  gift totals. Per-recipient gift notices of a gift bomb are skipped, so a
  bomb is one alert (was N+1). Needs the user:read:chat scope (log in again).
- src/alerts.js maps Twitch events to alerts, broadcasts them and still runs
  them through dispatch (activity log + existing actions).
- EventSub starts on boot from the stored login (alerts survive restarts),
  validates the token hourly and refreshes it on expiry or 401, follows
  session_reconnect without dropping events, and reconnects when keepalives
  stop.
- The overlay WebSocket only accepts chat_notice messages from connections
  that pass the overlay UUID; streak notices are deduped by message id.

Dashboard
- Twitch connection status and a test button per alert (POST /alerts/test/:key).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:57:36 +02:00
88e906ff5d Tidy repo: rename vhost script, keep media folder
- `sh` -> `apache.sh` (it writes the Apache vhost for overlay.example.com)
- keep public/media/ in git via .gitkeep while ignoring uploads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:57:29 +02:00
9e0ddb8182 Update gitignore 2026-11-20 18:55:47 +01:00