Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
6da58bb
upgrade typescript, add partykit
noahm Jun 23, 2024
6636fe7
initial working-ish prototype
noahm Jun 23, 2024
2e86cd6
set base font family on root rather than body
noahm Jun 27, 2024
687eba3
convert major state management to redux
noahm Jul 3, 2024
8d89248
Now it actually works with redux!
noahm Jul 3, 2024
fd2f0a3
re-sort dependencies
noahm Jul 3, 2024
60e7369
make config slice naturally json compatible
noahm Jul 3, 2024
18305be
speculative wireup for new partykit networking
noahm Jul 4, 2024
82a22c9
reorganize further so server can build
noahm Jul 4, 2024
8c763eb
move game data loading out of redux
noahm Jul 11, 2024
0da3104
add client-side routing, pull room from url
noahm Jul 12, 2024
6cee1a4
nicer UI while connecting
noahm Jul 12, 2024
9e05f4e
add deployed partykit host
noahm Jul 12, 2024
6ac6102
restore behavior of newest drawings at the top
noahm Jul 12, 2024
0aea805
merge main, dedupe deps
noahm Jul 12, 2024
a36c853
add vercel.json for client-side routing support
noahm Jul 12, 2024
acb594c
add event state slice
noahm Jul 12, 2024
1774363
add persisted webpack cache
noahm Jul 13, 2024
7e6eaea
add basic cab management
noahm Jul 13, 2024
050bf29
add standalone obs source views
noahm Jul 13, 2024
2acb83b
allow new slices to retain their default state
noahm Jul 13, 2024
326c40b
prepopulate default cab
noahm Jul 13, 2024
07a5109
create default cab via lazy initialization
noahm Jul 13, 2024
a968254
non random initial state
noahm Jul 13, 2024
566d291
add very basic gql+codegen setup
noahm Jul 14, 2024
f05677b
remove unused zustand utils
noahm Jul 18, 2024
648e575
groundwork for entrants state from startgg
noahm Jul 18, 2024
a5cd475
move participatns tab from drawer to main view
noahm Jul 18, 2024
9dea64d
first working name imports
noahm Jul 18, 2024
453681c
prototype of set imports
noahm Jul 19, 2024
14c65c1
preliminary handling of prereqs
noahm Jul 19, 2024
060ad07
Merge remote-tracking branch 'origin/main' into partykit
noahm Jul 22, 2024
ac33403
Merge branch 'main' into partykit
noahm Jul 27, 2024
905134d
cleaner root handler
noahm Jul 27, 2024
e122c3b
temporary rollback for player name management
noahm Jul 27, 2024
1a0e53f
fix reorder by pick/ban
noahm Jul 27, 2024
16e0e39
fix jacket images in search results
noahm Jul 27, 2024
fa81259
Merge remote-tracking branch 'origin/main' into partykit
noahm Jul 28, 2024
63844a6
Merge branch 'main' into partykit
noahm Jul 28, 2024
a441fd6
use a single urql client instacne
noahm Jul 28, 2024
a710972
big steps towards startgg integration
noahm Aug 1, 2024
6b264cb
Merge remote-tracking branch 'origin/partykit' into partykit
noahm Aug 8, 2024
4cf7ae8
fix folders being nulled on defaults being applied
noahm Aug 9, 2024
2c0570d
fix selector warning from cab management
noahm Aug 9, 2024
ecbef09
use draw starting point to respect weights in redraws
noahm Aug 9, 2024
aa4985a
fix keeping protects and pocket picks in a redraw all situation
noahm Aug 9, 2024
3b246aa
prevent dupes in single chart redraw
noahm Aug 9, 2024
d402541
experimental draw blocklist
noahm Aug 9, 2024
4e11f60
add some real startgg integration
noahm Aug 13, 2024
935ec73
display url example inline
noahm Aug 13, 2024
2359225
pre-populate initial values for startgg inputs
noahm Aug 13, 2024
95384a9
persist startgg event info to localstorage
noahm Aug 13, 2024
39af9fa
fix swapping player positions by totally blowing up the drawing model
noahm Aug 14, 2024
d365278
added working reporting of results to startgg
noahm Aug 17, 2024
18499ef
display scores on drawing labels
noahm Aug 17, 2024
0a97fda
add player scores to obs sources
noahm Aug 17, 2024
85cdbce
fix reporting scores when only 1 player wins songs
noahm Aug 17, 2024
24a6080
very quick and dirty draw without match
noahm Aug 19, 2024
6699a3f
add quick picker for startgg events
noahm Aug 19, 2024
91f8908
Merge branch 'main' into partykit
noahm Aug 22, 2024
c41193f
another dedupe
noahm Aug 22, 2024
a79f4aa
experimental static cards display endpoint
noahm Sep 2, 2024
43eb438
early bits of multiconfig (all broken)
noahm Sep 4, 2024
7dff004
kind of working multiconfig
noahm Sep 6, 2024
d216e3f
select config after creating one
noahm Sep 7, 2024
6451cde
actually working multiconfig now!
noahm Sep 7, 2024
717d554
actually working copy/delete for configs
noahm Sep 7, 2024
2aab4f5
move config select/controls to drawer header
noahm Sep 7, 2024
03c1f24
Merge remote-tracking branch 'origin/main' into partykit
noahm Sep 7, 2024
22caf6d
fix crash when clearing drawings
noahm Sep 11, 2024
11f4c67
persist to supabase in addition to partykit
noahm Oct 3, 2024
61c991b
Add a "draw one chart" action
noahm Oct 3, 2024
f264ac7
fully wire up import from json
noahm Oct 3, 2024
89069b0
fix pocket picks for P1
noahm Oct 3, 2024
406d537
add newly added charts to the end
noahm Oct 3, 2024
3419e77
apply basis config over game's defaults
noahm Oct 3, 2024
916c098
bump partykit
noahm Oct 3, 2024
3b7c480
slightly nicer custom draws, support over 2 players again
noahm Oct 15, 2024
9c9a312
add new obs source for all player names
noahm Oct 15, 2024
db20cde
Merge branch 'main' into partykit
noahm Oct 19, 2024
ad1cca0
creating a config should be less confusing
noahm Oct 19, 2024
0de39e0
add delete draw action
noahm Oct 19, 2024
bce5f35
add gauntlet draws from startgg
noahm Oct 19, 2024
ca215b7
hide wins by names on gauntlet draws
noahm Oct 19, 2024
630c093
fix infinite loop on redraw/extra cards
noahm Oct 22, 2024
e5d2980
update alpha preview title in header
noahm Oct 22, 2024
f77c8b7
add almost working score editor for gauntlet draws
noahm Oct 22, 2024
43237d6
remove all concepts of app-wide selected config
noahm Oct 22, 2024
6b36423
add informative tooltip when draw is disabled
noahm Oct 22, 2024
733636e
allow cabs sidebar to show and hide
noahm Oct 22, 2024
e426240
put custom draw as the first tab
noahm Oct 22, 2024
d9c02e0
remove static cards
noahm Oct 23, 2024
b88dccf
fix normal obs cards source
noahm Oct 23, 2024
afd5cd6
add video link to landing page
noahm Oct 24, 2024
138d4f0
Move update manager to the top component
noahm Oct 24, 2024
5f835d7
safely return nothing when drawing is missing
noahm Oct 25, 2024
23d707b
Merge remote-tracking branch 'origin/main' into partykit
noahm Nov 7, 2024
4fa3946
Merge remote-tracking branch 'origin/main' into partykit
noahm Nov 13, 2024
8a8ca88
Merge remote-tracking branch 'origin/main' into partykit
noahm Jan 6, 2025
a66db55
remove artist blocklist
noahm Jan 6, 2025
26a9f05
Merge remote-tracking branch 'origin/main' into partykit
noahm Jan 7, 2025
2bbcb3e
catch errors in restoring state
noahm Jan 11, 2025
153c944
catch errors from upsert, respond to get reqs
noahm Jan 11, 2025
822e5b9
Add classic mode route with localstorage persistence
noahm Jan 20, 2025
8bb123f
Merge branch 'main' into partykit
noahm Feb 6, 2025
0cade3f
fix busted tabs on draw dialog
noahm Feb 6, 2025
d3c5917
fix eligible charts filter
noahm Feb 6, 2025
2f0f356
Merge branch 'main' into partykit
noahm Feb 6, 2025
76a6ec0
green checks pls
noahm Feb 6, 2025
4fc8519
Merge branch 'main' into partykit
noahm Feb 8, 2025
4d6bd71
Merge remote-tracking branch 'origin/main' into partykit
noahm Feb 10, 2025
ec14e2c
Merge branch 'main' into partykit
noahm Feb 12, 2025
0a7d920
Merge branch 'main' into partykit
noahm Apr 1, 2025
bf1e388
Merge branch 'main' into partykit
noahm Apr 1, 2025
4c5cebd
re-apply forcing latest `prebuid-install`
noahm Apr 1, 2025
afe6621
Merge remote-tracking branch 'origin/main' into partykit
noahm Apr 11, 2025
aa2c636
Merge branch 'main' into partykit
noahm Apr 11, 2025
d523dee
correctly set key on set label for 2-player match
noahm Apr 11, 2025
0527fbf
Merge branch 'main' into partykit
noahm Apr 12, 2025
7ae53ff
Merge branch 'main' into partykit
noahm Apr 20, 2025
13d3b97
create obs source for isolated player name and score
vlnguyen May 1, 2025
17fe188
Merge pull request #447 from noahm/vlnguyen/partykit-obs-sources
noahm May 1, 2025
a49a9d7
Merge branch 'main' into partykit
noahm May 1, 2025
6abe6a9
nicer scripts setup
noahm May 1, 2025
1e8da4d
dynamically disable supabase
noahm May 1, 2025
17b19d8
scuffed demo of multidraw
noahm May 1, 2025
8999505
Merge branch 'main' into partykit
noahm May 30, 2025
dde9d2a
Merge branch 'main' into partykit
noahm May 30, 2025
e698fcc
cleanup broken merge
noahm May 30, 2025
0e22a74
fix typecheck ci
noahm May 30, 2025
75ba07b
fix song data lint too
noahm May 30, 2025
4255731
Merge remote-tracking branch 'origin/main' into partykit
noahm Jun 1, 2025
68d76be
Merge pull request #454 from noahm/main
noahm Jun 8, 2025
ad20c4d
add docs on custom styles in OBS
noahm Jun 13, 2025
9a7364a
remove image preload from html template
noahm Jun 13, 2025
659e5e6
enable scrolling in cab sidebar
noahm Jun 19, 2025
d4ad263
fix closing draw modal after performing custom draw
noahm Jun 19, 2025
ea39543
rebuild draw settings into standalone page
noahm Jun 19, 2025
2718c21
enable less aggressive offline behavior
noahm Jun 20, 2025
d492888
Merge branch 'storm-multidraw' into partykit
noahm Jun 20, 2025
8bc7a77
rework subdraw data structure
noahm Jun 20, 2025
a0b6f42
better config behavior when changing between game families
noahm Jun 20, 2025
b5165ce
integrate config context into draw context
noahm Jun 20, 2025
cd34d35
switch subDrawings to a record type
noahm Jun 20, 2025
46048bc
lots of work on drawing actions
noahm Jun 20, 2025
e428ec7
keep actions on subdraw charts in parent
noahm Jun 21, 2025
7fe987e
aggressively rework around subdraws as the only path
noahm Jun 21, 2025
6ceb0a8
split drawing actions into match and set
noahm Jun 22, 2025
6f37636
improve rotating gradients with oklch
noahm Jun 22, 2025
40ea0ce
add an action to merge sets
noahm Jun 22, 2025
380bd86
better icons for assign to cab
noahm Jun 22, 2025
99c3bcc
add P1 and P2 as defaults for new draws
noahm Jun 22, 2025
049516a
minor tweaks to docs
noahm Jun 22, 2025
1e2d62d
add config for pre-decided extra sets
noahm Jun 22, 2025
005447b
add margin below multidraw controls
noahm Jun 22, 2025
e0c4a19
Merge pull request #455 from noahm/multidraw
noahm Jun 23, 2025
399705d
Merge branch 'main' into partykit
noahm Jun 25, 2025
e8a7397
minor dependency cleanup
noahm Jun 26, 2025
e5e6376
import syr5 data
noahm Jun 28, 2025
3bcbcc5
Merge branch 'main' into partykit
noahm Jul 5, 2025
1da2f31
remove unneeded height 100% rules
noahm Jul 13, 2025
50db644
Merge branch 'main' into partykit
noahm Jul 15, 2025
57de272
Merge branch 'main' into partykit
noahm Jul 15, 2025
9a533ae
fix player order swapping and priority indicator
noahm Jul 26, 2025
aba5b74
Merge remote-tracking branch 'origin/main' into partykit
noahm Jul 29, 2025
a4a59c9
Merge branch 'main' into partykit
noahm Jul 29, 2025
9820263
Merge branch 'main' into partykit
noahm Aug 22, 2025
8c64afb
Merge remote-tracking branch 'origin/main' into partykit
noahm Aug 22, 2025
20121ee
Merge branch 'main' into partykit
noahm Aug 23, 2025
682468b
Merge branch 'main' into partykit
noahm Sep 2, 2025
fadb0b8
Merge branch 'main' into partykit
noahm Sep 2, 2025
4f7c4be
add a new obs source for phase name
noahm Sep 6, 2025
e6ed57c
add a stream dashboard with custom text sources
noahm Sep 7, 2025
5c3048e
enable drag-drop for custom text sources as well
noahm Sep 7, 2025
44d4a79
auto-update obs sources invisibly
noahm Sep 7, 2025
b570caf
convert theme from enum to string union type
noahm Sep 7, 2025
69e4f2b
add global css styles for obs sources
noahm Sep 7, 2025
28ed43a
Merge branch 'main' into partykit
noahm Sep 10, 2025
18de561
Merge branch 'main' into partykit
noahm Sep 22, 2025
4a8a321
Fixup redraws and free picks
noahm Sep 22, 2025
d3cebfb
fix copying obs sources to clipboard
noahm Sep 23, 2025
b0ece19
allow adding player pick to existing draws
noahm Sep 23, 2025
ed31888
Merge branch 'main' into partykit
noahm Oct 3, 2025
4856505
Merge branch 'main' into partykit
noahm Oct 11, 2025
2c92186
Merge branch 'main' into partykit
noahm Oct 11, 2025
71d4dd2
Merge branch 'main' into partykit
noahm Oct 13, 2025
890af59
Merge branch 'main' into partykit
noahm Oct 13, 2025
dd156c7
Merge branch 'main' into partykit
noahm Oct 16, 2025
7e50574
remove event wrapper from state getter
noahm Oct 28, 2025
58d8b05
add a content type to http responses
noahm Oct 28, 2025
9eb1281
more strictly supply store via context
noahm Nov 1, 2025
e94db1d
update hero callouts
noahm Nov 1, 2025
b8b2492
add routes and implementation for new preview mode
noahm Nov 1, 2025
000cdd7
rework config editor to allow generating preview links
noahm Nov 1, 2025
04bc41a
Merge branch 'main' into partykit
noahm Nov 4, 2025
0ccd13b
Merge branch 'main' into partykit
noahm Nov 4, 2025
f3e6d52
correct dashdance default bounds
noahm Nov 7, 2025
8819dee
apply default bounds when changing games
noahm Nov 7, 2025
58ad0b7
simplify config select logic to use more component boundaries
noahm Nov 8, 2025
4559e55
don't also add a regular chart when adding a placeholder
noahm Nov 9, 2025
b7ce7f3
Merge branch 'main' into partykit
noahm Nov 9, 2025
3252098
Merge remote-tracking branch 'origin/main' into partykit
noahm Nov 9, 2025
91b42bd
Merge branch 'main' into partykit
noahm Dec 4, 2025
7454c3e
icon tweak for drawing actions
noahm Dec 4, 2025
cad19eb
Merge branch 'main' into partykit
noahm Dec 24, 2025
a3bf948
we've been infected by node types :angery:
noahm Dec 24, 2025
9fb5e1a
Merge branch 'main' into partykit
noahm Jan 2, 2026
801f41f
Merge branch 'main' into partykit
noahm Jan 18, 2026
b724f6c
Merge branch 'main' into partykit
noahm Jan 19, 2026
05ee8b2
rename IconMenu to ActionMenu
noahm Jan 19, 2026
b5d5fc0
add random chart selection within a draw
noahm Jan 19, 2026
676aa79
Merge branch 'main' into partykit
noahm Jan 22, 2026
3f8da93
Merge branch 'main' into partykit
noahm Jan 24, 2026
ddafd93
Merge branch 'main' into partykit
noahm Jan 24, 2026
35cf75f
Merge branch 'main' into partykit
noahm Feb 5, 2026
3d3ff96
Merge branch 'main' into partykit
noahm Feb 8, 2026
f50a612
Merge branch 'main' into partykit
noahm Feb 12, 2026
560e976
Merge branch 'main' into partykit
noahm Feb 12, 2026
115fbaf
memoize fuzzy search
noahm Mar 5, 2026
f484a95
Merge branch 'main' into partykit
noahm Mar 5, 2026
deec97e
Merge branch 'main' into partykit
noahm Mar 28, 2026
788f88b
Merge branch 'main' into partykit
noahm Mar 29, 2026
e5c54ef
Merge branch 'main' into partykit
noahm Apr 13, 2026
5a6d680
Merge branch 'main' into partykit
noahm May 18, 2026
f17bfb5
Merge remote-tracking branch 'origin/main' into partykit
noahm Jun 8, 2026
8e27663
Merge branch 'main' into partykit
noahm Jun 9, 2026
25143e3
Merge remote-tracking branch 'origin/main' into partykit
noahm Jun 10, 2026
17c0b25
Merge remote-tracking branch 'origin/main' into partykit
noahm Jun 11, 2026
bca5e30
add batch export/import of configs
noahm Jun 11, 2026
a9acedb
bump partysocket, remove peerjs
noahm Jun 11, 2026
dc87911
Merge remote-tracking branch 'origin/main' into partykit
noahm Jun 11, 2026
93ef61c
edit routing to allow players beyond 2 in obs sources
noahm Jun 12, 2026
d5c93fa
Merge branch 'main' into partykit
noahm Jun 19, 2026
731be27
Fix removing protect/pocket action also clearing marked winner
claude Jun 23, 2026
b2bcc0e
Merge pull request #594 from noahm/claude/protect-action-winner-bug-p…
noahm Jun 23, 2026
26749ef
Merge remote-tracking branch 'origin/main' into partykit
noahm Jun 27, 2026
9c6abc0
enable yarn global cache
noahm Jun 27, 2026
f346cbe
Notify users of partykit websocket health and block dispatch while down
claude Jul 6, 2026
9f415c3
Add receipt confirmation and re-send to the partykit action protocol
claude Jul 6, 2026
775612c
Sequence all actions through the server for convergent replication
claude Jul 6, 2026
075a6c0
Document the current event-mode backend and sync design
claude Jul 7, 2026
3306b0b
Merge pull request #604 from noahm/claude/partykit-websocket-health-t…
noahm Jul 8, 2026
0688aeb
remove redundant i18n provider
noahm Jul 8, 2026
fb11a79
add a few extra doc comments to sync manager
noahm Jul 8, 2026
690ae2d
tweak disconnected message
noahm Jul 8, 2026
d854a11
bump partysocket
noahm Jul 8, 2026
9a330d0
Merge remote-tracking branch 'origin/main' into partykit
noahm Jul 8, 2026
831aaf0
convert player list to string id-based, add easier reordering
noahm Jul 12, 2026
e87329f
re-sort deps
noahm Jul 12, 2026
a87de82
open up CORS on party server get method
noahm Jul 12, 2026
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
47 changes: 47 additions & 0 deletions .claude/skills/verify/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: verify
description: Build, launch, and drive DDRCardDraw locally to verify changes at the browser surface.
---

