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>
This commit is contained in:
Bashy 2026-11-20 23:18:15 +02:00
parent 8c649c5bce
commit 1766e37336
14 changed files with 774 additions and 18 deletions

33
public/alerts/fx.css Normal file
View file

@ -0,0 +1,33 @@
/* Special redeem visuals (see fx.js): giant emote, bouncing emote celebration, highlighted message. */
#fx-alert { --ink:#3a2a20; --red:#b74347; position:fixed; inset:0; pointer-events:none; visibility:hidden; z-index:55; }
#fx-alert * { box-sizing:border-box; }
/* name strip, same paper + tape look as the cassette */
#fx-alert .strip { position:absolute; display:inline-block; max-width:520px; padding:8px 22px 10px; background:#fffdf7;
box-shadow:0 6px 14px rgba(0,0,0,.35); font:700 30px/1.05 'Caveat', cursive; color:var(--ink); }
#fx-alert .strip .u { color:var(--red); }
#fx-alert .strip:before, #fx-alert .strip:after { content:''; position:absolute; top:-10px; width:70px; height:24px;
background:rgba(190,160,240,.85); background-image:repeating-linear-gradient(45deg,#fff6 0 7px,#0000 7px 14px); }
#fx-alert .strip:before { left:-22px; transform:rotate(-28deg); }
#fx-alert .strip:after { right:-22px; transform:rotate(24deg); }
/* gigantify */
#fx-alert .giant { position:absolute; left:85px; top:70px; width:380px; height:380px; display:flex; align-items:center; justify-content:center; }
#fx-alert .giant img { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 12px 24px rgba(0,0,0,.5)); }
/* celebration */
#fx-alert .bounce { position:absolute; left:0; top:0; will-change:transform; filter:drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
/* highlighted message / message effect: big taped paper note, tall rather than wide */
#fx-alert .note { position:absolute; left:90px; top:90px; width:440px; min-height:300px; padding:30px 32px 34px; background:#fffdf7;
box-shadow:0 14px 30px rgba(0,0,0,.45); transform-origin:50% 0;
background-image:repeating-linear-gradient(#0000 0 51px, #0000001a 51px 52px); background-position:0 79px; }
#fx-alert .note:before, #fx-alert .note:after { content:''; position:absolute; top:-14px; width:120px; height:34px;
background:rgba(190,160,240,.85); background-image:repeating-linear-gradient(45deg,#fff6 0 8px,#0000 8px 16px);
box-shadow:0 1px 2px rgba(0,0,0,.15); }
#fx-alert .note:before { left:-34px; transform:rotate(-32deg); }
#fx-alert .note:after { right:-34px; transform:rotate(28deg); }
#fx-alert .note .who { font:700 34px/1.1 'Caveat', cursive; color:var(--ink); margin-bottom:10px; }
#fx-alert .note .who .u { color:var(--red); }
#fx-alert .note .text { font:700 46px/52px 'Caveat', cursive; color:var(--ink); word-wrap:break-word;
overflow:hidden; display:-webkit-box; -webkit-line-clamp:9; -webkit-box-orient:vertical; }