From 4882225751c45cb5cd6cf57a5e03a604ed8156f8 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 18 Jun 2026 00:53:18 +0000 Subject: [PATCH] feat: live stacks in hand viewer + retheme UI to RTO black/orange palette MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hand viewer: - stacks now decrement as players commit chips (street-aware "to"-amount accounting), showing e.g. 300 -> 285 after a 15 open, "all in" at 0; pot is computed from total committed (accurate, no double-counting raises) Theme (match the rec-theory-optimal look — warm black & orange, not Halloween): - deep near-black bg (#070707 / #0e0e0e panels), warm orange accent (#ff7a00), amber-gold secondary (#ffb347), muted green (#8fd694); warm dark borders - killed the neon-orange glows and the purple accents; chat app + all standalone pages (logs/self/journal/hand/recap/hands) on one palette Co-Authored-By: Claude Opus 4.8 (1M context) --- lyra/web/static/hand.html | 58 +- lyra/web/static/hands.html | 8 +- lyra/web/static/journal.html | 10 +- lyra/web/static/logs.html | 30 +- lyra/web/static/recap.html | 6 +- lyra/web/static/self.html | 10 +- lyra/web/static/style.css | 1992 +++++++++++++++++----------------- 7 files changed, 1069 insertions(+), 1045 deletions(-) diff --git a/lyra/web/static/hand.html b/lyra/web/static/hand.html index 60577ba..7c5f1df 100644 --- a/lyra/web/static/hand.html +++ b/lyra/web/static/hand.html @@ -3,13 +3,13 @@ - + Lyra — Hand @@ -140,7 +140,9 @@ // place seats around the oval const seatsEl = document.getElementById('seats'); + const starts = {}; ordered.forEach((p,i)=>{ + starts[p.pos] = (p.stack!=null ? Number(p.stack) : null); const ang = (90 + i*(360/n)) * Math.PI/180; // bottom = 90deg const x = 50 + 46*Math.cos(ang), y = 50 + 44*Math.sin(ang); const el = document.createElement('div'); @@ -151,7 +153,7 @@ el.innerHTML = `
${esc(p.pos||'')}
` + (p.name?`
${esc(p.name)}
`:'') + `
${hcards?cards(hcards,true):'xx'}
` - + (p.stack!=null?`
${esc(p.stack)}
`:'') + + `
${p.stack!=null?esc(p.stack):''}
` + `
`; seatsEl.appendChild(el); }); @@ -167,25 +169,47 @@ return `
${esc(a.street||'')}${esc(a.pos||'')} ${esc(a.action||'')}${amt}
`; }).join(''); + const cap = s => s ? s[0].toUpperCase()+s.slice(1) : s; + const fmt = n => Number.isInteger(n) ? n : Math.round(n*100)/100; + function draw(){ - let pot = 0, board = [], street = 'Preflop'; + let board = [], street = 'Preflop'; const lastAct = {}, folded = {}; + // street-aware chip accounting: amounts are "to" totals for the street + const contrib = {}; // committed in prior (flushed) streets + let streetCommit = {}, streetBet = 0, curStreet = 'preflop'; + const flushStreet = () => { for(const p in streetCommit){ contrib[p]=(contrib[p]||0)+streetCommit[p]; } streetCommit={}; streetBet=0; }; for(let i=0;i{ committed[p]=(contrib[p]||0)+(streetCommit[p]||0); pot+=committed[p]; }); boardEl.innerHTML = cards(board); - potEl.textContent = pot ? ('Pot ~'+pot) : ''; + potEl.textContent = pot ? ('Pot '+fmt(pot)) : ''; streetEl.textContent = street; document.querySelectorAll('.seat').forEach(s=>{ const pos=s.dataset.pos; s.querySelector('[data-act]').textContent = lastAct[pos]||''; s.classList.toggle('folded', !!folded[pos]); s.classList.remove('acting'); + const stEl=s.querySelector('[data-stack]'), start=starts[pos], c=committed[pos]||0; + if(start!=null){ const rem=start-c; stEl.textContent = rem<=0 ? 'all in' : fmt(rem); } + else { stEl.textContent = c ? '−'+fmt(c) : ''; } }); const cur = acts[step-1]; if(cur && cur.pos){ diff --git a/lyra/web/static/hands.html b/lyra/web/static/hands.html index 7055f51..f6d3e36 100644 --- a/lyra/web/static/hands.html +++ b/lyra/web/static/hands.html @@ -3,10 +3,10 @@ - + Lyra — Hands diff --git a/lyra/web/static/journal.html b/lyra/web/static/journal.html index 0fb8995..4efba0f 100644 --- a/lyra/web/static/journal.html +++ b/lyra/web/static/journal.html @@ -3,13 +3,13 @@ - + Lyra — Journal