diff --git a/OpenBench/static/refresh.css b/OpenBench/static/refresh.css new file mode 100644 index 0000000..87ce581 --- /dev/null +++ b/OpenBench/static/refresh.css @@ -0,0 +1,235 @@ +/* ========================================================================== + OpenBench - design refresh + + Loaded last (after style.css, ux.css, board.css). Only overrides tokens and + a handful of rules, so the older theme stays intact. Drop the in + base.html to revert everything in one step. + + Direction: warm graphite surfaces, bone-coloured text, a single board-green + accent. Colour is reserved for results (green / amber / red). The LLR gauge + on running SPRT tests is the one distinctive element; the rest stays quiet. + ========================================================================== */ + +:root { + /* Surfaces */ + --color1: #14161A; + --color2: #1A1D22; + --color3: #23272D; + --surface-head: #1F2227; + --surface-hover: #252A30; + + /* Lines */ + --line: #2A2E35; + --line-strong: #3A3F48; + + /* Text */ + --color-font1: #EDEAE3; + --color-font2: #C9C6BE; + --color-font3: #A9CDB3; + --muted: #8C8F96; + + /* Accent: board green. Buttons use the darker value so white text passes AA. */ + --accent: #4F8160; + --accent-hover: #6BA17D; + --accent-soft: rgba(94, 139, 106, 0.16); + --link: #8FC3A0; + --link-hover: #B9E0C6; + + /* Results */ + --ok: #6EDB9A; + --warn: #E8B84A; + --bad: #EF7B72; + --orange: #E8955A; + --purple: #B79FE0; + --purple-soft: rgba(183, 159, 224, 0.14); + + --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + + --radius: 3px; + --shadow-card: none; +} + +::selection { + background: rgba(94, 139, 106, 0.4); +} + +/* ---------- Chrome ---------- */ + +#topbar { + background: rgba(20, 22, 26, 0.92); +} + +#topbar .brand-name { + font-weight: 650; +} + +.page-title { + font-size: 26px; + font-weight: 600; + letter-spacing: -0.015em; +} + +/* ---------- Labels: sentence case instead of tracked capitals ---------- */ + +#sidebar .nav-title, +.card-title, +.badge, +.flag, +#content .table-header th, +#content .table-small-header th, +.stat-label, +.ev-meta dt, +.ev-facts dt, +.ev-player small, +.ev-sel-stats span { + text-transform: none; + letter-spacing: 0; +} + +#sidebar .nav-title { + font-size: 12.5px; + font-weight: 600; +} + +.card-title { + color: var(--color-font2); + font-size: 14px; + font-weight: 600; +} + +#content .table-header th, +#content .table-small-header th { + font-size: 12.5px; + font-weight: 600; +} + +/* The header's accent stripe carried no information */ +#content .table-header th:first-child { + border-left: 0; +} + +.stat-label, +.ev-meta dt, +.ev-facts dt, +.ev-player small { + font-size: 12.5px; +} + +.flag { + font-size: 11px; + font-weight: 600; +} + +.badge { + font-size: 12px; + font-weight: 600; +} + +/* ---------- Surfaces: borders instead of shadows ---------- */ + +.card, +.stat-card { + box-shadow: none; +} + +/* Fleet and queue counters: number first, icon as a quiet marker */ +.stat-card { + flex-direction: row-reverse; + justify-content: space-between; + align-items: flex-start; +} + +.stat-icon { + width: auto; + height: auto; + background: none !important; + font-size: 14px; +} + +.stat-value { + font-size: 26px; + font-weight: 600; +} + +/* ---------- Colour tokens that were hardcoded in older files ---------- */ + +.badge-info { + border-color: rgba(94, 139, 106, 0.45); + color: #A9D4B7; +} + +#content a.seg-btn.active { + box-shadow: inset 0 0 0 1px rgba(94, 139, 106, 0.5); +} + +.ev-move.is-active { + border-color: rgba(94, 139, 106, 0.5); +} + +.ev-white .ev-piece { background-color: #EDEAE3; } +.ev-black .ev-piece { background-color: #14161A; } + +/* ========================================================================== + LLR gauge (running SPRT tests) + + The track runs from the lower bound (left) to the upper bound (right). + The tall tick marks LLR = 0; the fill grows from it towards the current + LLR, so direction and distance to a decision read at a glance. + ========================================================================== */ + +.llr { + position: relative; + min-width: 150px; + height: 6px; + margin-top: 10px; + background-color: var(--line); + border-radius: 1px; +} + +/* Bound markers at both ends */ +.llr::before, +.llr::after { + content: ''; + position: absolute; + top: -3px; + bottom: -3px; + width: 2px; + background-color: var(--line-strong); +} + +.llr::before { left: 0; } +.llr::after { right: 0; } + +.llr-fill { + position: absolute; + top: 0; + bottom: 0; + background-color: var(--muted); +} + +.llr-pos .llr-fill { background-color: var(--ok); } +.llr-neg .llr-fill { background-color: var(--bad); } + +.llr-zero { + position: absolute; + top: -4px; + bottom: -4px; + width: 1px; + background-color: var(--color-font2); +} + +.llr-scale { + display: flex; + justify-content: space-between; + margin-top: 5px; + color: var(--muted); + font-family: var(--font-mono); + font-size: 10.5px; + font-variant-numeric: tabular-nums; + line-height: 1; +} + +.llr-scale b { + color: var(--color-font1); + font-weight: 500; +} diff --git a/OpenBench/templatetags/uitags.py b/OpenBench/templatetags/uitags.py index 90e739c..681db67 100644 --- a/OpenBench/templatetags/uitags.py +++ b/OpenBench/templatetags/uitags.py @@ -57,7 +57,27 @@ def progress_info(test): else: fraction, tone = 0.0, 'neutral' - return { 'pct' : int(max(0.0, min(1.0, fraction)) * 100), 'tone' : tone } + info = { 'pct' : int(max(0.0, min(1.0, fraction)) * 100), 'tone' : tone } + + # Data for the LLR gauge: the track runs lower -> upper bound, the fill + # grows from LLR = 0 towards the current LLR. Strings are formatted here + # so locale settings can never turn a decimal point into a comma. + + if lower < 0 < upper: + span = upper - lower + pos = max(0.0, min(1.0, (current - lower) / span)) * 100 + zero = (0.0 - lower) / span * 100 + info.update({ + 'gauge' : True, + 'llr' : '%.2f' % current, + 'lower' : '%.2f' % lower, + 'upper' : '%.2f' % upper, + 'zero' : '%.1f' % zero, + 'left' : '%.1f' % min(pos, zero), + 'width' : '%.1f' % abs(pos - zero), + }) + + return info if test.max_games: fraction = test.games / float(test.max_games) diff --git a/Templates/OpenBench/Blocks/testsummary.html b/Templates/OpenBench/Blocks/testsummary.html index 4da61c4..592107f 100644 --- a/Templates/OpenBench/Blocks/testsummary.html +++ b/Templates/OpenBench/Blocks/testsummary.html @@ -6,7 +6,13 @@ {% if test.error %}crash{% endif %} {% if test|test_is_fischer %}frc{% endif %} {% with progress=test|progress_info %} - {% if progress %} + {% if progress.gauge %} +