Commit graph

60 commits

Author SHA1 Message Date
Aaron Wood
ad2019ebbc docs: add character creation wizard implementation plan 2026-04-11 10:13:32 -04:00
Aaron Wood
768c55c6b9 fix: dice overlay no longer blocks clicks, fog alpha wired to intensity, title auto-updates from class/alignment/level
- DiceTray: remove pointer-events:auto from .active so UI remains clickable during dice animation
- FogOverlay: accept intensity prop, map 0-100 to 0.15-1.0 opacity
- CampaignView: pass fog intensity to FogOverlay
- InfoPanel: auto-derive Shadowdark title when class/alignment/level changes
- Add shadowdark-titles.ts utility with full title lookup table from Player Quickstart
- Add CLAUDE.md with project instructions and pre-approved permissions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 03:53:00 -04:00
Aaron Wood
b6ca67ff8b docs: add ROADMAP.md with full feature backlog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 03:22:44 -04:00
Aaron Wood
1de0e2edd4 fix: use INSERT IGNORE for campaign_members in seed to handle stale rows
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 02:33:12 -04:00
Aaron Wood
f62e0077d7 feat: rename app title to Darkwatch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:47:06 -04:00
Aaron Wood
47215b48f1 feat: add DM/player role separation — atmosphere, invite, and edit controls gated by role
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:44:27 -04:00
Aaron Wood
e2548ad660 feat: add Login, Register, and Join campaign pages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:38:45 -04:00
Aaron Wood
075a9c5505 feat: add AuthContext, RequireAuth guard, and Darkwatch app routing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:36:38 -04:00
Aaron Wood
11714ecbe4 feat: add credentials:include to all API calls and withCredentials to socket
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:35:01 -04:00
Aaron Wood
a37600fdfa feat: add JWT cookie auth to Socket.io connections and enforce DM-only atmosphere
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:33:35 -04:00
Aaron Wood
fae1e75f6f feat: enforce character ownership — players own their characters, DMs can modify any
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:31:49 -04:00
Aaron Wood
56d46166cd feat: add campaign membership, invite generation, and join-by-token routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:29:42 -04:00
Aaron Wood
d1156745ca feat: add register, login, logout, and me auth endpoints 2026-04-11 00:26:49 -04:00
Aaron Wood
80f0b3535b fix: add req.user guard and try/catch to requireCampaignRole middleware
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:22:48 -04:00
Aaron Wood
bd433286ae feat: add JWT utility and requireAuth/requireCampaignRole middleware 2026-04-11 00:21:53 -04:00
Aaron Wood
39f8220eb7 feat: rewrite seed-dev-data for MariaDB with test users and campaign members
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:20:15 -04:00
Aaron Wood
ec75add5b7 fix: correct character:updated broadcast payload and existence check order
- Broadcast enriched DB row (with parsed overrides) instead of raw req.body
- Check affectedRows from UPDATE to detect missing characters before SELECT
- Import ExecuteValues from mysql2 at the top level instead of inline cast
2026-04-11 00:16:18 -04:00
Aaron Wood
385d9b6e9e feat: convert characters routes to async mysql2
Replace synchronous better-sqlite3 calls with async mysql2 db.execute(),
import parseJson from shared utility, and add try/catch error handling
throughout all character, gear, talent, and stat endpoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:14:49 -04:00
Aaron Wood
2812d81979 fix: add error handling and safe JSON parsing to route handlers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:12:08 -04:00
Aaron Wood
268997a009 feat: convert campaigns, game-items, game-talents, rolls routes to async mysql2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:09:46 -04:00
Aaron Wood
dbc12ac816 feat: wire up migrations, CORS with credentials, cookie-parser 2026-04-11 00:07:42 -04:00
Aaron Wood
5dce775dce fix: add transaction wrapping and SQL splitter documentation in migrate.ts
Each migration file now runs in a transaction - if any statement fails,
the entire file is rolled back and no _migrations record is written.
Also documents the naive semicolon-split constraint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:01:58 -04:00
Aaron Wood
602dc3d098 fix: correct MIGRATIONS_DIR path in migrate.ts
Path was resolving to repo root instead of server/migrations/.
Changed from two '..' segments to one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:59:55 -04:00
Aaron Wood
ed45a84e5a feat: add MariaDB schema migration and runner 2026-04-10 23:56:00 -04:00
Aaron Wood
be38cdc3dc feat: replace better-sqlite3 with mysql2 connection pool
Removes better-sqlite3 and its types, installs mysql2 (async MariaDB
driver) along with jsonwebtoken, bcrypt, cookie-parser, and dotenv.
Rewrites db.ts to export a mysql2 connection pool pointed at the
Darkwatch MariaDB instance (port 3307).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:53:40 -04:00
Aaron Wood
0a32b261e0 feat: add MariaDB Docker container for Darkwatch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:50:51 -04:00
Aaron Wood
e608977b0a docs: add Darkwatch auth + MariaDB implementation plan
18-task plan covering Docker/MariaDB setup, mysql2 migration, JWT auth,
campaign membership, invite links, socket auth, and frontend DM/player views.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:41:51 -04:00
Aaron Wood
1830d80ad4 docs: add Darkwatch auth + MariaDB + DM/player views design spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:28:10 -04:00
Aaron Wood
e2ce57527f feat: replace particle fire with Three.js FBM shader overlay
Switch fire effect from tsParticles to a full-screen Three.js WebGL
shader using layered FBM noise for volumetric-style flames rising from
the bottom of the screen. Also fix rain/embers canvas banding by
switching them to tsParticles fullScreen mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 22:17:36 -04:00
Aaron Wood
bcf118093b fix: tune particle configs — smaller fire, fast circles for rain, better embers
- Fire: 1-5px (was 4-12, balloons), count 60-200, speed 4-10
- Rain: drop line shape (invisible in slim), use fast circles 200-600 at 15-30
  speed so motion reads as streaks
