Dark masked squares, reveal fade and ring on the square just decided
Browse files20 unmodified lines21222324252627135 unmodified lines16316416516616716816917017117217317417517617765 unmodified lines243244245246247248249250111 unmodified lines36236336436536636736836937037137237337442 unmodified lines4174184194204214224234244254264274 unmodified lines43243343443543643743820 unmodified lines--line: #e4e4e4;--sq-light: #f4f4f4;--sq-dark: #a8a8a8;--hatch: rgba(0, 0, 0, 0.32);}@media (prefers-color-scheme: dark) {:root {135 unmodified lines.hidden { display: none !important; }/* A masked square keeps its colour and gets grey hatching */.masked-square-overlay {background-image: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 6px) !important;}.legend { display: flex; gap: 18px; margin-top: 16px; font-size: 12px; color: var(--muted); }.legend-item { display: flex; align-items: center; gap: 6px; }.legend-box { width: 12px; height: 12px; border: 1px solid var(--faint); }.legend-box.masked { background: var(--sq-dark) repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 5px); }.legend-box.empty { background: var(--sq-light); }.about {max-width: 520px; margin: 52px auto 0; padding-top: 20px;65 unmodified lines<input type="range" id="speed-slider" min="10" max="1000" step="10" value="50"></div><div class="legend"><div class="legend-item"><div class="legend-box masked"></div><span>Masked (unknown)</span></div><div class="legend-item"><div class="legend-box empty"></div><span>Empty square</span></div></div></div></div>111 unmodified linesfunction clearMaskedHighlights() {$('#diffusion-board .masked-square-overlay').removeClass('masked-square-overlay');}function highlightMaskedSquares(maskedSquares) {clearMaskedHighlights();for (const square of maskedSquares) {$(`#diffusion-board [data-square="${square}"]`).addClass('masked-square-overlay');}}function tokensToFen(tokens) {42 unmodified linesattemptBadge.removeClass('searching found failed').addClass('searching').text(`Attempt ${attempt.attempt} (temp: ${attempt.temperature})`);temperatureEl.text(attempt.temperature.toFixed(2));for (const step of attempt.steps) {diffusionBoard.position(tokensToPosition(step.board_tokens), false);const maskedSquares = getMaskedSquares(step.board_tokens);setTimeout(() => highlightMaskedSquares(maskedSquares), 10);stepNum.text(`${step.step}/${attempt.steps.length}`);masksLeft.text(step.masks_remaining);timestepEl.text(step.t.toFixed(3));4 unmodified linesif (attempt.valid) {attemptBadge.removeClass('searching').addClass('found').text(`Found: ${attempt.move}`);diffusionBoard.position(tokensToPosition(attempt.final_tokens), false);clearMaskedHighlights();stepNum.text(`${attempt.steps.length}/${attempt.steps.length}`);masksLeft.text('0');progressFill.css('width', '100%');20 unmodified lines2122232425262728135 unmodified lines16416516616716816917017117217317417517617717817918018118218318418518618718865 unmodified lines254255256257258259260261262111 unmodified lines37437537637737837938038138238338438538638738838939039139239342 unmodified lines4364374384394404414424434444454464474484494504 unmodified lines45545645745845946046120 unmodified lines--line: #e4e4e4;--sq-light: #f4f4f4;--sq-dark: #a8a8a8;--mask: #1d1d1d; /* a square the model has not decided yet */--mask-line: rgba(255, 255, 255, 0.10);}@media (prefers-color-scheme: dark) {:root {135 unmodified lines.hidden { display: none !important; }/* Masked squares are near-black. When the model decides a square it fades to its owncolour, and the square decided last keeps a dark ring until the next step. */.masked-square-overlay {background-color: var(--mask) !important;background-image: repeating-linear-gradient(45deg, var(--mask-line) 0 2px, transparent 2px 7px) !important;}.just-revealed {box-shadow: inset 0 0 0 3px var(--mask);animation: reveal var(--reveal-ms, 300ms) ease-out;}@keyframes reveal { from { background-color: var(--mask); } }@media (prefers-reduced-motion: reduce) { .just-revealed { animation: none; } }.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 12px; color: var(--muted); }.legend-item { display: flex; align-items: center; gap: 6px; }.legend-box { width: 12px; height: 12px; border: 1px solid var(--faint); }.legend-box.masked { background: var(--mask) repeating-linear-gradient(45deg, var(--mask-line) 0 2px, transparent 2px 5px); }.legend-box.just { background: var(--sq-light); box-shadow: inset 0 0 0 2px var(--mask); }.legend-box.revealed { background: var(--sq-light); }.about {max-width: 520px; margin: 52px auto 0; padding-top: 20px;65 unmodified lines<input type="range" id="speed-slider" min="10" max="1000" step="10" value="50"></div><div class="legend"><div class="legend-item"><div class="legend-box masked"></div><span>Masked</span></div><div class="legend-item"><div class="legend-box just"></div><span>Just revealed</span></div><div class="legend-item"><div class="legend-box revealed"></div><span>Revealed</span></div></div></div></div>111 unmodified linesfunction clearMaskedHighlights() {$('#diffusion-board .masked-square-overlay').removeClass('masked-square-overlay');$('#diffusion-board .just-revealed').removeClass('just-revealed');}// Masked squares are drawn dark; squares masked in the previous frame and decided in// this one get "just-revealed" (a fade to their colour and a ring).function highlightMaskedSquares(maskedSquares, previousMasked) {clearMaskedHighlights();const stillMasked = new Set(maskedSquares);for (const square of maskedSquares) {$(`#diffusion-board [data-square="${square}"]`).addClass('masked-square-overlay');}for (const square of previousMasked || []) {if (!stillMasked.has(square)) $(`#diffusion-board [data-square="${square}"]`).addClass('just-revealed');}}function tokensToFen(tokens) {42 unmodified linesattemptBadge.removeClass('searching found failed').addClass('searching').text(`Attempt ${attempt.attempt} (temp: ${attempt.temperature})`);temperatureEl.text(attempt.temperature.toFixed(2));// The reveal fade follows the animation speed (60-500 ms).document.documentElement.style.setProperty('--reveal-ms', Math.min(Math.max(animationSpeed, 60), 500) + 'ms');let previousMasked = null;for (const step of attempt.steps) {diffusionBoard.position(tokensToPosition(step.board_tokens), false);const maskedSquares = getMaskedSquares(step.board_tokens);highlightMaskedSquares(maskedSquares, previousMasked);previousMasked = maskedSquares;stepNum.text(`${step.step}/${attempt.steps.length}`);masksLeft.text(step.masks_remaining);timestepEl.text(step.t.toFixed(3));4 unmodified linesif (attempt.valid) {attemptBadge.removeClass('searching').addClass('found').text(`Found: ${attempt.move}`);diffusionBoard.position(tokensToPosition(attempt.final_tokens), false);highlightMaskedSquares([], previousMasked); // the last square decidedstepNum.text(`${attempt.steps.length}/${attempt.steps.length}`);masksLeft.text('0');progressFill.css('width', '100%');
index.html+34-11