# Verifying DDRCardDraw changes

## Build & launch

Two dev servers, both from the repo root (partykit needs `partykit.json` in cwd):

```bash
yarn install
npx partykit dev --port 1999 # websocket/state backend (event mode)
yarn start:frontend # webpack dev server on :8080
```

Wait until `curl http://localhost:1999/parties/main/anyroom` returns 200 (partykit)
and `curl http://localhost:8080/` returns 200 (webpack; first build takes ~1-2 min).

## Drive

Playwright (chromium at `/opt/pw-browsers/chromium-*/chrome-linux/chrome` in remote
envs) against:

- `http://localhost:8080/classic` — classic mode, no backend needed.
- `http://localhost:8080/e/<any-room-name>` — event/tournament mode, backed by the
partykit socket. Rooms are created on first visit.

Useful flows in event mode:

- Expand the cab panel: click the lone caret button in the 40px-wide left rail.
- Add a cab: fill `input[placeholder="Cab name"]`, press Enter — dispatches a
redux action that round-trips through the partykit socket.
- Kill/restart `partykit dev` to exercise disconnect/reconnect handling
(toasts appear via the app-root OverlayToaster).

## Gotchas

- `pkill -f 'partykit dev'` matches its own wrapping shell — use `pkill -f '[p]artykit dev'`.
- `partykit dev` spawns a `workerd` child that actually owns port 1999 and the
websockets. To simulate a stalled/dead server, signal `'[w]orkerd serve'`
(SIGSTOP freezes it without closing sockets — great for ack-timeout tests);
killing only the node wrapper leaves the server running. Playwright's
`page.on("websocket")` frame events give protocol-level evidence.
- Dev `partykit dev` persists room state to disk, so room contents survive a backend restart.
- In dev, the frontend targets `localhost:1999` automatically (`src/party/host.ts`).
9 changes: 9 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Generate one of your own for free at
# https://start.gg/admin/profile/developer
# Read more about start.gg auth here:
# https://developer.start.gg/docs/authentication
STARTGG_TOKEN=YOUR_TOKEN_HERE

