heystreamer/views/settings.ejs
Bashy 4fda6060bf TTS redeems, skip button, per-source chat placement
- Redeem variations can have a TTS voice: the viewer's text is cleaned
  (links out, repeats collapsed, max length, blocked words -> not read),
  spoken as "<name> says: ..." and shown as the big paper note; the
  variation's sound is not played when TTS is on (picker greyed out)
- Settings: TTS max length, say-the-name, blocked words (never sent to
  overlay pages: db.getOverlaySettings)
- Dashboard "Skip current alert" -> /alerts/skip -> overlay skips it
- db.migrate()/addColumn: new columns on existing databases
- Chat: ?chat=left,top,width,height and ?chatflow=up per browser source
  (e.g. the Intermission panel); default unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:34:41 +02:00

98 lines
4.1 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>
<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="300">
<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 note shows "(message removed)". Not case-sensitive; also catches simple swaps like 0→o, $→s, and spaced-out letters for words of 4+ letters. Links are always removed.</small>
</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>