From 5c291d29eaedf49cd25ba06c6ea8cdc87239ae57 Mon Sep 17 00:00:00 2001 From: King Omar Date: Fri, 5 Jun 2026 01:07:30 +1000 Subject: [PATCH] feat: leaderboard, milestones, email capture, postcode, flag, stats bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vote state now persists on page load (user_vote in proposals query) - Stats bar: live votes-today / citizens / proposals counts - Leaderboard section: top 10 proposals with milestone progress bars - Milestone system: 100→viral, 500→community, 1k→publish, 5k→minister, 10k→media - Email capture modal after 3rd vote (postcode optional) - Milestone email notifications via Resend (requires RESEND_API_KEY secret) - Weekly digest cron (Monday 9am AEST) to all subscribers - Share-as-image button opens dynamic SVG in new tab - Flag/report button hides proposals after 5 flags - Proposals with hidden=1 excluded from all feeds - DB: users.email, users.postcode, proposals.flag_count, proposals.hidden, proposal_flags, milestone_notifications tables Co-Authored-By: Claude Sonnet 4.6 --- index.html | 242 +++++++++++++++++++++++++++++++++++++++++++++--- worker.js | 251 ++++++++++++++++++++++++++++++++++++++++++++++---- wrangler.toml | 4 + 3 files changed, 466 insertions(+), 31 deletions(-) diff --git a/index.html b/index.html index 897ee34..6bb39ea 100644 --- a/index.html +++ b/index.html @@ -117,6 +117,51 @@ + @@ -188,6 +233,14 @@ +
+
votes today
+
|
+
citizens
+
|
+
proposals
+
+