Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build check

on:
on:
pull_request:
branches:
- main
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/demo-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Demo page

on:
pull_request:
branches:
- main
paths:
- "apps/demo/**"
- "apps/web/**"
- "packages/ui/overlay-engine/**"
- "packages/interfaces/**"
- "package.json"
- "bun.lock"
- ".github/workflows/demo-pages.yaml"
push:
branches:
- main
paths:
- "apps/demo/**"
- "apps/web/**"
- "packages/ui/overlay-engine/**"
- "packages/interfaces/**"
- "package.json"
- "bun.lock"
- ".github/workflows/demo-pages.yaml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: pages
cancel-in-progress: false

jobs:
check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.4
- run: bun install --frozen-lockfile
- run: bun run build:demo

deploy:
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/[email protected]
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.4
- run: bun install --frozen-lockfile
- run: bun run build:demo
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: apps/demo/dist
- id: deployment
uses: actions/deploy-pages@v4
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
A Discord bot for Twitch live alerts and Spotify song requests, with a web dashboard
and an OBS overlay editor. Build scenes with draggable widgets, chat, images and videos.

## Live demo

Try the static overlay-editor demo at
[philbode.github.io/StreamCat](https://philbode.github.io/StreamCat/).

The demo includes the server dashboard, a mocked server settings view, and the real
overlay editor. It uses mock data and keeps changes in your browser. It does not need an
account or a running backend, and it cannot connect to Discord, Twitch, Spotify or OBS.

Run it locally with `bun install && bun run dev:demo`.

Deployment uses GitHub Actions; the repository Pages source must be set to
**GitHub Actions**.

## License

[MIT](LICENSE)
Expand Down
6 changes: 6 additions & 0 deletions apps/backend/src/features/overlays/settings/overlay-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function chatSettings(params: Record<string, unknown>): Partial<ChatWidgetParams
throw new BadRequestException("Ungültiger Twitch-Kanal.")
const settings = {
...TWITCH_CHAT_DEFAULTS,
title: "Stream Chat",
chatChannel: channel.trim(),
chatFont: chatFont(params.chatFont ?? TWITCH_CHAT_DEFAULTS.chatFont)
}
Expand All @@ -137,6 +138,11 @@ function chatSettings(params: Record<string, unknown>): Partial<ChatWidgetParams
if (typeof params[key] !== "boolean") throw new BadRequestException("Ungültige Chat-Einstellung.")
settings[key] = params[key]
}
if (params.title !== undefined) {
if (typeof params.title !== "string" || params.title.length > 80)
throw new BadRequestException("Der Fenstertitel darf maximal 80 Zeichen enthalten.")
settings.title = params.title.trim() || "Stream Chat"
}
return settings
}

