Commit graph

2 commits

Author SHA1 Message Date
King Omar
942da4b6a5 Add light/dark theme toggle to all pages
- Flash-prevention script in <head> reads radical_theme from localStorage and
  sets data-theme on <html> before first paint — no FOUC
- Fixed ☀️/🌙 button (top-right, z-index 9999) on index, admin, and login using
  CSS ::before so the icon is driven by data-theme with no JS initialization
- Light mode: #F5F3EF warm off-white body, #E8E6E2 cards, #CCC borders, #111 text
- Pink accent (#ff0099) unchanged in both modes
- Signed-in users: theme saved to radical_user localStorage object and applied
  on load so preference follows their session

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 16:50:24 +10:00
King Omar
69f77b1e46 Add admin dashboard + member DB storage
worker.js:
- Store join submissions in new 'members' D1 table (in addition to email)
- Add GET /api/admin/members — full member list, password gated
- Add GET /api/admin/stats — member counts, by-state breakdown, recent
  signups, top petitions, site stats; all password gated ('dictator')

admin.html:
- Password gate → full dashboard
- AEC progress bar (X/2000 with % and members-to-go)
- Stat cards: total members, this week, site users, proposals, votes
- State breakdown with mini bars
- Recent signups (last 10, NEW badge for this week)
- Top 10 petitions by signature count
- Full searchable/filterable/sortable member table with NEW badges
- CSV export (respects active search + state filter)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 04:32:53 +10:00