Spaces:
Running on Zero
Running on Zero
Polish workbench ranking motion and comparison controls
Browse filesFiles changed (4)
5 unmodified lines6789101112135 unmodified lines<meta name="theme-color" content="#f7f8f6"><link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M3 12 16 5l13 7-13 7L3 12Zm0 7 13 7 13-7' fill='none' stroke='%230f766e' stroke-width='2.5'/%3E%3C/svg%3E"><title>Critique-then-Rerank · Decision Lab</title><link rel="stylesheet" href="./workbench/lab.css?v=live-beams"><script type="module" src="./workbench/lab.js?v=live-beams"></script></head><body><header class="topbar">5 unmodified lines6789101112135 unmodified lines<meta name="theme-color" content="#f7f8f6"><link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M3 12 16 5l13 7-13 7L3 12Zm0 7 13 7 13-7' fill='none' stroke='%230f766e' stroke-width='2.5'/%3E%3C/svg%3E"><title>Critique-then-Rerank · Decision Lab</title><link rel="stylesheet" href="./workbench/lab.css?v=rank-settle"><script type="module" src="./workbench/lab.js?v=rank-settle"></script></head><body><header class="topbar">
133 unmodified lines134135136137138139132 unmodified lines27227327427527627748 unmodified lines326327328329330331332133 unmodified lines.after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }.divider { position: absolute; inset: 0 auto 0 clamp(1px, var(--split), calc(100% - 1px)); width: 2px; transform: translateX(-50%); background: var(--panel); box-shadow: 0 0 0 1px #182822a6; pointer-events: none; }.divider-grip { position: absolute; top: 50%; left: clamp(23px, var(--split), calc(100% - 23px)); display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 2px solid var(--green); border-radius: 50%; color: var(--green); background: var(--panel); box-shadow: 0 2px 14px #1828225e; pointer-events: none; }.swipe:focus-within .divider-grip, .swipe:hover .divider-grip { background: var(--green-wash); }.swipe:has(input:focus-visible) .divider-grip { outline: 2px solid var(--panel); outline-offset: 3px; }.t1, .t2, .frame span { position: absolute; top: 10px; background: var(--panel); border: 1px solid var(--control); color: var(--ink); border-radius: 5px; padding: 3px 7px; font: .82rem var(--mono); }132 unmodified lines.probe-beam strong { font: 700 .93rem/1.2 var(--mono); }.probe-beam.probe-picked { border-color: var(--green); background: var(--green-wash); }.probe-beam.probe-picked code, .probe-beam.probe-picked strong { color: var(--green); }.probe-action { min-height: 40px; margin-block: 8px; padding: 6px 10px; color: var(--green); font-size: .84rem; font-weight: 700; }.probe-action span { margin-inline-start: 4px; }.order-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }48 unmodified lines.empty { padding: 18px 12px; color: var(--dim); border-radius: 7px; background: var(--deep); border: 1px dashed var(--line); }.empty h4 { color: var(--ink); margin-block: 4px 8px; }footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--dim); padding-block: 16px 22px; }@media (prefers-reduced-motion: no-preference) {.deck > div, .comparison > div:last-child { animation: arrive .24s ease-out both; }.evidence-layer { transition: opacity .28s ease; }.prob-track i { transition: transform .32s ease; }133 unmodified lines134135136137138139140132 unmodified lines27327427527627727827948 unmodified lines328329330331332333334335336337338339340341342133 unmodified lines.after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }.divider { position: absolute; inset: 0 auto 0 clamp(1px, var(--split), calc(100% - 1px)); width: 2px; transform: translateX(-50%); background: var(--panel); box-shadow: 0 0 0 1px #182822a6; pointer-events: none; }.divider-grip { position: absolute; top: 50%; left: clamp(23px, var(--split), calc(100% - 23px)); display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 2px solid var(--green); border-radius: 50%; color: var(--green); background: var(--panel); box-shadow: 0 2px 14px #1828225e; pointer-events: none; }.divider-grip::before { content: ''; position: absolute; inset: 3px; border: 1px solid #3c80763b; border-radius: inherit; }.swipe:focus-within .divider-grip, .swipe:hover .divider-grip { background: var(--green-wash); }.swipe:has(input:focus-visible) .divider-grip { outline: 2px solid var(--panel); outline-offset: 3px; }.t1, .t2, .frame span { position: absolute; top: 10px; background: var(--panel); border: 1px solid var(--control); color: var(--ink); border-radius: 5px; padding: 3px 7px; font: .82rem var(--mono); }132 unmodified lines.probe-beam strong { font: 700 .93rem/1.2 var(--mono); }.probe-beam.probe-picked { border-color: var(--green); background: var(--green-wash); }.probe-beam.probe-picked code, .probe-beam.probe-picked strong { color: var(--green); }.probe-beam.probe-picked, .explorer-pool .winner { position: relative; z-index: 1; box-shadow: inset 3px 0 0 var(--green), 0 3px 9px #173b2e12; }.probe-action { min-height: 40px; margin-block: 8px; padding: 6px 10px; color: var(--green); font-size: .84rem; font-weight: 700; }.probe-action span { margin-inline-start: 4px; }.order-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }48 unmodified lines.empty { padding: 18px 12px; color: var(--dim); border-radius: 7px; background: var(--deep); border: 1px dashed var(--line); }.empty h4 { color: var(--ink); margin-block: 4px 8px; }footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--dim); padding-block: 16px 22px; }:root { --rank-settle: cubic-bezier(.2,.88,.23,1); }@supports (animation-timing-function: linear(0,1)) {:root { --rank-settle: linear(0,.14 8%,.43 18%,.73 29%,.94 41%,1.026 55%,1.018 68%,1 86%,1); }}@media (prefers-reduced-motion: no-preference) {.divider-grip { transition: transform .4s var(--rank-settle); }.swipe:has(input:active) .divider-grip { transform: translate(-50%, -50%) scale(.91); transition: transform .08s ease-out; }.probe-action { transition: transform .36s var(--rank-settle); }.probe-action:active { transform: translateY(1px) scale(.98); transition: transform .08s ease-out; }.deck > div, .comparison > div:last-child { animation: arrive .24s ease-out both; }.evidence-layer { transition: opacity .28s ease; }.prob-track i { transition: transform .32s ease; }
1234import { moveCards, renderProbes, tasks } from './tasks.js?v=live-beams';const byId = id => document.getElementById(id);const escape = value => String(value ?? '').replace(/[&<>"']/g, char => ({'&':'&', '<':'<', '>':'>', '"':'"', "'":'''}[char]));1234import { moveCards, renderProbes, tasks } from './tasks.js?v=rank-settle';const byId = id => document.getElementById(id);const escape = value => String(value ?? '').replace(/[&<>"']/g, char => ({'&':'&', '<':'<', '>':'>', '"':'"', "'":'''}[char]));
6 unmodified lines789101112135 unmodified lines1920212223242526276 unmodified linesconst motions = new WeakMap();export function moveCards(list, cards, update) {const animate = !matchMedia('(prefers-reduced-motion: reduce)').matches && list.getClientRects().length > 0;const before = animate ? cards.map(card => card.getBoundingClientRect().top) : [];cards.forEach((card, index) => {motions.get(card)?.cancel();5 unmodified linesupdate(card, index);});if (!animate) return;cards.forEach((card, index) => {const distance = before[index] - card.getBoundingClientRect().top;if (Math.abs(distance) > 1) motions.set(card, card.animate([{transform:`translateY(${distance}px)`}, {transform:'none'}], {duration:330, easing:'cubic-bezier(.22,.8,.28,1)'}));});}6 unmodified lines789101112135 unmodified lines1920212223242526272829306 unmodified linesconst motions = new WeakMap();export function moveCards(list, cards, update) {const animate = !matchMedia('(prefers-reduced-motion: reduce)').matches && list.getClientRects().length > 0 && typeof list.animate === 'function';const before = animate ? cards.map(card => card.getBoundingClientRect().top) : [];cards.forEach((card, index) => {motions.get(card)?.cancel();5 unmodified linesupdate(card, index);});if (!animate) return;const easing = getComputedStyle(list).getPropertyValue('--rank-settle').trim() || 'ease-out';cards.forEach((card, index) => {const distance = before[index] - card.getBoundingClientRect().top;if (Math.abs(distance) <= 1) return;const duration = Math.min(510, 300 + Math.sqrt(Math.abs(distance)) * 10);motions.set(card, card.animate([{transform:`translateY(${distance}px)`}, {transform:'none'}], {duration, easing}));});}
workbench/index.html+2-2
workbench/lab.css+10
workbench/lab.js+1-1
workbench/tasks.js+5-2