mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-12-03 04:13:57 +01:00
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:
@@ -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
|
||||
========================================================================= */
|
||||
|
||||
Reference in New Issue
Block a user