launch features: win feed, public stats, share-a-win, live CTA

Four pre-launch additions to make the game feel alive and shareable:

- Live win feed: server broadcasts 'win_feed' on every escape; client shows a
  transient toast ('X escaped with the bag') so the room feels active.
- Public stats: GET /api/stats (10s-cached) returns games + escapes in the last
  24h and total paid out; a status-area strip polls it for social proof.
- Share-a-win: game-over screen gets 'Share to X' + 'Copy link' buttons pointing
  at the /verify page, which now renders OpenGraph/Twitter-card meta (brand OG
  image per instance) so shared links unfurl with a preview.
- Land-on-action: a dismissible 'N games live now — watch' CTA appears on connect
  when games are in progress, opening the existing spectator panel. Non-intrusive:
  hidden while playing/spectating and never hijacks the canvas.
This commit is contained in:
jwinterm
2026-06-01 09:17:48 -04:00
parent 00b013978f
commit 63e3006aca
10 changed files with 324 additions and 4 deletions
+31
View File
@@ -314,6 +314,37 @@ li.debug {
}
/* =========================================================================
Win feed toasts (global "someone escaped" announcements)
========================================================================= */
#win-feed {
position: fixed;
top: 56px;
right: 12px;
z-index: 1800;
display: flex;
flex-direction: column;
gap: 6px;
pointer-events: none;
max-width: min(320px, 80vw);
}
.win-toast {
background: rgba(0, 30, 0, 0.92);
border: 1px solid #0f0;
border-left: 4px solid #4ade80;
border-radius: 6px;
color: #cffccf;
font-family: 'PixelOperator', monospace;
font-size: 13px;
padding: 8px 12px;
box-shadow: 0 0 14px rgba(0, 255, 0, 0.18);
opacity: 0;
transform: translateX(40px);
transition: opacity 0.35s ease, transform 0.35s ease;
}
.win-toast.show { opacity: 1; transform: translateX(0); }
.win-toast strong { color: #4ade80; }
/* =========================================================================
Mobile / touch support
========================================================================= */