heystreamer/views/settings.ejs
Bashy 19a0965eb2 Activity replay, HUDFX in the overlay, chat filter, redeem art fix
- Dashboard Recent activity: readable details (reward name, cost, variation,
  rarity, TTS, viewer message; sub tier/months; bits; raids; polls), local
  times, and a Replay button. Each row now stores the overlay message that was
  shown (activity_log.replay_json); older redeem/raid rows are rebuilt from the
  raw Twitch event.
- Fix: redeem alerts lost polaroid/art/emote since 4fda606 (they had ended up
  inside a comment), so sticker art, Power-up emotes and sound-only were gone.
- HUDFX embedded in the overlay with ?ext=hudfx (opt-in per OBS source): its
  page is served from our domain with the camcorder CSS, its settings API is
  forwarded, its Web Worker is started from a same-origin stand-in (the alert
  box needs it; blob: workers break the site CSP), and the box sits in the
  alert corner. The HUDFX URL is a field on the Settings page.
- Blerp cassette CSS kept with it (src/ext/blerp.css, pasted into the Blerp
  OBS source; Blerp itself cannot be embedded: its realtime server only
  accepts its own site).
- On-screen chat: Settings -> Hidden chatters and Hide ! commands.
- Outgoing raids are logged with a line in the server log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:29:20 +02:00

112 lines
5.2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h2>Settings</h2>
<article>
<header><strong>Overlay URL</strong></header>
<p>Add this as a <strong>Browser Source</strong> in OBS (1920×1080, transparent background):</p>
<code><%= baseUrl %>/overlay/<%= settings.overlay_id %></code>
</article>
<form method="POST" action="/settings">
<h3>Chat</h3>
<label>
Twitch channel
<input type="text" name="channel" value="<%= settings.channel %>" placeholder="yourchannel">
</label>
<div style="display:grid; grid-template-columns:1fr 1fr; gap:1rem;">
<label>
Message timeout (seconds)
<input type="number" name="message_timeout" value="<%= settings.message_timeout %>" min="0" max="600">
<small>0 = messages stay forever</small>
</label>
<label>
Max messages shown
<input type="number" name="max_messages" value="<%= settings.max_messages %>" min="1" max="100">
</label>
</div>
<label title="Messages from these accounts never appear in the on-screen chat (bots, alert services). Twitch login names, separated by commas or spaces.">
Hidden chatters
<input type="text" name="chat_hidden_users" value="<%= settings.chat_hidden_users || '' %>" placeholder="bot_account, blerp, …">
</label>
<label title="Chat commands like !discord or !lurk are not shown in the on-screen chat. The bot's answer is hidden too if the bot is in Hidden chatters.">
<input type="checkbox" name="chat_hide_commands" role="switch" <%= settings.chat_hide_commands ? 'checked' : '' %>> Hide ! commands
</label>
<h3>Gap audio</h3>
<p><small>Plays a sound when a new message arrives after a period of silence.</small></p>
<label>
<input type="checkbox" name="gap_audio_enabled" role="switch" <%= settings.gap_audio_enabled ? 'checked' : '' %>>
Enable gap audio
</label>
<label>
Sound URL
<input type="text" name="gap_audio_url" value="<%= settings.gap_audio_url %>" placeholder="https://... or /media/filename.mp3">
</label>
<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:1rem;">
<label>
Min silence before triggering (s)
<input type="number" name="gap_audio_min_silence" value="<%= settings.gap_audio_min_silence %>" min="0">
<small>Sound won't play if chat was more recent than this</small>
</label>
<label>
Min volume (0–1)
<input type="number" name="gap_audio_min_volume" value="<%= settings.gap_audio_min_volume %>" min="0" max="1" step="0.05">
<small>Volume right after min silence</small>
</label>
<label>
Max volume (0–1)
<input type="number" name="gap_audio_max_volume" value="<%= settings.gap_audio_max_volume %>" min="0" max="1" step="0.05">
<small>Volume after long silence</small>
</label>
</div>
<label>
Full volume after silence of (seconds)
<input type="number" name="gap_audio_loud_after" value="<%= settings.gap_audio_loud_after %>" min="0">
<small>e.g. 3600 = 1 hour of silence → max volume</small>
</label>
<h3>TTS redeems</h3>
<p><small>For redeem variations with a TTS voice (set on the Redeems page; voices are made on the TTS page).</small></p>
<div style="display:grid; grid-template-columns:1fr 1fr; gap:1rem;">
<label>
Max length (characters)
<input type="number" name="tts_max_chars" value="<%= settings.tts_max_chars %>" min="20" max="500">
<small>Longer messages are cut at a word.</small>
</label>
<label style="align-self:center;">
<input type="checkbox" name="tts_say_name" role="switch" <%= settings.tts_say_name ? 'checked' : '' %>>
Say the name first ("ChickenWhisperer says: …")
</label>
</div>
<label>
Blocked words
<textarea name="tts_blocklist" rows="4" placeholder="one per line, or comma-separated"><%= settings.tts_blocklist %></textarea>
<small>If a message contains one, nothing is read and the letter shows "(message removed)". Whole words and phrases, not case-sensitive, plurals included; also catches swaps like 0→o, $→s and spaced-out letters (k y s). Starts with a list of slurs and Twitch-risky phrases (normal swearing is allowed); edit freely. Links are always removed.</small>
</label>
<h3>HUDFX</h3>
<label title="Paste the browser source URL from HUDFX. Then add &amp;ext=hudfx to an overlay URL in OBS: HUDFX effects play inside that overlay (one audio fader), with the camcorder look. Leave empty to turn it off.">
HUDFX overlay URL
<input type="url" name="hudfx_overlay_url" value="<%= settings.hudfx_overlay_url || '' %>" placeholder="https://overlays.hudfx.io/overlay/…">
</label>
<h3>Custom CSS / JS</h3>
<label>
Custom CSS (injected into the overlay)
<textarea name="custom_css" rows="6" style="font-family:monospace"><%= settings.custom_css %></textarea>
</label>
<label>
Custom JS (injected into the overlay, runs after init)
<textarea name="custom_js" rows="6" style="font-family:monospace"><%= settings.custom_js %></textarea>
</label>
<button type="submit">Save settings</button>
</form>
<hr>
<h3>EventSub</h3>
<form method="POST" action="/settings/reconnect" style="display:inline;">
<button type="submit" class="outline">Reconnect EventSub</button>
</form>
<small style="margin-left:1rem;">Use this if Twitch alerts stop working after a token refresh.</small>