lumbda/wasm/app/style.css
russell@unturf.com 0c0bec7784
playground: race 3 tiers in parallel workers
One Worker per tier (python/c/asm). "All three" mode dispatches
Promise.all so the tiers race on independent threads — a slow Pyodide
no longer blocks C and asm. Each tier-block ticks its own ms counter
until its worker resolves.

Output grid: 3 columns when 3 tier-blocks render, else stacked.
Status bar announces the winner: "ok — c won in 47 ms".

Cancel terminates every active worker.
2026-06-14 12:38:22 -04:00

289 lines
6.4 KiB
CSS

/* lumbda playground — styled to match lumbda.com homepage.
* palette + typography mirror www/style.css.
*/
@font-face {
font-family: 'chunkfive';
src: url('fonts/chunkfive/chunkfive-regular-webfont.woff2') format('woff2'),
url('fonts/chunkfive/chunkfive-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
:root {
--fg: #1a1a1a;
--bg: #fafaf7;
--muted: #666;
--accent: #227842; /* single brand green — matches homepage */
--green: #227842;
--rule: #d4d4d0;
--code-bg: #f0ede4;
--pane-bg: #ffffff;
--busy: #b15a00;
--err: #b1262b;
--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
@media (prefers-color-scheme: dark) {
:root {
--fg: #e8e6e0;
--bg: #161613;
--muted: #9a9892;
--accent: #5ec07a; /* lightened for contrast on dark bg */
--green: #5ec07a;
--rule: #3a3a36;
--code-bg: #22221f;
--pane-bg: #1c1c19;
--busy: #e0a050;
--err: #f06070;
}
}
* { box-sizing: border-box; }
html, body {
margin: 0; padding: 0;
background: var(--bg);
color: var(--fg);
font-family: var(--mono);
font-size: 14px;
line-height: 1.55;
min-height: 100%;
}
/* ─── Header ────────────────────────────────────────────────────── */
header {
border-bottom: 1px solid var(--rule);
padding: 1.5rem 1.5rem 1rem;
}
.brand {
display: inline-flex;
align-items: flex-end;
gap: 0.6rem;
text-decoration: none;
color: inherit;
}
.brand:hover .period { transform: translateY(-2px); }
.brand .logo {
width: 3.2rem;
height: auto;
display: block;
}
header h1 {
font-family: 'chunkfive', Georgia, serif;
font-size: 2.4rem;
margin: 0;
letter-spacing: -0.01em;
line-height: 1;
font-weight: normal;
}
header h1 .period {
color: var(--green);
display: inline-block;
transition: transform 120ms ease;
}
header .tagline {
font-family: 'chunkfive', Georgia, serif;
color: var(--muted);
margin: 0.4rem 0 0.6rem;
font-size: 1rem;
letter-spacing: 0.01em;
}
header .lede {
margin: 0;
max-width: 70rem;
color: var(--fg);
font-size: 0.85rem;
line-height: 1.55;
}
header .lede strong {
color: var(--green);
font-weight: 600;
}
header code {
background: var(--code-bg);
padding: 0 0.2em;
border-radius: 2px;
font-size: 0.9em;
}
/* ─── Controls ──────────────────────────────────────────────────── */
.controls {
padding: 0.75rem 1.5rem;
border-bottom: 1px solid var(--rule);
display: flex;
gap: 1rem;
align-items: center;
flex-wrap: wrap;
background: var(--bg);
}
.controls fieldset {
border: 1px solid var(--rule);
border-radius: 3px;
padding: 3px 10px 5px;
margin: 0;
background: var(--pane-bg);
}
.controls fieldset legend {
color: var(--muted);
font-size: 0.7rem;
padding: 0 0.4em;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.controls label {
margin-right: 0.7em;
cursor: pointer;
user-select: none;
font-size: 0.85em;
}
.controls label input {
margin-right: 0.3em;
accent-color: var(--green);
}
.controls button {
font-family: var(--mono);
font-size: 0.85em;
font-weight: 600;
padding: 6px 16px;
border-radius: 3px;
cursor: pointer;
border: 1px solid var(--green);
}
.controls button.primary {
background: var(--green);
color: var(--bg);
}
.controls button.primary:hover { filter: brightness(1.08); }
.controls button.primary:disabled {
opacity: 0.4; cursor: wait;
filter: none;
}
.controls button.secondary {
background: transparent;
color: var(--green);
}
.controls button.secondary:hover {
background: var(--code-bg);
}
.controls button.secondary:disabled {
opacity: 0.35; cursor: default;
}
.controls .status {
color: var(--muted);
font-size: 0.8em;
margin-left: auto;
}
.controls .status.busy { color: var(--busy); }
.controls .status.warn { color: var(--busy); }
.controls .status.err { color: var(--err); }
.controls .status.ok { color: var(--green); }
/* ─── Panes ─────────────────────────────────────────────────────── */
.panes {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1px;
background: var(--rule);
height: calc(100vh - 260px);
min-height: 360px;
}
.pane {
background: var(--pane-bg);
padding: 0.5rem 0.75rem 0.75rem;
overflow: hidden;
display: flex;
flex-direction: column;
}
.pane h2 {
margin: 0 0 0.4rem;
font-size: 0.7rem;
font-weight: 500;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.1em;
}
#editor {
flex: 1;
overflow: hidden;
border-radius: 2px;
}
.cm-editor { height: 100%; font-size: 13px; }
.cm-editor.cm-focused { outline: none; }
#output {
flex: 1;
white-space: pre;
overflow: auto;
background: var(--code-bg);
border-radius: 2px;
padding: 0.6rem 0.8rem;
font-size: 13px;
line-height: 1.35;
display: grid;
gap: 0.6rem;
align-content: start;
}
/* When 3 tier blocks render (All three mode), lay them out as 3 columns
* for race-style comparison. With fewer, they stack as a single column. */
#output:has(.tier-block:nth-child(3)) {
grid-template-columns: 1fr 1fr 1fr;
}
#output .tier-block { margin-bottom: 0; }
#output .tier-block:last-child { margin-bottom: 0; }
#output .tier-block h3 {
margin: 0 0 0.25rem;
font-size: 0.7rem;
color: var(--green);
text-transform: uppercase;
letter-spacing: 0.1em;
font-weight: 600;
}
#output .tier-block .time {
color: var(--muted);
font-size: 0.65rem;
font-weight: 400;
letter-spacing: 0;
text-transform: none;
}
#output .tier-block pre {
margin: 0;
white-space: pre;
font-family: var(--mono);
}
#output .err {
color: var(--err);
}
/* ─── Footer ────────────────────────────────────────────────────── */
footer {
padding: 0.7rem 1.5rem;
border-top: 1px solid var(--rule);
color: var(--muted);
font-size: 0.75rem;
}
footer code {
background: var(--code-bg);
padding: 0 0.2em;
border-radius: 2px;
}
footer a {
color: var(--green);
text-decoration: none;
}
footer a:hover { text-decoration: underline; }
footer strong { color: var(--fg); }