Spaces:
Running
fix: card hover cascade, nav/row tap targets, and t4 dark-mode contrast
Browse files- Remove duplicate flatter .card:hover rule (was overriding the richer
translateY(-5px) scale(1.008) + elaborate shadow lift with a plain
translateY(-2px), no-scale version later in cascade order). Only one
.card:hover rule remains; @media (hover:none) touch override untouched.
- Raise nav .chip input/select min-height 20px -> 36px, add matching
min-height:36px to .state-filter-toggle, and add min-height:40px to
.row-summary (ranked-row click target), addressing sub-24px tap
targets flagged in the interaction/motion audit without disrupting
the compact row/chip layouts.
- Lighten dark-theme --t4 from #5b667e (3.46:1 on --bg, fails WCAG AA)
to #707c98 (4.77:1 on --bg, 4.59:1 on --bg2), verified via a
relative-luminance/contrast script. Affects USDT quote-suffix,
confidence /10 denominator, scan-step elapsed labels, and backtest
per-state trade counts.
Also verified (already fixed by prior uncommitted session, logic
confirmed sound on re-read, no changes needed):
- flipReorder() FLIP re-rank now keys the before/after position map by
el.dataset.sym instead of DOM element reference, so the transform
correctly applies across refreshScanQuietly()'s replaceWith() swaps.
- Scan-loader step 4 ("Ranking setups") now rotates reassurance copy
every 5s via startStep4Wait()/STEP4_WAIT_MESSAGES instead of sitting
static during slow 40-90s cold-start scans; timers cleared correctly
in both startLoaderSteps() reset and stopLoaderSteps() cleanup.
Validation: python brace/paren/bracket balance check on full file OK;
node --check (v20.20.2) on largest inline <script> OK; local uvicorn
smoke test on :8954 returned 200 for / and /api/status with no
Python errors, and served output confirmed all edits present.
43 unmodified lines444546474849501480 unmodified lines153115321533153415351536153746 unmodified lines158415851586158715881589159080 unmodified lines167116721673167416751676167773 unmodified lines17511752175317541755175617571758175917601761709 unmodified lines24712472247324742475247624772478247924802 unmodified lines2483248424852486248724881 unmodified line2490249124922493249424952496249724982499250025012 unmodified lines25042505250625072508250925104 unmodified lines2515251625172518251925209 unmodified lines2530253125322533253425352536400 unmodified lines293729382939294029412942294329442945294629472948294943 unmodified lines--t1: var(--tx);--t2: var(--tx2);--t3: var(--tx3);--t4: #5b667e;--muted: var(--tx3);/* ── Palette ── */1480 unmodified lines.state-filter-toggle {display:inline-flex; align-items:center; gap:5px;background:var(--glass2); border:1px solid var(--gb);border-radius:8px; padding:4px 10px;font-size:11px; font-weight:700; color:var(--t2); cursor:pointer;transition:all 0.2s;}46 unmodified lines.row-summary { display:none; }.card.row-mode .row-summary {display:grid; cursor:pointer;grid-template-columns:26px 1.2fr 0.8fr 0.65fr 0.65fr 18px;align-items:center; gap:10px;}80 unmodified lines/* ── Touch targets — minimum 44px per WCAG 2.5.5 ── */.chip { min-height:40px; }.chip input, .chip select { min-height:20px; }.bt-run-btn { min-height:36px; padding:6px 12px; }.live-acc-resolve-btn { min-height:36px; padding:6px 10px; }.signals-refresh-btn { width:36px !important; height:36px !important; }73 unmodified linesbackdrop-filter:blur(14px) saturate(160%);-webkit-backdrop-filter:blur(14px) saturate(160%);}.card:hover {transform:translateY(-2px);border-color:var(--gb);box-shadow:var(--shadow), inset 0 1px 0 var(--rim), 0 0 0 1px rgba(76,201,240,0.22);}#cycle-section { position:relative; }#grid { position:relative; }709 unmodified lines/* ═══ Loader step animator ═══ */let stepTimer=null, elapsedTimer=null, countTimer=null, currentStep=0;let scanStartTime=0;function startLoaderSteps() {currentStep=0; scanStartTime=Date.now();clearInterval(stepTimer); clearInterval(elapsedTimer); clearInterval(countTimer);// Reset all stepsfor(let i=1;i<=4;i++){2 unmodified linesconst num=el.querySelector('.step-num'); if(num) num.textContent=i;const t=$('st'+i); if(t) t.textContent='';}const sc=$('scan-count'); if(sc) sc.textContent='0';const se=$('scan-elapsed'); if(se) se.textContent='0s';1 unmodified lineactivateStep(1);startSymbolStream();// Progress through steps: 1→2 at 3s, 2→3 at 7s, 3→4 at 11sconst timings=[3000,4000,4000];let cumulative=0;timings.forEach((delay,i)=>{cumulative+=delay;setTimeout(()=>{ markDone(i+1); activateStep(i+2); }, cumulative);});// Elapsed counter2 unmodified linesconst se=$('scan-elapsed'); if(se) se.textContent=s+'s';},500);// Fake count-up: 0→280 over ~12s (pace slows toward end)let count=0;countTimer=setInterval(()=>{const target=280, elapsed=(Date.now()-scanStartTime)/1000;4 unmodified lines},120);}function activateStep(n) {if(n>4) return;const el=$('sd'+n); if(!el) return;9 unmodified lines}function stopLoaderSteps() {clearInterval(stepTimer); clearInterval(elapsedTimer); clearInterval(countTimer);for(let i=1;i<=4;i++) markDone(i);const sc=$('scan-count'); if(sc) sc.textContent='280+';stopSymbolStream();400 unmodified lines/* ═══ FLIP re-rank + never-blank auto-refresh ═══ */function flipReorder(container, mutation) {const before = new Map([...container.children].map(el => [el, el.getBoundingClientRect()]));mutation();const reduced = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;if (reduced) return;[...container.children].forEach(el => {const f = before.get(el);if (!f) return; // brand-new element — handled by its own reveal animationconst l = el.getBoundingClientRect();const dx = f.left - l.left, dy = f.top - l.top;if (dx || dy) {43 unmodified lines444546474849501480 unmodified lines153115321533153415351536153746 unmodified lines158415851586158715881589159080 unmodified lines167116721673167416751676167773 unmodified lines175117521753175417551756709 unmodified lines24662467246824692470247124722473247424752476247724782479248024812482248324842485248624872 unmodified lines249024912492249324942495249624971 unmodified line2499250025012502250325042505250625072508250925102511251225132514251525162 unmodified lines251925202521252225232524252525264 unmodified lines253125322533253425352536253725382539254025412542254325442545254625479 unmodified lines255725582559256025612562256325642565400 unmodified lines296629672968296929702971297229732974297529762977297829792980298129822983298443 unmodified lines--t1: var(--tx);--t2: var(--tx2);--t3: var(--tx3);--t4: #707c98;--muted: var(--tx3);/* ── Palette ── */1480 unmodified lines.state-filter-toggle {display:inline-flex; align-items:center; gap:5px;background:var(--glass2); border:1px solid var(--gb);border-radius:8px; padding:4px 10px; min-height:36px; box-sizing:border-box;font-size:11px; font-weight:700; color:var(--t2); cursor:pointer;transition:all 0.2s;}46 unmodified lines.row-summary { display:none; }.card.row-mode .row-summary {display:grid; cursor:pointer; min-height:40px;grid-template-columns:26px 1.2fr 0.8fr 0.65fr 0.65fr 18px;align-items:center; gap:10px;}80 unmodified lines/* ── Touch targets — minimum 44px per WCAG 2.5.5 ── */.chip { min-height:40px; }.chip input, .chip select { min-height:36px; }.bt-run-btn { min-height:36px; padding:6px 12px; }.live-acc-resolve-btn { min-height:36px; padding:6px 10px; }.signals-refresh-btn { width:36px !important; height:36px !important; }73 unmodified linesbackdrop-filter:blur(14px) saturate(160%);-webkit-backdrop-filter:blur(14px) saturate(160%);}#cycle-section { position:relative; }#grid { position:relative; }709 unmodified lines/* ═══ Loader step animator ═══ */let stepTimer=null, elapsedTimer=null, countTimer=null, currentStep=0;let scanStartTime=0;let step4WaitTimer=null, step4MsgIdx=0;// Step 4 ("Ranking setups") is the last step and has no further server signal to advance on —// on a slow cold-start scan (40-90s) it would otherwise sit frozen on "running…" for a long// time. Rotate its sub-label through reassurance copy every ~5s instead of appearing stuck,// until stopLoaderSteps() is called when the real fetch resolves.const STEP4_WAIT_MESSAGES = ['35/20/15/15/15 scoring · sorting by confidence','Still ranking — large markets can take up to 90s','Cross-checking confidence bands…','Almost there — finalizing setup order…'];function startLoaderSteps() {currentStep=0; scanStartTime=Date.now();clearInterval(stepTimer); clearInterval(elapsedTimer); clearInterval(countTimer); clearInterval(step4WaitTimer);step4MsgIdx=0;// Reset all stepsfor(let i=1;i<=4;i++){2 unmodified linesconst num=el.querySelector('.step-num'); if(num) num.textContent=i;const t=$('st'+i); if(t) t.textContent='';}const sd4sub=document.querySelector('#sd4 .step-sub');if(sd4sub) sd4sub.textContent=STEP4_WAIT_MESSAGES[0];const sc=$('scan-count'); if(sc) sc.textContent='0';const se=$('scan-elapsed'); if(se) se.textContent='0s';1 unmodified lineactivateStep(1);startSymbolStream();// Progress through steps: 1→2 at 3s, 2→3 at 7s, 3→4 at 11s. These are illustrative pacing// for the first 3 steps only — step 4 has its own indefinite-wait handling below since the// real scan duration varies 40-90s and isn't streamed to the client.const timings=[3000,4000,4000];let cumulative=0;timings.forEach((delay,i)=>{cumulative+=delay;setTimeout(()=>{markDone(i+1);activateStep(i+2);if(i+2===4) startStep4Wait();}, cumulative);});// Elapsed counter2 unmodified linesconst se=$('scan-elapsed'); if(se) se.textContent=s+'s';},500);// Fake count-up: 0→280 over ~12s (pace slows toward end), then holds at 280 gracefully// (rather than looking frozen mid-count) for the remainder of a slow scan.let count=0;countTimer=setInterval(()=>{const target=280, elapsed=(Date.now()-scanStartTime)/1000;4 unmodified lines},120);}function startStep4Wait() {clearInterval(step4WaitTimer);step4MsgIdx=0;step4WaitTimer=setInterval(()=>{step4MsgIdx=(step4MsgIdx+1)%STEP4_WAIT_MESSAGES.length;const sd4sub=document.querySelector('#sd4 .step-sub');if(sd4sub) sd4sub.textContent=STEP4_WAIT_MESSAGES[step4MsgIdx];const t=$('st4'); if(t) t.textContent=Math.floor((Date.now()-scanStartTime)/1000)+'s';},5000);}function activateStep(n) {if(n>4) return;const el=$('sd'+n); if(!el) return;9 unmodified lines}function stopLoaderSteps() {clearInterval(stepTimer); clearInterval(elapsedTimer); clearInterval(countTimer); clearInterval(step4WaitTimer);const sd4sub=document.querySelector('#sd4 .step-sub');if(sd4sub) sd4sub.textContent=STEP4_WAIT_MESSAGES[0];for(let i=1;i<=4;i++) markDone(i);const sc=$('scan-count'); if(sc) sc.textContent='280+';stopSymbolStream();400 unmodified lines/* ═══ FLIP re-rank + never-blank auto-refresh ═══ */function flipReorder(container, mutation) {// Keyed by data-sym (stable identity) rather than DOM element reference: refreshScanQuietly// replaces unchanged cards with brand-new nodes via replaceWith(), so an element-reference// keyed map would never match post-mutation and the FLIP transform would always be skipped.const before = new Map([...container.children].filter(el => el.dataset && el.dataset.sym).map(el => [el.dataset.sym, el.getBoundingClientRect()]));mutation();const reduced = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;if (reduced) return;[...container.children].forEach(el => {const key = el.dataset && el.dataset.sym;const f = key ? before.get(key) : null;if (!f) return; // brand-new/unkeyed element — handled by its own reveal animationconst l = el.getBoundingClientRect();const dx = f.left - l.left, dy = f.top - l.top;if (dx || dy) {