- Embers: 1.5-4px, count 20-80, speed 0.5-2 — clearly slower/dimmer than fire

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 20:01:40 -04:00
Aaron Wood
ecbc696918 fix: rework particle configs for visibility and distinct looks
- Fire: remove broken emitter (not in slim bundle), bigger particles (4-12px),
  more count (80-300), outModes "out" so particles respawn continuously
- Rain: switch to line shape (in slim), size 10-20px for visible streaks,
  higher opacity and speed
- Embers: bump min size to 2-5px, increase count (30-120) for visibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 19:55:48 -04:00
Aaron Wood
0b626601ac fix: use named handler for atmosphere:update socket.off
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 19:47:46 -04:00
Aaron Wood
c953b8c79c fix: move socket interfaces to module scope, fix CSSProperties import 2026-04-10 19:38:34 -04:00
Aaron Wood
993875f8ef feat: update atmosphere:update socket type for full effect state 2026-04-10 19:32:14 -04:00
Aaron Wood
10ba151b6e feat: wire AtmospherePanel and ParticleOverlay into CampaignView 2026-04-10 19:30:51 -04:00
Aaron Wood
55e9019fa9 feat: add AtmospherePanel component with toggles and intensity sliders 2026-04-10 19:29:00 -04:00
Aaron Wood
8da9ac2cf6 feat: add AtmospherePanel CSS module 2026-04-10 19:27:07 -04:00
Aaron Wood
e947e8e127 feat: add ParticleOverlay component for tsParticles effects 2026-04-10 19:25:03 -04:00
Aaron Wood
a6e3ca6066 feat: add tsParticles configs for fire, rain, embers 2026-04-10 19:22:08 -04:00
Aaron Wood
be14a14708 feat: install tsParticles and add atmosphere types 2026-04-10 19:13:39 -04:00
Aaron Wood
8c734c18ec Add .worktrees/ to .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 19:09:07 -04:00
Aaron Wood
7ffb16d08b Add particle effects implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 18:59:46 -04:00
Aaron Wood
646a16cd0f Add particle effects / atmosphere panel design spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 18:54:44 -04:00
Aaron Wood
33032bcd07 Add torch timer, fog atmosphere, DM card redesign, and avatars
- Torch timer: 60min countdown per character, visual warnings at 10m/5m/1m
- Fog overlay: CSS radial gradient layers with seamless infinite drift
- Fog synced across all clients via socket, adapts to light/dark themes
- DM card redesign: compact layout with HP/AC/luck/torch + modifier row
- Grid changed to 3-up (from 4) with larger fonts
- DiceBear avatars on cards and character sheets with style picker
- Campaign name shown in header
- Server: JSON.stringify fix for object fields in PATCH handler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:41:22 -04:00
Aaron Wood
9b12482921 Replace native select elements with custom themed SelectDropdown
- New SelectDropdown component with themed styling matching item/talent pickers
- Replaced all 6 native <select> elements (InfoPanel, CampaignView, GearList)
- Consistent appearance across Linux, Mac, and all browsers
- Alegreya font, gold hover highlights, proper theme colors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 00:32:12 -04:00
Aaron Wood
fbdd9c49ee Fix d100 multi-roll, Linux select styling, and color-scheme support
- d100 rolls now show correct number of percentile + d10 pairs (e.g. 3d100 = 6 dice)
- Add color-scheme: dark/light per theme for native browser controls
- Style select option elements explicitly for Linux Chrome compatibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 00:23:25 -04:00
Aaron Wood
98a3054b93 Mobile layout, campaign name, dropdown theme fix, and z-index fixes
- Mobile: full-screen character sheet, stacked banner, compact header
- Mobile: roll log with 3 states (hidden/peek/half-screen), cycle button
- Mobile: long-press dice buttons for advantage/disadvantage popup
- Show actual campaign name instead of hardcoded "Campaign"
- Fix item/talent picker dropdowns using hardcoded dark backgrounds
- Fix z-index: dice tray (10001) > character sheet (10000) > header (9999)
- Compact app header on mobile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:32:21 -04:00
Aaron Wood
b88fa0cb3e Add luck token toggle, color picker, and click-to-edit ability scores
- Luck token: star toggle (filled/empty) in header, always clickable
- Color picker: input[type=color] next to name in edit mode
- Ability scores: InlineNumber click-to-edit replaces +/- buttons
- Server: added color and luck_token to allowed update fields
- DB: luck_token column migration (default 1)
- Fix dice color for hex color values (was only handling HSL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:35:49 -04:00
Aaron Wood
51ffb0033a Add 3D dice rolling with predetermined outcomes and character colors
- dice-box-threejs for physics-based 3D dice with @ notation for forced values
- Server rolls dice, all clients animate 3D dice landing on exact values
- Dice color matches rolling character's color (darkened HSL as die body)
- Roll log entry delayed until dice animation completes for suspense
- Red pulsing crit glow on damage buttons (visible on all themes)
- Nat 20 roll entries use proper theme background
- Themed scrollbar on main content area
- Stone texture + metal material with white numbers/outlines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:01:05 -04:00
Aaron Wood
ff9203f754 Medieval visual theme with 4 switchable color schemes
- Cinzel + Alegreya fonts for old-tome D&D book feel
- Dark parchment (default), light parchment, white, and abyss themes
- CSS custom properties system for all colors, borders, shadows
- Generated PNG textures for parchment grain, speckle, and wood grain
- Ornamental gold gradient separators and decorative header lines
- Deep dramatic shadows and gold-tinted borders on all panels
- ThemeToggle component with localStorage persistence
- Embossed gold buttons with gradient and inner shadow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 17:06:50 -04:00