Poll card and emote effects use the corner sticker from Actions -> Alerts
The heart on the winning poll option and the picture when Twitch sends no emote were still a fixed file name; they now come from the alert theme (placeholder when none is set). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c481ca92cb
commit
2659993a7d
2 changed files with 6 additions and 4 deletions
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
(function () {
|
||||
const COLORS = ['#f4a0a8', '#a88be0', '#7fcfa6', '#f6c75b', '#8cc8f0'];
|
||||
const HEART = (window.ALERTS_BASE || '/alerts/') + 'art/Heart.png';
|
||||
// heart on the winning option: the corner sticker from Actions → Alerts, else a plain shape
|
||||
const heart = () => (window.S && window.S.alert_theme && window.S.alert_theme.heart) || (window.ALERTS_BASE || '/alerts/') + 'art/placeholder.svg';
|
||||
const SHOW_RESULT_MS = 9000;
|
||||
const esc = s => String(s ?? '').replace(/[&<>"]/g, c => ({ '&':'&', '<':'<', '>':'>', '"':'"' }[c]));
|
||||
let el = null, pollId = null, timer = null, hideTimer = null, endsAt = 0;
|
||||
|
|
@ -25,7 +26,7 @@
|
|||
${poll.choices.map((c, i) => `<div class="c" data-id="${esc(c.id)}">
|
||||
<div class="row"><span class="t">${esc(c.title)}</span><span class="n">0</span></div>
|
||||
<div class="track"><div class="fill" style="background-color:${COLORS[i % COLORS.length]}"></div></div>
|
||||
<img class="heart" src="${HEART}" alt=""></div>`).join('')}
|
||||
<img class="heart" src="${heart()}" alt=""></div>`).join('')}
|
||||
<div class="stamp">WINNER</div>`;
|
||||
el.style.visibility = 'visible';
|
||||
const tilt = (Math.random() * 4 - 2).toFixed(2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue