Compare commits
3
Commits
7b3555f8eb
...
ad71000777
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad71000777 | ||
|
|
877a219aa4 | ||
|
|
3d6f4a98c4 |
No files matched your search
@@ -25,6 +25,8 @@ class CurrentRoundResponse(BaseModel):
|
||||
draw_animation_seconds: int
|
||||
winner_user_id: int | None = None
|
||||
winner_amount_sats: int | None = None
|
||||
draw_block_height: int | None = None
|
||||
draw_block_hash: str | None = None
|
||||
chain_tip_height: int | None = None
|
||||
lottery_paused: bool = False
|
||||
|
||||
@@ -70,6 +72,8 @@ async def current_round(request: Request, session: AsyncSession = Depends(get_se
|
||||
draw_animation_seconds=config.draw_animation_seconds,
|
||||
winner_user_id=round_.winner_user_id,
|
||||
winner_amount_sats=round_.winner_amount_sats,
|
||||
draw_block_height=round_.draw_block_height,
|
||||
draw_block_hash=round_.draw_block_hash,
|
||||
chain_tip_height=chain_tip_height,
|
||||
lottery_paused=config.paused,
|
||||
)
|
||||
@@ -1,3 +1,5 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
@@ -9,6 +11,12 @@ async def _on_payout_confirmed(session: AsyncSession, pending: PendingTransactio
|
||||
round_ = await session.scalar(select(Round).where(Round.payout_txid == pending.current_txid))
|
||||
if round_ is not None and round_.status == "paying_out":
|
||||
round_.status = "closed"
|
||||
# closed_at is what round_cooldown_seconds counts from (service.py's
|
||||
# open_new_round_if_needed) — re-stamp it here at actual payout
|
||||
# confirmation time rather than leaving it at the earlier "closing"
|
||||
# timestamp, so a short cooldown (e.g. 20s) is a real pause after the
|
||||
# winner's tx confirms, not swallowed by the ~2 block-time draw+payout wait.
|
||||
round_.closed_at = datetime.now(timezone.utc)
|
||||
# The winner's own address is already watched by the Electrum listener, so
|
||||
# their balance is credited by the normal deposit path once this confirms.
|
||||
|
||||
|
||||
+14
-9
@@ -54,13 +54,24 @@ class RoundScheduler:
|
||||
round_id, status, opened_at = round_.id, round_.status, round_.opened_at
|
||||
round_duration_seconds = (await get_round_config(session)).round_duration_seconds
|
||||
|
||||
if status != "open":
|
||||
return # already closing/drawing/paying_out; progress happens elsewhere
|
||||
if status not in ("open", "closing"):
|
||||
return # already drawing/paying_out; progress happens elsewhere
|
||||
|
||||
if status == "open":
|
||||
opened_at = opened_at.replace(tzinfo=timezone.utc)
|
||||
if datetime.now(timezone.utc) < opened_at + timedelta(seconds=round_duration_seconds):
|
||||
return
|
||||
|
||||
async with self._session_factory() as session:
|
||||
round_ = await session.get(Round, round_id)
|
||||
# No new bets from here on, regardless of how long the pending-bet
|
||||
# wait below takes — flip to "closing" immediately so it's observable
|
||||
# via /rounds/current (e.g. "round closed, waiting for jackpot
|
||||
# confirmation") instead of silently staying "open" past the deadline.
|
||||
round_.status = "closing"
|
||||
round_.closed_at = datetime.now(timezone.utc)
|
||||
await session.commit()
|
||||
|
||||
async with self._session_factory() as session:
|
||||
pending_count = await session.scalar(
|
||||
select(func.count())
|
||||
@@ -68,19 +79,13 @@ class RoundScheduler:
|
||||
.where(RoundParticipant.round_id == round_id, RoundParticipant.status == "broadcast")
|
||||
)
|
||||
if pending_count:
|
||||
return # wait for in-flight bets to confirm before closing
|
||||
return # wait for in-flight bets to confirm before closing; stays "closing"
|
||||
|
||||
await self._close_and_draw(round_id)
|
||||
|
||||
async def _close_and_draw(self, round_id: int) -> None:
|
||||
async with self._session_factory() as session:
|
||||
round_ = await session.get(Round, round_id)
|
||||
round_.status = "closing"
|
||||
round_.closed_at = datetime.now(timezone.utc)
|
||||
# Committed on its own so "closing" is actually observable (e.g. by
|
||||
# /rounds/current) instead of being overwritten in memory by "closed"
|
||||
# or "drawing" below before ever reaching the database.
|
||||
await session.commit()
|
||||
|
||||
participants = (
|
||||
await session.scalars(
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600&family=Fira+Sans:wght@400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--color-background: #F8FAFC;
|
||||
--color-surface: #FFFFFF;
|
||||
--color-foreground: #0F172A;
|
||||
--color-muted-foreground: #64748B;
|
||||
--color-border: #E2E8F0;
|
||||
--color-primary: #F59E0B;
|
||||
--color-on-primary: #0F172A;
|
||||
--color-destructive: #DC2626;
|
||||
--color-destructive-bg: #FEF2F2;
|
||||
--color-success: #16A34A;
|
||||
--color-success-bg: #F0FDF4;
|
||||
--color-ring: #F59E0B;
|
||||
--radius: 12px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
font-family: 'Fira Sans', system-ui, sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--color-foreground);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.mono { font-family: 'Fira Code', monospace; }
|
||||
|
||||
/* --- login screen: narrow, centered --- */
|
||||
#login-section { max-width: 420px; margin: 15vh auto 0; padding: 0 20px; }
|
||||
#login-section header { margin-bottom: 24px; }
|
||||
#login-section header h1 { font-size: 1.375rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
|
||||
#login-section header p { color: var(--color-muted-foreground); font-size: 0.9rem; margin: 4px 0 0; }
|
||||
|
||||
/* --- dashboard: navbar + content --- */
|
||||
.navbar {
|
||||
display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
|
||||
background: var(--color-surface); border-bottom: 1px solid var(--color-border);
|
||||
padding: 0 20px; position: sticky; top: 0; z-index: 10;
|
||||
}
|
||||
.navbar .brand { font-weight: 700; font-size: 1.05rem; padding: 14px 16px 14px 0; white-space: nowrap; }
|
||||
.navbar .nav-tab {
|
||||
padding: 16px 14px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
|
||||
color: var(--color-muted-foreground); border-bottom: 2px solid transparent;
|
||||
margin-bottom: -1px; transition: color 150ms, border-color 150ms; white-space: nowrap;
|
||||
}
|
||||
.navbar .nav-tab.active { color: var(--color-foreground); border-bottom-color: var(--color-primary); }
|
||||
.navbar .nav-tab:hover { color: var(--color-foreground); }
|
||||
.navbar .spacer { flex: 1; }
|
||||
|
||||
.chain-status-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.82rem; white-space: nowrap; }
|
||||
.status-dot {
|
||||
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
|
||||
background: var(--color-muted-foreground);
|
||||
}
|
||||
.status-dot.status-open {
|
||||
background: var(--color-success);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 18%, transparent);
|
||||
}
|
||||
.status-dot.status-drawing {
|
||||
background: var(--color-primary);
|
||||
animation: status-dot-pulse 1400ms ease-in-out infinite;
|
||||
}
|
||||
.status-dot.status-waiting { background: var(--color-muted-foreground); }
|
||||
@keyframes status-dot-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 45%, transparent); }
|
||||
50% { box-shadow: 0 0 0 5px transparent; }
|
||||
}
|
||||
.chain-block { color: var(--color-muted-foreground); font-size: 0.82rem; white-space: nowrap; }
|
||||
|
||||
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
||||
#maintenance-btn.btn-stop {
|
||||
background: var(--color-destructive-bg); color: var(--color-destructive); border-color: var(--color-destructive);
|
||||
}
|
||||
.status-dot.status-paused { background: var(--color-destructive); }
|
||||
|
||||
main { max-width: 960px; margin: 0 auto; padding: 24px 20px 80px; }
|
||||
|
||||
.view { display: none; }
|
||||
.view.active { display: block; }
|
||||
|
||||
h2.section-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; }
|
||||
|
||||
.card {
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius);
|
||||
padding: 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.card .hint { color: var(--color-muted-foreground); font-size: 0.85rem; margin: 0 0 14px; }
|
||||
|
||||
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
|
||||
|
||||
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--color-muted-foreground); margin-top: 12px; margin-bottom: 6px; }
|
||||
label:first-child { margin-top: 0; }
|
||||
|
||||
input {
|
||||
width: 100%; padding: 10px 12px; font-size: 0.95rem; font-family: inherit;
|
||||
border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface);
|
||||
color: var(--color-foreground); transition: border-color 150ms, box-shadow 150ms;
|
||||
}
|
||||
input:focus {
|
||||
outline: none; border-color: var(--color-ring);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 25%, transparent);
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
||||
min-height: 44px; padding: 0 18px; margin-top: 16px; width: 100%;
|
||||
font-family: inherit; font-size: 0.95rem; font-weight: 600;
|
||||
background: var(--color-primary); color: var(--color-on-primary);
|
||||
border: none; border-radius: 8px; cursor: pointer;
|
||||
transition: filter 150ms, transform 150ms;
|
||||
}
|
||||
button:hover { filter: brightness(0.94); }
|
||||
button:active { transform: scale(0.98); }
|
||||
button:disabled { opacity: 0.6; cursor: default; }
|
||||
button:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
|
||||
|
||||
button.secondary {
|
||||
width: auto; margin-top: 0; min-height: 36px; padding: 0 14px;
|
||||
background: var(--color-background); color: var(--color-foreground);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.hidden { display: none !important; }
|
||||
|
||||
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
|
||||
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
|
||||
th { color: var(--color-muted-foreground); font-weight: 500; }
|
||||
td.addr, td.txid { font-family: 'Fira Code', monospace; word-break: break-all; max-width: 200px; }
|
||||
.table-wrap { overflow-x: auto; }
|
||||
|
||||
.badge {
|
||||
display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
|
||||
border-radius: 999px; background: var(--color-background); border: 1px solid var(--color-border);
|
||||
}
|
||||
.badge.status-open, .badge.status-confirmed, .badge.status-closed { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success); }
|
||||
.badge.status-pending, .badge.status-drawing, .badge.status-paying_out, .badge.status-closing, .badge.status-broadcast {
|
||||
background: #FEF3C7; color: #92400E; border-color: #F59E0B;
|
||||
}
|
||||
|
||||
button.reveal {
|
||||
width: auto; margin-top: 0; padding: 4px 10px; min-height: 30px; font-size: 0.78rem;
|
||||
background: var(--color-destructive-bg); color: var(--color-destructive); border: 1px solid var(--color-destructive);
|
||||
}
|
||||
|
||||
.privkey-box {
|
||||
margin-top: 6px; padding: 8px; border-radius: 6px; font-size: 0.78rem;
|
||||
background: var(--color-destructive-bg); border: 1px solid var(--color-destructive);
|
||||
word-break: break-all; font-family: 'Fira Code', monospace; color: var(--color-foreground);
|
||||
}
|
||||
.warning-banner {
|
||||
background: var(--color-destructive-bg); border: 1px solid var(--color-destructive); color: var(--color-destructive);
|
||||
border-radius: 8px; padding: 10px 12px; font-size: 0.8rem; margin-bottom: 14px; font-weight: 500;
|
||||
}
|
||||
|
||||
pre.payload {
|
||||
background: var(--color-background); border: 1px solid var(--color-border); border-radius: 6px;
|
||||
padding: 6px 8px; font-size: 0.75rem; margin: 0; white-space: pre-wrap; word-break: break-all;
|
||||
}
|
||||
|
||||
#toast-container {
|
||||
position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
|
||||
display: flex; flex-direction: column; gap: 8px; z-index: 100; width: calc(100% - 40px); max-width: 440px;
|
||||
}
|
||||
.toast {
|
||||
padding: 12px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
|
||||
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
|
||||
animation: toast-in 200ms ease-out;
|
||||
}
|
||||
.toast.success { background: var(--color-success-bg); color: var(--color-success); }
|
||||
.toast.error { background: var(--color-destructive-bg); color: var(--color-destructive); }
|
||||
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation: none !important; transition: none !important; }
|
||||
}
|
||||
+1
-184
@@ -5,190 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>PLM Lottery — Admin</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.svg">
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600&family=Fira+Sans:wght@400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--color-background: #F8FAFC;
|
||||
--color-surface: #FFFFFF;
|
||||
--color-foreground: #0F172A;
|
||||
--color-muted-foreground: #64748B;
|
||||
--color-border: #E2E8F0;
|
||||
--color-primary: #F59E0B;
|
||||
--color-on-primary: #0F172A;
|
||||
--color-destructive: #DC2626;
|
||||
--color-destructive-bg: #FEF2F2;
|
||||
--color-success: #16A34A;
|
||||
--color-success-bg: #F0FDF4;
|
||||
--color-ring: #F59E0B;
|
||||
--radius: 12px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
font-family: 'Fira Sans', system-ui, sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--color-foreground);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.mono { font-family: 'Fira Code', monospace; }
|
||||
|
||||
/* --- login screen: narrow, centered --- */
|
||||
#login-section { max-width: 420px; margin: 15vh auto 0; padding: 0 20px; }
|
||||
#login-section header { margin-bottom: 24px; }
|
||||
#login-section header h1 { font-size: 1.375rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
|
||||
#login-section header p { color: var(--color-muted-foreground); font-size: 0.9rem; margin: 4px 0 0; }
|
||||
|
||||
/* --- dashboard: navbar + content --- */
|
||||
.navbar {
|
||||
display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
|
||||
background: var(--color-surface); border-bottom: 1px solid var(--color-border);
|
||||
padding: 0 20px; position: sticky; top: 0; z-index: 10;
|
||||
}
|
||||
.navbar .brand { font-weight: 700; font-size: 1.05rem; padding: 14px 16px 14px 0; white-space: nowrap; }
|
||||
.navbar .nav-tab {
|
||||
padding: 16px 14px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
|
||||
color: var(--color-muted-foreground); border-bottom: 2px solid transparent;
|
||||
margin-bottom: -1px; transition: color 150ms, border-color 150ms; white-space: nowrap;
|
||||
}
|
||||
.navbar .nav-tab.active { color: var(--color-foreground); border-bottom-color: var(--color-primary); }
|
||||
.navbar .nav-tab:hover { color: var(--color-foreground); }
|
||||
.navbar .spacer { flex: 1; }
|
||||
|
||||
.chain-status-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.82rem; white-space: nowrap; }
|
||||
.status-dot {
|
||||
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
|
||||
background: var(--color-muted-foreground);
|
||||
}
|
||||
.status-dot.status-open {
|
||||
background: var(--color-success);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 18%, transparent);
|
||||
}
|
||||
.status-dot.status-drawing {
|
||||
background: var(--color-primary);
|
||||
animation: status-dot-pulse 1400ms ease-in-out infinite;
|
||||
}
|
||||
.status-dot.status-waiting { background: var(--color-muted-foreground); }
|
||||
@keyframes status-dot-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 45%, transparent); }
|
||||
50% { box-shadow: 0 0 0 5px transparent; }
|
||||
}
|
||||
.chain-block { color: var(--color-muted-foreground); font-size: 0.82rem; white-space: nowrap; }
|
||||
|
||||
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
||||
#maintenance-btn.btn-stop {
|
||||
background: var(--color-destructive-bg); color: var(--color-destructive); border-color: var(--color-destructive);
|
||||
}
|
||||
.status-dot.status-paused { background: var(--color-destructive); }
|
||||
|
||||
main { max-width: 960px; margin: 0 auto; padding: 24px 20px 80px; }
|
||||
|
||||
.view { display: none; }
|
||||
.view.active { display: block; }
|
||||
|
||||
h2.section-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; }
|
||||
|
||||
.card {
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius);
|
||||
padding: 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.card .hint { color: var(--color-muted-foreground); font-size: 0.85rem; margin: 0 0 14px; }
|
||||
|
||||
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
|
||||
|
||||
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--color-muted-foreground); margin-top: 12px; margin-bottom: 6px; }
|
||||
label:first-child { margin-top: 0; }
|
||||
|
||||
input {
|
||||
width: 100%; padding: 10px 12px; font-size: 0.95rem; font-family: inherit;
|
||||
border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface);
|
||||
color: var(--color-foreground); transition: border-color 150ms, box-shadow 150ms;
|
||||
}
|
||||
input:focus {
|
||||
outline: none; border-color: var(--color-ring);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 25%, transparent);
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
||||
min-height: 44px; padding: 0 18px; margin-top: 16px; width: 100%;
|
||||
font-family: inherit; font-size: 0.95rem; font-weight: 600;
|
||||
background: var(--color-primary); color: var(--color-on-primary);
|
||||
border: none; border-radius: 8px; cursor: pointer;
|
||||
transition: filter 150ms, transform 150ms;
|
||||
}
|
||||
button:hover { filter: brightness(0.94); }
|
||||
button:active { transform: scale(0.98); }
|
||||
button:disabled { opacity: 0.6; cursor: default; }
|
||||
button:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
|
||||
|
||||
button.secondary {
|
||||
width: auto; margin-top: 0; min-height: 36px; padding: 0 14px;
|
||||
background: var(--color-background); color: var(--color-foreground);
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.hidden { display: none !important; }
|
||||
|
||||
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
|
||||
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
|
||||
th { color: var(--color-muted-foreground); font-weight: 500; }
|
||||
td.addr, td.txid { font-family: 'Fira Code', monospace; word-break: break-all; max-width: 200px; }
|
||||
.table-wrap { overflow-x: auto; }
|
||||
|
||||
.badge {
|
||||
display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
|
||||
border-radius: 999px; background: var(--color-background); border: 1px solid var(--color-border);
|
||||
}
|
||||
.badge.status-open, .badge.status-confirmed, .badge.status-closed { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success); }
|
||||
.badge.status-pending, .badge.status-drawing, .badge.status-paying_out, .badge.status-closing, .badge.status-broadcast {
|
||||
background: #FEF3C7; color: #92400E; border-color: #F59E0B;
|
||||
}
|
||||
|
||||
button.reveal {
|
||||
width: auto; margin-top: 0; padding: 4px 10px; min-height: 30px; font-size: 0.78rem;
|
||||
background: var(--color-destructive-bg); color: var(--color-destructive); border: 1px solid var(--color-destructive);
|
||||
}
|
||||
|
||||
.privkey-box {
|
||||
margin-top: 6px; padding: 8px; border-radius: 6px; font-size: 0.78rem;
|
||||
background: var(--color-destructive-bg); border: 1px solid var(--color-destructive);
|
||||
word-break: break-all; font-family: 'Fira Code', monospace; color: var(--color-foreground);
|
||||
}
|
||||
.warning-banner {
|
||||
background: var(--color-destructive-bg); border: 1px solid var(--color-destructive); color: var(--color-destructive);
|
||||
border-radius: 8px; padding: 10px 12px; font-size: 0.8rem; margin-bottom: 14px; font-weight: 500;
|
||||
}
|
||||
|
||||
pre.payload {
|
||||
background: var(--color-background); border: 1px solid var(--color-border); border-radius: 6px;
|
||||
padding: 6px 8px; font-size: 0.75rem; margin: 0; white-space: pre-wrap; word-break: break-all;
|
||||
}
|
||||
|
||||
#toast-container {
|
||||
position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
|
||||
display: flex; flex-direction: column; gap: 8px; z-index: 100; width: calc(100% - 40px); max-width: 440px;
|
||||
}
|
||||
.toast {
|
||||
padding: 12px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
|
||||
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
|
||||
animation: toast-in 200ms ease-out;
|
||||
}
|
||||
.toast.success { background: var(--color-success-bg); color: var(--color-success); }
|
||||
.toast.error { background: var(--color-destructive-bg); color: var(--color-destructive); }
|
||||
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation: none !important; transition: none !important; }
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/admin.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
+39
-386
@@ -5,378 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>PLM Lottery</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.svg">
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--color-background: #F8FAFC;
|
||||
--color-surface: #FFFFFF;
|
||||
--color-surface-inset: #F1F5F9;
|
||||
--color-foreground: #0F172A;
|
||||
--color-muted-foreground: #64748B;
|
||||
--color-border: #E2E8F0;
|
||||
--color-primary: #F59E0B;
|
||||
--color-on-primary: #0F172A;
|
||||
--color-secondary: #FBBF24;
|
||||
--color-accent: #7C3AED;
|
||||
--color-destructive: #DC2626;
|
||||
--color-destructive-bg: #FEF2F2;
|
||||
--color-success: #16A34A;
|
||||
--color-success-bg: #F0FDF4;
|
||||
--color-ring: #F59E0B;
|
||||
--radius-sm: 8px;
|
||||
--radius: 14px;
|
||||
--radius-lg: 20px;
|
||||
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
|
||||
--shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.14);
|
||||
--content-width: 480px;
|
||||
--nav-bottom-height: 68px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
|
||||
body {
|
||||
font-family: 'IBM Plex Sans', system-ui, sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--color-foreground);
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.app-shell { max-width: var(--content-width); margin: 0 auto; padding: 20px 20px 32px; }
|
||||
|
||||
.mono { font-family: 'Fira Code', ui-monospace, monospace; }
|
||||
|
||||
h1, h2, h3 { font-family: inherit; letter-spacing: -0.01em; }
|
||||
|
||||
.section-label {
|
||||
font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
|
||||
color: var(--color-muted-foreground); margin: 0 2px 10px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.card h2 { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
|
||||
.card .hint { color: var(--color-muted-foreground); font-size: 0.85rem; margin: 0 0 14px; line-height: 1.45; }
|
||||
.card .hint:last-child { margin-bottom: 0; }
|
||||
|
||||
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--color-border); }
|
||||
.tab {
|
||||
flex: 1; text-align: center; padding: 10px 0; font-weight: 600; font-size: 0.9rem;
|
||||
color: var(--color-muted-foreground); cursor: pointer; border-bottom: 2px solid transparent;
|
||||
margin-bottom: -1px; transition: color 150ms, border-color 150ms;
|
||||
}
|
||||
.tab.active { color: var(--color-foreground); border-bottom-color: var(--color-primary); }
|
||||
.tab-panel { display: none; }
|
||||
.tab-panel.active { display: block; }
|
||||
|
||||
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--color-muted-foreground); margin-top: 14px; margin-bottom: 6px; }
|
||||
label:first-child { margin-top: 0; }
|
||||
|
||||
input {
|
||||
width: 100%; min-height: 44px; padding: 10px 12px; font-size: 0.95rem; font-family: inherit;
|
||||
border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface);
|
||||
color: var(--color-foreground); transition: border-color 150ms, box-shadow 150ms;
|
||||
}
|
||||
input:focus {
|
||||
outline: none; border-color: var(--color-ring);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 25%, transparent);
|
||||
}
|
||||
input:disabled { background: var(--color-surface-inset); color: var(--color-muted-foreground); }
|
||||
|
||||
button {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
||||
min-height: 44px; padding: 0 18px; margin-top: 16px; width: 100%;
|
||||
font-family: inherit; font-size: 0.95rem; font-weight: 600;
|
||||
background: var(--color-primary); color: var(--color-on-primary);
|
||||
border: none; border-radius: var(--radius-sm); cursor: pointer;
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: filter 150ms, transform 150ms, box-shadow 150ms;
|
||||
}
|
||||
button:hover { filter: brightness(0.96); box-shadow: var(--shadow-md); }
|
||||
button:active { transform: scale(0.98); }
|
||||
button:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
|
||||
button:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
|
||||
|
||||
button.secondary {
|
||||
width: auto; margin-top: 0; padding: 0 12px; min-height: 40px;
|
||||
background: var(--color-surface-inset); color: var(--color-foreground);
|
||||
border: 1px solid var(--color-border); box-shadow: none;
|
||||
}
|
||||
button.secondary:hover { filter: none; background: var(--color-border); box-shadow: none; }
|
||||
|
||||
button.link, a.link {
|
||||
width: auto; min-height: 44px; margin-top: 0; padding: 0 2px;
|
||||
display: inline-flex; align-items: center;
|
||||
background: none; color: var(--color-muted-foreground); font-weight: 500;
|
||||
font-size: 0.82rem; box-shadow: none; text-decoration: none;
|
||||
}
|
||||
button.link:hover, a.link:hover { filter: none; color: var(--color-foreground); box-shadow: none; }
|
||||
|
||||
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
||||
|
||||
.checkbox-row {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
font-size: 0.85rem; font-weight: 500; color: var(--color-foreground);
|
||||
margin-top: 14px; cursor: pointer;
|
||||
}
|
||||
.checkbox-row input[type="checkbox"] {
|
||||
width: 18px; height: 18px; min-height: auto; flex-shrink: 0; accent-color: var(--color-primary); cursor: pointer;
|
||||
}
|
||||
|
||||
/* --- app navbar: brand/balance row (sticky top) + section nav (bottom tab bar on
|
||||
mobile, promoted back to an inline tab strip once there's room — see the
|
||||
min-width breakpoint below), shown only when logged in --- */
|
||||
.app-navbar-top {
|
||||
position: sticky; top: 0; z-index: 20;
|
||||
background: color-mix(in srgb, var(--color-surface) 90%, transparent);
|
||||
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.app-navbar-top-inner {
|
||||
max-width: var(--content-width); margin: 0 auto; padding: 12px 20px;
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||
}
|
||||
.app-navbar-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
|
||||
.app-navbar-top .brand-mark { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: block; }
|
||||
.app-navbar-account { display: flex; align-items: center; gap: 6px; }
|
||||
.app-navbar-account .navbar-username { display: none; font-weight: 600; font-size: 0.85rem; margin-right: 2px; }
|
||||
@media (min-width: 420px) { .app-navbar-account .navbar-username { display: inline; } }
|
||||
.app-navbar-account .navbar-balance {
|
||||
display: inline-flex; align-items: center; gap: 5px;
|
||||
font-weight: 700; font-size: 0.85rem; white-space: nowrap;
|
||||
background: color-mix(in srgb, var(--color-primary) 14%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
|
||||
color: color-mix(in srgb, var(--color-primary) 70%, var(--color-foreground));
|
||||
padding: 6px 10px; border-radius: 999px;
|
||||
}
|
||||
.app-navbar-account .icon-link {
|
||||
width: 36px; height: 36px; min-height: 36px; padding: 0; margin: 0; border-radius: 999px;
|
||||
justify-content: center;
|
||||
}
|
||||
.app-navbar-account .icon-link:hover { background: var(--color-surface-inset); }
|
||||
.app-navbar-account .icon-link .icon { width: 18px; height: 18px; }
|
||||
|
||||
/* Bottom tab bar on narrow (mobile) viewports — thumb-reachable, app-like. */
|
||||
.app-navbar-tabs {
|
||||
position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
|
||||
max-width: var(--content-width); margin: 0 auto;
|
||||
background: color-mix(in srgb, var(--color-surface) 94%, transparent);
|
||||
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
|
||||
border-top: 1px solid var(--color-border);
|
||||
box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, 0.18);
|
||||
display: flex; padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
.app-navbar-tabs button.navbar-tab {
|
||||
flex: 1; width: auto; min-height: 56px; margin-top: 0; padding: 8px 4px;
|
||||
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
|
||||
font-size: 0.68rem; font-weight: 600; font-family: inherit; cursor: pointer;
|
||||
background: none; color: var(--color-muted-foreground); box-shadow: none;
|
||||
border: none; border-radius: var(--radius-sm);
|
||||
transition: color 150ms, background 150ms;
|
||||
}
|
||||
.app-navbar-tabs button.navbar-tab .icon { width: 20px; height: 20px; }
|
||||
.app-navbar-tabs button.navbar-tab.active { color: var(--color-primary); }
|
||||
.app-navbar-tabs button.navbar-tab.active .icon { color: var(--color-primary); }
|
||||
.app-navbar-tabs button.navbar-tab:hover { filter: none; color: var(--color-foreground); background: var(--color-surface-inset); }
|
||||
.app-navbar-tabs button.navbar-tab.active:hover { color: var(--color-primary); background: none; }
|
||||
|
||||
/* Reserve room so fixed content never sits under the bottom bar or the
|
||||
iOS/Android home-indicator safe area. */
|
||||
.app-shell { padding-bottom: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0px) + 20px); }
|
||||
|
||||
@media (min-width: 720px) {
|
||||
:root { --content-width: 620px; }
|
||||
/* Promote the bottom tab bar back to an ordinary inline strip once there's
|
||||
enough width for it to sit comfortably under the top bar instead of
|
||||
floating over thumb-reach real estate. */
|
||||
.app-navbar-tabs {
|
||||
position: static; box-shadow: none; border-top: none;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
padding: 4px 12px; gap: 4px;
|
||||
}
|
||||
.app-navbar-tabs button.navbar-tab { flex-direction: row; min-height: 44px; font-size: 0.85rem; }
|
||||
.app-shell { padding-bottom: 40px; }
|
||||
}
|
||||
|
||||
.address-box {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
||||
background: var(--color-surface-inset); border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.85rem; word-break: break-all;
|
||||
}
|
||||
|
||||
.balance-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
|
||||
.balance-unit { color: var(--color-muted-foreground); font-size: 1rem; font-weight: 500; }
|
||||
|
||||
.icon { width: 16px; height: 16px; flex-shrink: 0; }
|
||||
|
||||
.dash-panel { display: none; }
|
||||
.dash-panel.active { display: block; }
|
||||
|
||||
.qr-box { display: flex; justify-content: center; padding: 16px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-top: 14px; }
|
||||
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
|
||||
|
||||
.hidden { display: none !important; }
|
||||
|
||||
.draw-state { display: none; text-align: center; padding: 8px 0 4px; }
|
||||
.draw-state.active { display: block; }
|
||||
.draw-spinner {
|
||||
width: 40px; height: 40px; margin: 0 auto 10px;
|
||||
border: 3px solid var(--color-border); border-top-color: var(--color-primary);
|
||||
border-radius: 50%; animation: spin 900ms linear infinite;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.draw-state .draw-label { font-weight: 600; font-size: 0.95rem; }
|
||||
.draw-result { font-size: 1.05rem; font-weight: 700; padding: 6px 0; }
|
||||
.draw-result.win { color: var(--color-success); }
|
||||
.draw-result.lose { color: var(--color-muted-foreground); }
|
||||
|
||||
#toast-container {
|
||||
position: fixed; left: 50%; transform: translateX(-50%);
|
||||
bottom: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0px) + 12px);
|
||||
display: flex; flex-direction: column; gap: 8px; z-index: 100; width: calc(100% - 40px); max-width: 440px;
|
||||
}
|
||||
@media (min-width: 720px) { #toast-container { bottom: 20px; } }
|
||||
.toast {
|
||||
display: flex; align-items: flex-start; gap: 8px;
|
||||
padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
|
||||
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
|
||||
animation: toast-in 200ms ease-out;
|
||||
}
|
||||
.toast.success { background: var(--color-success-bg); color: var(--color-success); }
|
||||
.toast.error { background: var(--color-destructive-bg); color: var(--color-destructive); }
|
||||
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
/* --- landing hero (shown only when logged out) --- */
|
||||
body {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
background:
|
||||
radial-gradient(600px circle at 20% -10%, color-mix(in srgb, var(--color-primary) 16%, transparent), transparent 60%),
|
||||
radial-gradient(500px circle at 90% 10%, color-mix(in srgb, var(--color-accent) 12%, transparent), transparent 60%);
|
||||
}
|
||||
|
||||
.hero { text-align: center; padding: 8px 0 28px; }
|
||||
.hero .eyebrow {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
|
||||
color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 12%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
|
||||
padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
|
||||
}
|
||||
.hero h1 {
|
||||
font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px;
|
||||
background: linear-gradient(135deg, var(--color-foreground), var(--color-accent) 120%);
|
||||
-webkit-background-clip: text; background-clip: text; color: transparent;
|
||||
}
|
||||
.hero p.lead { color: var(--color-muted-foreground); font-size: 0.95rem; margin: 0 auto; max-width: 360px; }
|
||||
|
||||
.hero-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0; }
|
||||
.hero-step {
|
||||
background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: 14px 8px; transition: transform 150ms, border-color 150ms, box-shadow 150ms;
|
||||
}
|
||||
.hero-step:hover { transform: translateY(-2px); border-color: var(--color-ring); box-shadow: var(--shadow-md); }
|
||||
.hero-step .step-icon {
|
||||
width: 32px; height: 32px; margin: 0 auto 8px; border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--color-primary) 14%, transparent); color: var(--color-primary);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.hero-step .step-icon .icon { width: 16px; height: 16px; }
|
||||
.hero-step .step-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; }
|
||||
.hero-step .step-hint { font-size: 0.72rem; color: var(--color-muted-foreground); line-height: 1.35; }
|
||||
|
||||
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
|
||||
.trust-pill {
|
||||
font-size: 0.72rem; font-weight: 500; color: var(--color-muted-foreground);
|
||||
background: var(--color-surface); border: 1px solid var(--color-border);
|
||||
padding: 5px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px;
|
||||
}
|
||||
.trust-pill .icon { width: 13px; height: 13px; color: var(--color-success); flex-shrink: 0; }
|
||||
|
||||
/* --- round status: a "hero" ticket-style card, always visible above the panels --- */
|
||||
.card.round-card {
|
||||
background:
|
||||
radial-gradient(320px circle at 100% 0%, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 70%),
|
||||
var(--color-surface);
|
||||
border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-border));
|
||||
}
|
||||
.round-card .hint { margin: 0; }
|
||||
|
||||
/* --- glowing card while a round is drawing --- */
|
||||
.card.drawing-glow {
|
||||
border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border));
|
||||
box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent),
|
||||
0 0 24px color-mix(in srgb, var(--color-primary) 22%, transparent);
|
||||
animation: glow-pulse 2200ms ease-in-out infinite;
|
||||
}
|
||||
@keyframes glow-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent), 0 0 16px color-mix(in srgb, var(--color-primary) 16%, transparent); }
|
||||
50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 45%, transparent), 0 0 28px color-mix(in srgb, var(--color-primary) 30%, transparent); }
|
||||
}
|
||||
|
||||
.jackpot-bump { animation: jackpot-bump 420ms ease-out; }
|
||||
@keyframes jackpot-bump {
|
||||
0% { transform: scale(1); }
|
||||
30% { transform: scale(1.12); color: var(--color-primary); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
/* --- network / lottery status strip, shown on every screen --- */
|
||||
.chain-bar {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 10px;
|
||||
font-size: 0.78rem; padding: 12px 2px 16px; margin-bottom: 4px;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.chain-status-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--color-foreground); }
|
||||
.status-dot {
|
||||
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
|
||||
background: var(--color-muted-foreground);
|
||||
}
|
||||
.status-dot.status-open {
|
||||
background: var(--color-success);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 18%, transparent);
|
||||
}
|
||||
.status-dot.status-drawing {
|
||||
background: var(--color-primary);
|
||||
animation: status-dot-pulse 1400ms ease-in-out infinite;
|
||||
}
|
||||
.status-dot.status-waiting { background: var(--color-muted-foreground); }
|
||||
.status-dot.status-offline { background: var(--color-destructive); }
|
||||
@keyframes status-dot-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 45%, transparent); }
|
||||
50% { box-shadow: 0 0 0 5px transparent; }
|
||||
}
|
||||
.chain-block { color: var(--color-muted-foreground); white-space: nowrap; }
|
||||
|
||||
.maintenance-banner {
|
||||
display: flex; align-items: flex-start; gap: 8px;
|
||||
background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
|
||||
color: var(--color-foreground); border-radius: var(--radius);
|
||||
padding: 12px 14px; font-size: 0.82rem; line-height: 1.4; margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation: none !important; transition: none !important; }
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -514,7 +143,7 @@
|
||||
|
||||
<div class="draw-state" id="draw-state">
|
||||
<div class="draw-spinner"></div>
|
||||
<div class="draw-label">Estrazione del vincitore in corso…</div>
|
||||
<div class="draw-label" id="draw-label">Estrazione del vincitore in corso…</div>
|
||||
</div>
|
||||
|
||||
<div class="hidden" id="draw-result"></div>
|
||||
@@ -678,10 +307,32 @@ const ROUND_STATUS_LABELS = {
|
||||
|
||||
const DRAWING_STATUSES = ['closing', 'drawing', 'paying_out'];
|
||||
|
||||
// One distinct message per DRAW sub-phase (see CLAUDE.md's "three separate
|
||||
// on-chain confirmations" note) instead of a single generic spinner label —
|
||||
// takes the round data so the drawing phase can surface the draw block once known.
|
||||
function drawingLabelFor(data) {
|
||||
if (data.status === 'closing') {
|
||||
return 'Round chiuso — in attesa di conferma dell\'ultima giocata prima di estrarre il vincitore…';
|
||||
}
|
||||
if (data.status === 'drawing') {
|
||||
return 'In attesa del prossimo blocco per estrarre il vincitore…';
|
||||
}
|
||||
// paying_out
|
||||
if (data.draw_block_height != null) {
|
||||
return 'Vincitore estratto dal blocco #' + data.draw_block_height + ' — pagamento in corso…';
|
||||
}
|
||||
return 'Vincitore estratto — pagamento in corso…';
|
||||
}
|
||||
|
||||
// One label per real round status, not just the coarse open/drawing/waiting
|
||||
// grouping — the status bar should show the same phase distinction as the
|
||||
// draw-state panel (drawingLabelFor above), just condensed to a short phrase.
|
||||
const CHAIN_STATUS_LABELS = {
|
||||
waiting: 'In attesa del prossimo round',
|
||||
open: 'Round aperto',
|
||||
closing: 'Round chiuso — attesa conferma puntate',
|
||||
drawing: 'Estrazione in corso',
|
||||
paying_out: 'Pagamento in corso',
|
||||
};
|
||||
|
||||
function updateChainStatusBar(data) {
|
||||
@@ -689,13 +340,18 @@ function updateChainStatusBar(data) {
|
||||
const label = document.getElementById('chain-status-label');
|
||||
const block = document.getElementById('chain-block');
|
||||
|
||||
let statusKey;
|
||||
if (!data.round_id) statusKey = 'waiting';
|
||||
else if (DRAWING_STATUSES.includes(data.status)) statusKey = 'drawing';
|
||||
else statusKey = 'open';
|
||||
// The dot's color/pulse only distinguishes waiting/open/drawing (that's all
|
||||
// the CSS defines) — closing and paying_out both pulse like drawing, they
|
||||
// just get their own text label below.
|
||||
let dotKey;
|
||||
if (!data.round_id) dotKey = 'waiting';
|
||||
else if (DRAWING_STATUSES.includes(data.status)) dotKey = 'drawing';
|
||||
else dotKey = 'open';
|
||||
|
||||
dot.className = 'status-dot status-' + statusKey;
|
||||
label.textContent = CHAIN_STATUS_LABELS[statusKey];
|
||||
const labelKey = data.round_id && data.status in CHAIN_STATUS_LABELS ? data.status : 'waiting';
|
||||
|
||||
dot.className = 'status-dot status-' + dotKey;
|
||||
label.textContent = CHAIN_STATUS_LABELS[labelKey];
|
||||
block.textContent = 'Blocco ' + (data.chain_tip_height != null ? '#' + data.chain_tip_height : '—');
|
||||
|
||||
document.getElementById('maintenance-banner').classList.toggle('hidden', !data.lottery_paused);
|
||||
@@ -788,11 +444,12 @@ function updateRoundTimer() {
|
||||
}
|
||||
}
|
||||
|
||||
function showDrawingState() {
|
||||
function showDrawingState(label) {
|
||||
document.getElementById('round-normal-row').classList.add('hidden');
|
||||
document.getElementById('round-stats-row').classList.add('hidden');
|
||||
document.getElementById('draw-state').classList.add('active');
|
||||
document.getElementById('draw-result').classList.add('hidden');
|
||||
if (label) document.getElementById('draw-label').textContent = label;
|
||||
}
|
||||
|
||||
function showResultState(html, cls) {
|
||||
@@ -856,7 +513,7 @@ async function refreshRound() {
|
||||
showResultState('Non hai vinto questa volta.', 'lose');
|
||||
}
|
||||
} else if (!revealedRounds.has(data.round_id)) {
|
||||
showDrawingState();
|
||||
showDrawingState(drawingLabelFor(data));
|
||||
}
|
||||
} else if (data.round_id && data.round_id !== activeResultRoundId) {
|
||||
// a genuinely new round is open — clear any previous result and go back to normal
|
||||
@@ -877,11 +534,7 @@ async function refreshRound() {
|
||||
// one — keep it on screen through the cooldown gap instead of flashing back to
|
||||
// "Nessun round attivo".
|
||||
|
||||
// The countdown reaching zero doesn't mean the server has actually closed the
|
||||
// round yet (it still waits for in-flight bets to confirm) — poll faster
|
||||
// through that gap too, not just once status flips to closing/drawing/paying_out.
|
||||
const pastDeadline = data.status === 'open' && roundCloseAt !== null && roundCloseAt - serverNow() <= 0;
|
||||
scheduleNextRoundPoll(isDrawing || pastDeadline);
|
||||
scheduleNextRoundPoll(isDrawing);
|
||||
} catch (e) {
|
||||
noteFetchOutcome(false);
|
||||
scheduleNextRoundPoll(false);
|
||||
|
||||
@@ -0,0 +1,370 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--color-background: #F8FAFC;
|
||||
--color-surface: #FFFFFF;
|
||||
--color-surface-inset: #F1F5F9;
|
||||
--color-foreground: #0F172A;
|
||||
--color-muted-foreground: #64748B;
|
||||
--color-border: #E2E8F0;
|
||||
--color-primary: #F59E0B;
|
||||
--color-on-primary: #0F172A;
|
||||
--color-secondary: #FBBF24;
|
||||
--color-accent: #7C3AED;
|
||||
--color-destructive: #DC2626;
|
||||
--color-destructive-bg: #FEF2F2;
|
||||
--color-success: #16A34A;
|
||||
--color-success-bg: #F0FDF4;
|
||||
--color-ring: #F59E0B;
|
||||
--radius-sm: 8px;
|
||||
--radius: 14px;
|
||||
--radius-lg: 20px;
|
||||
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
|
||||
--shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.14);
|
||||
--content-width: 480px;
|
||||
--nav-bottom-height: 68px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
|
||||
body {
|
||||
font-family: 'IBM Plex Sans', system-ui, sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--color-foreground);
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.app-shell { max-width: var(--content-width); margin: 0 auto; padding: 20px 20px 32px; }
|
||||
|
||||
.mono { font-family: 'Fira Code', ui-monospace, monospace; }
|
||||
|
||||
h1, h2, h3 { font-family: inherit; letter-spacing: -0.01em; }
|
||||
|
||||
.section-label {
|
||||
font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
|
||||
color: var(--color-muted-foreground); margin: 0 2px 10px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.card h2 { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
|
||||
.card .hint { color: var(--color-muted-foreground); font-size: 0.85rem; margin: 0 0 14px; line-height: 1.45; }
|
||||
.card .hint:last-child { margin-bottom: 0; }
|
||||
|
||||
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--color-border); }
|
||||
.tab {
|
||||
flex: 1; text-align: center; padding: 10px 0; font-weight: 600; font-size: 0.9rem;
|
||||
color: var(--color-muted-foreground); cursor: pointer; border-bottom: 2px solid transparent;
|
||||
margin-bottom: -1px; transition: color 150ms, border-color 150ms;
|
||||
}
|
||||
.tab.active { color: var(--color-foreground); border-bottom-color: var(--color-primary); }
|
||||
.tab-panel { display: none; }
|
||||
.tab-panel.active { display: block; }
|
||||
|
||||
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--color-muted-foreground); margin-top: 14px; margin-bottom: 6px; }
|
||||
label:first-child { margin-top: 0; }
|
||||
|
||||
input {
|
||||
width: 100%; min-height: 44px; padding: 10px 12px; font-size: 0.95rem; font-family: inherit;
|
||||
border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface);
|
||||
color: var(--color-foreground); transition: border-color 150ms, box-shadow 150ms;
|
||||
}
|
||||
input:focus {
|
||||
outline: none; border-color: var(--color-ring);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 25%, transparent);
|
||||
}
|
||||
input:disabled { background: var(--color-surface-inset); color: var(--color-muted-foreground); }
|
||||
|
||||
button {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
||||
min-height: 44px; padding: 0 18px; margin-top: 16px; width: 100%;
|
||||
font-family: inherit; font-size: 0.95rem; font-weight: 600;
|
||||
background: var(--color-primary); color: var(--color-on-primary);
|
||||
border: none; border-radius: var(--radius-sm); cursor: pointer;
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: filter 150ms, transform 150ms, box-shadow 150ms;
|
||||
}
|
||||
button:hover { filter: brightness(0.96); box-shadow: var(--shadow-md); }
|
||||
button:active { transform: scale(0.98); }
|
||||
button:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
|
||||
button:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
|
||||
|
||||
button.secondary {
|
||||
width: auto; margin-top: 0; padding: 0 12px; min-height: 40px;
|
||||
background: var(--color-surface-inset); color: var(--color-foreground);
|
||||
border: 1px solid var(--color-border); box-shadow: none;
|
||||
}
|
||||
button.secondary:hover { filter: none; background: var(--color-border); box-shadow: none; }
|
||||
|
||||
button.link, a.link {
|
||||
width: auto; min-height: 44px; margin-top: 0; padding: 0 2px;
|
||||
display: inline-flex; align-items: center;
|
||||
background: none; color: var(--color-muted-foreground); font-weight: 500;
|
||||
font-size: 0.82rem; box-shadow: none; text-decoration: none;
|
||||
}
|
||||
button.link:hover, a.link:hover { filter: none; color: var(--color-foreground); box-shadow: none; }
|
||||
|
||||
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
||||
|
||||
.checkbox-row {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
font-size: 0.85rem; font-weight: 500; color: var(--color-foreground);
|
||||
margin-top: 14px; cursor: pointer;
|
||||
}
|
||||
.checkbox-row input[type="checkbox"] {
|
||||
width: 18px; height: 18px; min-height: auto; flex-shrink: 0; accent-color: var(--color-primary); cursor: pointer;
|
||||
}
|
||||
|
||||
/* --- app navbar: brand/balance row (sticky top) + section nav (bottom tab bar on
|
||||
mobile, promoted back to an inline tab strip once there's room — see the
|
||||
min-width breakpoint below), shown only when logged in --- */
|
||||
.app-navbar-top {
|
||||
position: sticky; top: 0; z-index: 20;
|
||||
background: color-mix(in srgb, var(--color-surface) 90%, transparent);
|
||||
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.app-navbar-top-inner {
|
||||
max-width: var(--content-width); margin: 0 auto; padding: 12px 20px;
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||
}
|
||||
.app-navbar-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
|
||||
.app-navbar-top .brand-mark { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: block; }
|
||||
.app-navbar-account { display: flex; align-items: center; gap: 6px; }
|
||||
.app-navbar-account .navbar-username { display: none; font-weight: 600; font-size: 0.85rem; margin-right: 2px; }
|
||||
@media (min-width: 420px) { .app-navbar-account .navbar-username { display: inline; } }
|
||||
.app-navbar-account .navbar-balance {
|
||||
display: inline-flex; align-items: center; gap: 5px;
|
||||
font-weight: 700; font-size: 0.85rem; white-space: nowrap;
|
||||
background: color-mix(in srgb, var(--color-primary) 14%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
|
||||
color: color-mix(in srgb, var(--color-primary) 70%, var(--color-foreground));
|
||||
padding: 6px 10px; border-radius: 999px;
|
||||
}
|
||||
.app-navbar-account .icon-link {
|
||||
width: 36px; height: 36px; min-height: 36px; padding: 0; margin: 0; border-radius: 999px;
|
||||
justify-content: center;
|
||||
}
|
||||
.app-navbar-account .icon-link:hover { background: var(--color-surface-inset); }
|
||||
.app-navbar-account .icon-link .icon { width: 18px; height: 18px; }
|
||||
|
||||
/* Bottom tab bar on narrow (mobile) viewports — thumb-reachable, app-like. */
|
||||
.app-navbar-tabs {
|
||||
position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
|
||||
max-width: var(--content-width); margin: 0 auto;
|
||||
background: color-mix(in srgb, var(--color-surface) 94%, transparent);
|
||||
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
|
||||
border-top: 1px solid var(--color-border);
|
||||
box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, 0.18);
|
||||
display: flex; padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
.app-navbar-tabs button.navbar-tab {
|
||||
flex: 1; width: auto; min-height: 56px; margin-top: 0; padding: 8px 4px;
|
||||
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
|
||||
font-size: 0.68rem; font-weight: 600; font-family: inherit; cursor: pointer;
|
||||
background: none; color: var(--color-muted-foreground); box-shadow: none;
|
||||
border: none; border-radius: var(--radius-sm);
|
||||
transition: color 150ms, background 150ms;
|
||||
}
|
||||
.app-navbar-tabs button.navbar-tab .icon { width: 20px; height: 20px; }
|
||||
.app-navbar-tabs button.navbar-tab.active { color: var(--color-primary); }
|
||||
.app-navbar-tabs button.navbar-tab.active .icon { color: var(--color-primary); }
|
||||
.app-navbar-tabs button.navbar-tab:hover { filter: none; color: var(--color-foreground); background: var(--color-surface-inset); }
|
||||
.app-navbar-tabs button.navbar-tab.active:hover { color: var(--color-primary); background: none; }
|
||||
|
||||
/* Reserve room so fixed content never sits under the bottom bar or the
|
||||
iOS/Android home-indicator safe area. */
|
||||
.app-shell { padding-bottom: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0px) + 20px); }
|
||||
|
||||
@media (min-width: 720px) {
|
||||
:root { --content-width: 620px; }
|
||||
/* Promote the bottom tab bar back to an ordinary inline strip once there's
|
||||
enough width for it to sit comfortably under the top bar instead of
|
||||
floating over thumb-reach real estate. */
|
||||
.app-navbar-tabs {
|
||||
position: static; box-shadow: none; border-top: none;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
padding: 4px 12px; gap: 4px;
|
||||
}
|
||||
.app-navbar-tabs button.navbar-tab { flex-direction: row; min-height: 44px; font-size: 0.85rem; }
|
||||
.app-shell { padding-bottom: 40px; }
|
||||
}
|
||||
|
||||
.address-box {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
||||
background: var(--color-surface-inset); border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.85rem; word-break: break-all;
|
||||
}
|
||||
|
||||
.balance-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
|
||||
.balance-unit { color: var(--color-muted-foreground); font-size: 1rem; font-weight: 500; }
|
||||
|
||||
.icon { width: 16px; height: 16px; flex-shrink: 0; }
|
||||
|
||||
.dash-panel { display: none; }
|
||||
.dash-panel.active { display: block; }
|
||||
|
||||
.qr-box { display: flex; justify-content: center; padding: 16px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-top: 14px; }
|
||||
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
|
||||
|
||||
.hidden { display: none !important; }
|
||||
|
||||
.draw-state { display: none; text-align: center; padding: 8px 0 4px; }
|
||||
.draw-state.active { display: block; }
|
||||
.draw-spinner {
|
||||
width: 40px; height: 40px; margin: 0 auto 10px;
|
||||
border: 3px solid var(--color-border); border-top-color: var(--color-primary);
|
||||
border-radius: 50%; animation: spin 900ms linear infinite;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.draw-state .draw-label { font-weight: 600; font-size: 0.95rem; }
|
||||
.draw-result { font-size: 1.05rem; font-weight: 700; padding: 6px 0; }
|
||||
.draw-result.win { color: var(--color-success); }
|
||||
.draw-result.lose { color: var(--color-muted-foreground); }
|
||||
|
||||
#toast-container {
|
||||
position: fixed; left: 50%; transform: translateX(-50%);
|
||||
bottom: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0px) + 12px);
|
||||
display: flex; flex-direction: column; gap: 8px; z-index: 100; width: calc(100% - 40px); max-width: 440px;
|
||||
}
|
||||
@media (min-width: 720px) { #toast-container { bottom: 20px; } }
|
||||
.toast {
|
||||
display: flex; align-items: flex-start; gap: 8px;
|
||||
padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
|
||||
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
|
||||
animation: toast-in 200ms ease-out;
|
||||
}
|
||||
.toast.success { background: var(--color-success-bg); color: var(--color-success); }
|
||||
.toast.error { background: var(--color-destructive-bg); color: var(--color-destructive); }
|
||||
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
/* --- landing hero (shown only when logged out) --- */
|
||||
body {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
background:
|
||||
radial-gradient(600px circle at 20% -10%, color-mix(in srgb, var(--color-primary) 16%, transparent), transparent 60%),
|
||||
radial-gradient(500px circle at 90% 10%, color-mix(in srgb, var(--color-accent) 12%, transparent), transparent 60%);
|
||||
}
|
||||
|
||||
.hero { text-align: center; padding: 8px 0 28px; }
|
||||
.hero .eyebrow {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
|
||||
color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 12%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
|
||||
padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
|
||||
}
|
||||
.hero h1 {
|
||||
font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px;
|
||||
background: linear-gradient(135deg, var(--color-foreground), var(--color-accent) 120%);
|
||||
-webkit-background-clip: text; background-clip: text; color: transparent;
|
||||
}
|
||||
.hero p.lead { color: var(--color-muted-foreground); font-size: 0.95rem; margin: 0 auto; max-width: 360px; }
|
||||
|
||||
.hero-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0; }
|
||||
.hero-step {
|
||||
background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: 14px 8px; transition: transform 150ms, border-color 150ms, box-shadow 150ms;
|
||||
}
|
||||
.hero-step:hover { transform: translateY(-2px); border-color: var(--color-ring); box-shadow: var(--shadow-md); }
|
||||
.hero-step .step-icon {
|
||||
width: 32px; height: 32px; margin: 0 auto 8px; border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--color-primary) 14%, transparent); color: var(--color-primary);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.hero-step .step-icon .icon { width: 16px; height: 16px; }
|
||||
.hero-step .step-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; }
|
||||
.hero-step .step-hint { font-size: 0.72rem; color: var(--color-muted-foreground); line-height: 1.35; }
|
||||
|
||||
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
|
||||
.trust-pill {
|
||||
font-size: 0.72rem; font-weight: 500; color: var(--color-muted-foreground);
|
||||
background: var(--color-surface); border: 1px solid var(--color-border);
|
||||
padding: 5px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px;
|
||||
}
|
||||
.trust-pill .icon { width: 13px; height: 13px; color: var(--color-success); flex-shrink: 0; }
|
||||
|
||||
/* --- round status: a "hero" ticket-style card, always visible above the panels --- */
|
||||
.card.round-card {
|
||||
background:
|
||||
radial-gradient(320px circle at 100% 0%, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 70%),
|
||||
var(--color-surface);
|
||||
border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-border));
|
||||
}
|
||||
.round-card .hint { margin: 0; }
|
||||
|
||||
/* --- glowing card while a round is drawing --- */
|
||||
.card.drawing-glow {
|
||||
border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border));
|
||||
box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent),
|
||||
0 0 24px color-mix(in srgb, var(--color-primary) 22%, transparent);
|
||||
animation: glow-pulse 2200ms ease-in-out infinite;
|
||||
}
|
||||
@keyframes glow-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent), 0 0 16px color-mix(in srgb, var(--color-primary) 16%, transparent); }
|
||||
50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 45%, transparent), 0 0 28px color-mix(in srgb, var(--color-primary) 30%, transparent); }
|
||||
}
|
||||
|
||||
.jackpot-bump { animation: jackpot-bump 420ms ease-out; }
|
||||
@keyframes jackpot-bump {
|
||||
0% { transform: scale(1); }
|
||||
30% { transform: scale(1.12); color: var(--color-primary); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
/* --- network / lottery status strip, shown on every screen --- */
|
||||
.chain-bar {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 10px;
|
||||
font-size: 0.78rem; padding: 12px 2px 16px; margin-bottom: 4px;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.chain-status-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--color-foreground); }
|
||||
.status-dot {
|
||||
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
|
||||
background: var(--color-muted-foreground);
|
||||
}
|
||||
.status-dot.status-open {
|
||||
background: var(--color-success);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 18%, transparent);
|
||||
}
|
||||
.status-dot.status-drawing {
|
||||
background: var(--color-primary);
|
||||
animation: status-dot-pulse 1400ms ease-in-out infinite;
|
||||
}
|
||||
.status-dot.status-waiting { background: var(--color-muted-foreground); }
|
||||
.status-dot.status-offline { background: var(--color-destructive); }
|
||||
@keyframes status-dot-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 45%, transparent); }
|
||||
50% { box-shadow: 0 0 0 5px transparent; }
|
||||
}
|
||||
.chain-block { color: var(--color-muted-foreground); white-space: nowrap; }
|
||||
|
||||
.maintenance-banner {
|
||||
display: flex; align-items: flex-start; gap: 8px;
|
||||
background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
|
||||
color: var(--color-foreground); border-radius: var(--radius);
|
||||
padding: 12px 14px; font-size: 0.82rem; line-height: 1.4; margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation: none !important; transition: none !important; }
|
||||
}
|
||||
Reference in new issue
Block a user