# For persistence of the partykit state to somewhere more reliable
SUPABASE_URL=SOMETHING
SUPABASE_KEY=SOMETHING
4 changes: 2 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
strategy:
matrix:
include:
- check: "validate:json"
- check: "validate:types:data"
name: Validate Song Data
- check: "validate:ts"
- check: "validate:types:ts"
name: Typecheck
- check: "validate:format"
name: Formatting
Expand Down
6 changes: 5 additions & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"ignorePatterns": ["src/assets/jackets/*", "tsconfig.json"]
"ignorePatterns": [
"src/assets/jackets/*",
"tsconfig.json",
"src/startgg-gql/generated/*"
]
}
7 changes: 6 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"env": {
"builtin": true
},
"ignorePatterns": ["scripts/", "surge-redirect/", "webpack.config.js"],
"ignorePatterns": [
"scripts/",
"surge-redirect/",
"webpack.config.js",
"src/party/database.types.ts"
],
"rules": {
// #region typescript-eslint recommended (excepts correctness rules)
"no-array-constructor": "error",
Expand Down
2 changes: 0 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.12.0.cjs
17 changes: 17 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { CodegenConfig } from "@graphql-codegen/cli";
import baseConfig from "./graphql.config";

const config: CodegenConfig = {
...baseConfig,
ignoreNoDocuments: false, // for better experience with the watcher
generates: {
"./src/startgg-gql/generated/": {
preset: "client",
presetConfig: {
fragmentMasking: false,
},
},
},
};

export default config;
Binary file added docs/images/obs/custom-font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/obs/obs-source-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/obs/obs-source-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/obs/simple-css.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/obs/source-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions docs/obs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# OBS Sources

The app provides a number of single-purpose URLs for use within OBS as browser type source. Each individual cab has its own set of sources, which will update as the match assigned to that cab changes.

![alt text](images/obs/source-menu.png)

After clicking on one, the URL will be put on your clipboard. In OBS you can add that info to your stream layout by adding a new browser source.

![alt text](images/obs/obs-source-add.png)

Paste the copied URL into the properties and click OK.

![alt text](images/obs/obs-source-properties.png)

If you have a match assigned to the chosen cab, then you should see the text appear immediately. If nothing is assigned to the cab, then the source will display nothing at all.

## Custom styles

Adding custom CSS to text-based sources is a great way to help the info fit the graphic design of the rest of your stream graphics.

All text-based sources from DDR Tools render inside a single `h1` HTML tag. Keep the existing default styles for `body` and add extra styles below. As a simple example:

```css
body {
background-color: rgba(0, 0, 0, 0);
margin: 0px auto;
overflow: hidden;
}
h1 {
color: black;
font-size: 600%;
text-shadow: 2px 2px 2px white;
-webkit-text-stroke: 2px red;
}
```

![alt text](images/obs/simple-css.png)

For more info on styling text with CSS, refer to [MDN documentation](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Text_styling).

Some common CSS style rules that will likely be useful for a stream layout:

- [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) ([more on this below](#text-alignment))
- [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) ([more on this below](#custom-fonts))
- [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color)
- [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
- [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
- [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style)
- [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow)
- [-webkit-text-stroke](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke)

### Text alignment

In order to have text position correctly within the layout as it updates with values of varying lengths, it's important that you set the correct alignment direction! Text will align left by default, but if it should be visually centered in the layout (e.g. a title) or aligned against the right side (e.g. name of a player on the right) then the alignment should be set accordingly.

If you use no other custom styles, at least set the alignment of anything not left-aligned correctly with one of:

- `text-align: center;`
- `text-align: right;`

### Custom Fonts

The font of choice can be chosen with a `font-family` rule. By default it will have access to any font you have installed locally on your system. Additional fonts can be used without any installation steps directly from google fonts:

1. Visit [fonts.google.com](https://fonts.google.com) and find something you would like to use. (for example, [Tektur](https://fonts.google.com/specimen/Tektur?categoryFilters=Feeling:%2FExpressive%2FFuturistic))
2. Click the "Get Font" button on the font page, and then the "Get embed code" button.
3. On the web tab, switch to `@import` style.
4. Copy the contents of the `<style>` tag into the custom css in OBS, and note that @import rules must be _AT THE VERY TOP_.
5. Add a `font-family` rule to the `h1` style block selecting the custom font.

A final example in action:

```css
@import url("https://fonts.googleapis.com/css2?family=Tektur:wght@400..900&display=swap");
body {
background-color: rgba(0, 0, 0, 0);
margin: 0px auto;
overflow: hidden;
}
h1 {
font-family: "Tektur";
font-size: 600%;
}
```

![alt text](images/obs/custom-font.png)
Loading