Expand Down
19 changes: 19 additions & 0 deletions apps/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="referrer" content="no-referrer" />
<meta name="theme-color" content="#000000" />
<link rel="icon" href="data:," />
<meta
name="description"
content="Statische StreamCat-Demo: Overlay-Editor mit lokalen Mock-Daten ausprobieren."
/>
<title>StreamCat · Overlay-Editor Demo</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@streamcat/demo",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build",
"preview": "vite preview",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@streamcat/interfaces": "workspace:*",
"@streamcat/overlay-engine": "workspace:*",
"react": "19.3.1",
"react-dom": "19.3.1"
},
"devDependencies": {
"@types/node": "^26.6.5",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "6.3.0",
"typescript": "~6.0.3",
"vite": "8.3.8"
}
}
37 changes: 37 additions & 0 deletions apps/demo/public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="referrer" content="no-referrer" />
<title>StreamCat Demo</title>
<style>
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
background: #000;
color: #eee;
font-family: ui-monospace, monospace;
}
a {
color: inherit;
}
</style>
<script>
;(() => {
const segments = window.location.pathname.split("/").filter(Boolean)
const dashboard = segments.indexOf("dashboard")
if (dashboard === -1) return
const rest = segments.slice(dashboard + 1)
const view = rest.length === 0 ? "dashboard" : rest[1] === "overlay" ? "editor" : "guild"
const base = segments.slice(0, dashboard).join("/")
window.location.replace((base ? "/" + base : "") + "/?view=" + view)
})()
</script>
</head>
<body>
<p>Demo wird geladen … <a href="./">Zur Startseite</a></p>
</body>
</html>
183 changes: 183 additions & 0 deletions apps/demo/public/demo-chat.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="referrer" content="no-referrer" />
<title>Demo Twitch-Chat</title>
<style>
:root {
color-scheme: normal;
--chat-font: "Trebuchet MS", "Segoe UI", sans-serif;
--chat-size: 32px;
}
html,
body {
height: 100%;
margin: 0;
overflow: hidden;
background: transparent !important;
}
body {
display: flex;
flex-direction: column;
color: #efeff1;
font-family: var(--chat-font);
font-size: var(--chat-size);
line-height: 1.35;
}
.chat {
flex: 1;
min-height: 0;
padding: 8px 12px;
overflow: hidden;
mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 100%);
-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 100%);
}
.chat-inner {
display: flex;
flex-direction: column;
justify-content: flex-end;
min-height: 100%;
gap: 3px;
}
.line {
overflow-wrap: anywhere;
animation: enter 180ms ease-out both;
}
.no-animate .line {
animation: none;
}
.badge {
display: inline-block;
margin-right: 3px;
color: #ffd479;
}
.name {
font-weight: 700;
color: var(--name, #a970ff);
}
.name::after {
content: ":";
color: #efeff1;
}
.text {
color: #efeff1;
}
@keyframes enter {
from {
opacity: 0;
transform: translateY(4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (prefers-reduced-motion: reduce) {
.line {
animation: none;
}
}
</style>
</head>
<body>
<div class="chat" aria-live="off">
<div class="chat-inner" id="chat"></div>
</div>
<script>
const params = new URLSearchParams(window.location.search)
const font = params.get("font") || "Roboto"
const size = Number(params.get("size") || 3)
const fade = Number(params.get("fade") || 30)
const animate = params.get("animate") !== "false"
// The settings are labelled "hide ...", so checked means hide in the demo.
const hideBots = params.get("bots") !== "false"
const hideCommands = params.get("hide_commands") !== "false"
const hideBadges = params.get("hide_badges") !== "false"

const fontStacks = {
"Baloo Tammudu": '"Trebuchet MS", "Segoe UI", sans-serif',
"Segoe UI": '"Segoe UI", "Trebuchet MS", sans-serif',
Roboto: 'Roboto, "Segoe UI", sans-serif',
Lato: 'Lato, "Segoe UI", sans-serif',
"Noto Sans": '"Noto Sans", "Segoe UI", sans-serif',
"Source Code Pro": '"Source Code Pro", monospace',
Impact: 'Impact, "Arial Black", sans-serif',
Comfortaa: 'Comfortaa, "Trebuchet MS", sans-serif',
"Dancing Script": '"Dancing Script", cursive',
"Indie Flower": '"Indie Flower", cursive',
"Press Start 2P": '"Press Start 2P", monospace',
Wallpoet: "Wallpoet, fantasy",
Tiny5: '"Tiny5", monospace',
"Jersey 10": '"Jersey 10", monospace'
}
const sizeStacks = ["14px", "18px", "24px", "32px"]
const fontStack =
fontStacks[font] || '"' + String(font).replace(/["\\]/g, "") + '", "Trebuchet MS", sans-serif'

document.documentElement.style.setProperty("--chat-font", fontStack)
document.documentElement.style.setProperty("--chat-size", sizeStacks[size] || sizeStacks[3])
document.body.classList.toggle("no-animate", !animate)

const messages = [
{name: "nora_streams", text: "der editor sieht stark aus", color: "#ff9d5c", badge: "★"},
{name: "pixelpaule", text: "kann ich das overlay direkt in obs nutzen?", color: "#7bd88f"},
{name: "StreamCat", text: "Song Request hinzugefügt: Midnight Drive", color: "#f6aa1c", bot: true},
{name: "mika", text: "drag and drop ist so smooth", color: "#ff8fbd", badge: "✦"},
{name: "pixelpaule", text: "!sr Midnight Drive", color: "#7bd88f", command: true},
{name: "catcode", text: "die szenen-wechsel sind genau richtig", color: "#8eb8ff"},
{name: "luna", text: "wie viele widgets passen auf eine szene?", color: "#ffd479"},
{name: "ben", text: "1920x1080, alles bleibt an ort und stelle", color: "#b8a1ff"},
{name: "nora_streams", text: "und alles nur lokal im browser", color: "#ff9d5c", badge: "★"},
{name: "pixelpaule", text: "demo login geklickt, los gehts", color: "#7bd88f"}
]
const visible = messages.filter(
(message) => !(hideBots && message.bot) && !(hideCommands && message.command)
)

const chat = document.getElementById("chat")
const entries = []
let index = 0

function prune() {
if (!fade) return
const cutoff = Date.now() - fade * 1000
while (entries[0] && entries[0].at < cutoff) {
entries.shift().element.remove()
}
}

function addLine() {
const message = visible[index % visible.length]
index += 1
const line = document.createElement("div")
line.className = "line"
if (!hideBadges && message.badge) {
const badge = document.createElement("span")
badge.className = "badge"
badge.textContent = message.badge
line.append(badge)
}
const name = document.createElement("span")
name.className = "name"
name.textContent = message.name
name.style.setProperty("--name", message.color)
const text = document.createElement("span")
text.className = "text"
text.textContent = " " + message.text
line.append(name, text)
chat.append(line)
entries.push({element: line, at: Date.now()})
prune()
while (entries.length > 14) entries.shift().element.remove()
}

addLine()
addLine()
addLine()
window.setInterval(addLine, 2400)
window.setInterval(prune, 1000)
</script>
</body>
</html>
Loading