Mockup: the Connections page, level-up pass
docs/mockups/connections.html, self-contained, beside tasks.html. A "What's answering" summary with a quiet Prefer control; one row per connection with a provider monogram, the state in words and a dot, the provider's own headroom (or "unknown"), the roles it serves with the living mark, and today's tokens; quiet actions on hover or behind ⋯ on touch. "Add a connection" opens a chooser (Claude, Codex, greyed local models, Mistral and TensorX), then the three-step Codex or Claude card with a loading line, waiting line, flourish and the new row sliding in. Five states (empty, today, all limited, connecting, signed out), light and dark, 1280 and 390, reduced motion. ?add= deep-links a flow stage.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 file changed,
+771
−0
docs/mockups/connections.html+771 −0
CI failed — run details
diff --git a/docs/mockups/connections.html b/docs/mockups/connections.html| new file mode 100644 |
| index 00000000..a843cec5 |
| --- /dev/null |
| +++ b/docs/mockups/connections.html |
| @@ -0,0 +1,771 @@ |
| +<!DOCTYPE html> |
| +<html lang="en" data-theme="system" data-motion="full"> |
| +<head> |
| +<meta charset="utf-8"> |
| +<meta name="viewport" content="width=device-width, initial-scale=1"> |
| +<title>Equipo: Connections</title> |
| +<style> |
| +/* ── Theme tokens, the same set tasks.html copies from the app ──── */ |
| +:root { |
| + color-scheme: light dark; |
| + --rst-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; |
| + --rst-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; |
| + --rst-radius: 6px; --rst-radius-sm: 4px; --rst-radius-pill: 999px; |
| + --rst-bg: light-dark(#fbfbfc, #0c0d0f); |
| + --rst-surface: light-dark(#ffffff, #141518); |
| + --rst-surface-2: light-dark(#f3f3f5, #18191d); |
| + --rst-line: light-dark(#e6e6ea, #26282e); |
| + --rst-line-strong: light-dark(#868691, #71737c); |
| + --rst-text: light-dark(#18181b, #ededf0); |
| + --rst-text-muted: light-dark(#52525c, #a1a1aa); |
| + --rst-text-faint: light-dark(#6b6b75, #8c8c96); |
| + --rst-accent: light-dark(#1f56d6, #7aa2ff); |
| + --rst-accent-soft: light-dark(#ecf1ff, #16234a); |
| + --rst-on-accent-fill: #ffffff; |
| + --rst-accent-fill: light-dark(#2257df, #2f61e8); |
| + --rst-accent-fill-hover: light-dark(#1d4dc8, #2956d0); |
| + --rst-accent-fill-edge: light-dark(#153ca0, #1f43a6); |
| + --rst-tone-neutral-fg: light-dark(#374151, #c3c9d1); |
| + --rst-tone-neutral-bg: light-dark(#eef0f2, #262c34); |
| + --rst-tone-positive-fg: light-dark(#166534, #6ee7a8); |
| + --rst-tone-positive-bg: light-dark(#dcfce7, #10281c); |
| + --rst-tone-warning-fg: light-dark(#854d0e, #f0c46a); |
| + --rst-tone-warning-bg: light-dark(#fef3c7, #2c2110); |
| + --rst-tone-negative-fg: light-dark(#b91c1c, #f79aa0); |
| + --rst-tone-negative-bg: light-dark(#fee2e2, #331819); |
| + --rst-shadow-lift: 0 1px 2px light-dark(rgba(16, 24, 40, .06), rgba(0, 0, 0, .5)); |
| + --rst-shadow-pop: 0 8px 24px light-dark(rgba(16, 24, 40, .12), rgba(0, 0, 0, .6)), 0 1px 2px light-dark(rgba(16, 24, 40, .08), rgba(0, 0, 0, .5)); |
| + --rst-control-face: light-dark(#ffffff, #141518); |
| + --rst-control-face-hover: light-dark(#f7f8fa, #1b1d22); |
| + --rst-control-border: light-dark(#d0d4dc, #343843); |
| + --rst-control-border-hover: light-dark(#8a8a95, #71737c); |
| + --rst-tint-hover: light-dark(color-mix(in srgb, var(--rst-accent) 4.5%, var(--rst-surface)), color-mix(in srgb, var(--rst-accent) 10%, var(--rst-bg))); |
| + --rst-tint-press: light-dark(color-mix(in srgb, var(--rst-accent) 8.5%, var(--rst-surface)), color-mix(in srgb, var(--rst-accent) 19%, #000000)); |
| + --rst-focus-edge: var(--rst-accent); |
| + --rst-nav-current-bg: light-dark(#ffffff, #141518); |
| + --rst-nav-current-fg: light-dark(#18181b, #ededf0); |
| + --rst-title-size: 1.25rem; --rst-title-weight: 600; --rst-title-track: -0.012em; |
| + --rst-fs-lg: 1.0625rem; --rst-fs-base: 0.875rem; --rst-fs-sm: 0.78125rem; --rst-fs-xs: 0.71875rem; |
| + --rst-sp-1: 0.25rem; --rst-sp-2: 0.5rem; --rst-sp-3: 0.75rem; --rst-sp-4: 1rem; --rst-sp-5: 1.5rem; --rst-sp-6: 2.5rem; |
| + --equipo-ease: cubic-bezier(.22, .8, .24, 1); |
| +} |
| +:root[data-theme="light"] { color-scheme: light; } |
| +:root[data-theme="dark"] { color-scheme: dark; } |
| + |
| +/* ── The mockup page around the frames ───────────────────────────── */ |
| +*, *::before, *::after { box-sizing: border-box; } |
| +html { background: var(--rst-bg); } |
| +body { margin: 0; color: var(--rst-text); font: var(--rst-fs-base)/1.5 var(--rst-font); -webkit-font-smoothing: antialiased; } |
| +a { color: var(--rst-accent); } |
| +button { cursor: pointer; } |
| +:focus-visible { outline: 2px solid var(--rst-focus-edge); outline-offset: 2px; } |
| +.page { padding: var(--rst-sp-5) clamp(var(--rst-sp-3), 3vw, var(--rst-sp-6)) var(--rst-sp-6); } |
| +.intro { max-width: 52rem; margin-block-end: var(--rst-sp-4); } |
| +.intro h1 { font-size: var(--rst-title-size); font-weight: var(--rst-title-weight); letter-spacing: var(--rst-title-track); margin: 0 0 var(--rst-sp-2); } |
| +.intro p { margin: 0; color: var(--rst-text-muted); max-width: 70ch; } |
| +.controls { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-2) var(--rst-sp-5); margin: 0 calc(-1 * clamp(var(--rst-sp-3), 3vw, var(--rst-sp-6))) var(--rst-sp-5); padding: var(--rst-sp-2) clamp(var(--rst-sp-3), 3vw, var(--rst-sp-6)); background: color-mix(in srgb, var(--rst-bg) 88%, transparent); backdrop-filter: blur(8px); border-block-end: 1px solid var(--rst-line); } |
| +.control { display: flex; align-items: center; gap: var(--rst-sp-2); font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--rst-control-border); border-radius: var(--rst-radius); background: var(--rst-control-face); } |
| +.seg button { font: inherit; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); background: transparent; border: 0; border-radius: var(--rst-radius-sm); padding: .25rem .65rem; white-space: nowrap; } |
| +.seg button[aria-pressed="true"] { background: var(--rst-accent-soft); color: var(--rst-accent); } |
| +.band { margin-block-start: var(--rst-sp-6); } |
| +.band > h2 { font-size: var(--rst-fs-base); font-weight: 600; margin: 0 0 var(--rst-sp-1); } |
| +.band > p { margin: 0 0 var(--rst-sp-4); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); max-width: 70ch; } |
| +.stage-wrap { position: relative; } |
| +.stage { inline-size: 1280px; block-size: 860px; transform-origin: 0 0; border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); overflow: hidden; box-shadow: var(--rst-shadow-lift); background: var(--rst-bg); } |
| +.phones { display: flex; flex-wrap: wrap; gap: var(--rst-sp-5); align-items: flex-start; } |
| +.phone { inline-size: 390px; block-size: 800px; flex: none; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--rst-line); border-radius: 2.25rem; box-shadow: var(--rst-shadow-pop); background: var(--rst-bg); |
| + --rst-fs-lg: 1.1875rem; --rst-fs-base: 1rem; --rst-fs-sm: 0.875rem; --rst-fs-xs: 0.8125rem; font-size: var(--rst-fs-base); } |
| +.phone > .status { flex: none; display: flex; justify-content: space-between; padding: var(--rst-sp-3) var(--rst-sp-5) 0 1.75rem; background: var(--rst-surface); font-size: var(--rst-fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; } |
| +.phone > header { position: relative; flex: none; display: flex; align-items: center; min-block-size: 2.75rem; padding: var(--rst-sp-2) var(--rst-sp-3); background: var(--rst-surface); border-block-end: 1px solid var(--rst-line); } |
| +.phone > header .back { display: inline-flex; align-items: center; gap: 2px; color: var(--rst-accent); text-decoration: none; font-size: var(--rst-fs-sm); } |
| +.phone > header .back svg { inline-size: 1.1em; block-size: 1.1em; transform: rotate(90deg); } |
| +.phone > header .ptitle { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 600; font-size: var(--rst-fs-sm); white-space: nowrap; } |
| +.phone > .app { flex: 1; min-block-size: 0; overflow-y: auto; container: app / inline-size; } |
| +.phone .main { padding: var(--rst-sp-4) var(--rst-sp-3) var(--rst-sp-6); } |
| +.caption { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); margin: var(--rst-sp-2) 0 0; max-inline-size: 390px; } |
| + |
| +/* ── The shell: rail and main, as tasks.html draws them ──────────── */ |
| +.shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); block-size: 100%; } |
| +.rail { padding: var(--rst-sp-4); border-inline-end: 1px solid var(--rst-line); background: var(--rst-bg); overflow-y: auto; font-size: var(--rst-fs-sm); } |
| +.brand { display: flex; align-items: center; gap: var(--rst-sp-2); font-weight: 600; margin: 0 0.55rem var(--rst-sp-4); color: var(--rst-text); text-decoration: none; } |
| +.brand .icon { inline-size: 1em; block-size: 1em; } |
| +.rail nav a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--rst-sp-2); padding: 0.35rem 0.55rem; border-radius: var(--rst-radius); color: var(--rst-text-muted); text-decoration: none; cursor: pointer; } |
| +.rail nav a .icon { inline-size: 1em; block-size: 1em; } |
| +.rail nav a > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rst-text); } |
| +.rail nav a:hover { background: var(--rst-tint-hover); } |
| +.rail nav a[aria-current="page"] { background: var(--rst-nav-current-bg); color: var(--rst-nav-current-fg); box-shadow: 0 0 0 1px var(--rst-line), var(--rst-shadow-lift); } |
| +.rail .count { font-size: var(--rst-fs-xs); color: var(--rst-text-muted); font-variant-numeric: tabular-nums; } |
| +.rail .count[data-attention] { color: var(--rst-tone-warning-fg); font-weight: 600; } |
| +.rail .state { display: inline-flex; align-items: center; gap: .4em; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); white-space: nowrap; } |
| +.rail .state[data-idle] { color: var(--rst-text-faint); } |
| +.nav-group { color: var(--rst-text-muted); margin: var(--rst-sp-4) 0 var(--rst-sp-1); padding: 0 0.55rem; font-size: var(--rst-fs-xs); } |
| +.att-dot { display: inline-block; inline-size: .45rem; block-size: .45rem; border-radius: 50%; background: var(--rst-tone-warning-fg); } |
| +.main { padding: var(--rst-sp-5) var(--rst-sp-6); overflow-y: auto; container: app / inline-size; } |
| +.stage .main { block-size: 100%; } |
| +.main h1 { font-size: var(--rst-title-size); font-weight: var(--rst-title-weight); letter-spacing: var(--rst-title-track); margin: 0; } |
| +.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--rst-sp-2) var(--rst-sp-4); margin-block-end: var(--rst-sp-4); } |
| +.page-head p { margin: 0; color: var(--rst-text-muted); } |
| +.inner { max-inline-size: 58rem; } |
| + |
| +/* ── The living mark: Stardust, from tasks.html ──────────────────── */ |
| +.mark { position: relative; flex: none; display: inline-block; inline-size: 1em; block-size: 1em; vertical-align: -.12em; } |
| +.mark svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; filter: drop-shadow(0 0 .22em color-mix(in srgb, var(--rst-accent) 55%, transparent)); } |
| +.mark path { fill: var(--rst-accent); transform-box: fill-box; transform-origin: center; animation: equipo-star 4.2s ease-in-out infinite; } |
| +.mark circle { fill: var(--rst-on-accent-fill); transform-box: fill-box; transform-origin: center; animation: equipo-glint 2.1s ease-in-out infinite; } |
| +@keyframes equipo-star { 0% { transform: rotate(0) scale(.8); } 50% { transform: rotate(45deg) scale(1.05); } 100% { transform: rotate(90deg) scale(.8); } } |
| +@keyframes equipo-glint { 0%, 100% { transform: scale(.75); opacity: .65; } 50% { transform: scale(1.1); opacity: 1; } } |
| +.mark i { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; opacity: 0; } |
| +.mark [data-sat] { inset-block-start: auto; inset-inline-start: auto; inline-size: .44em; block-size: .44em; background: var(--rst-accent); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); transform: scale(0); animation: equipo-sat 2.7s ease-in-out .4s infinite; } |
| +.mark [data-sat="1"] { inset-block-start: -.32em; inset-inline-end: -.38em; } |
| +.mark [data-sat="2"] { inset-block-end: -.22em; inset-inline-start: -.36em; inline-size: .34em; block-size: .34em; background: color-mix(in srgb, var(--rst-accent) 45%, var(--rst-on-accent-fill)); animation-duration: 3.7s; animation-delay: 1.5s; } |
| +.mark [data-sat="3"] { inset-block-start: -.45em; inset-inline-start: -.05em; inline-size: .3em; block-size: .3em; animation-duration: 4.3s; animation-delay: 2.6s; } |
| +@keyframes equipo-sat { 0%, 24%, 100% { opacity: 0; transform: scale(0) rotate(0); } 10% { opacity: 1; transform: scale(1) rotate(45deg); } } |
| +.mark [data-mote] { inline-size: .26em; block-size: .26em; margin: -.13em; border-radius: 50%; background: var(--rst-accent); box-shadow: 0 0 .25em color-mix(in srgb, var(--rst-accent) 70%, transparent); } |
| +.mark [data-mote="light"] { background: color-mix(in srgb, var(--rst-accent) 40%, var(--rst-on-accent-fill)); } |
| +.mark[data-flourish] svg { animation: equipo-half .7s var(--equipo-ease); } |
| +.mark[data-flourish] [data-mote] { animation: equipo-dust 1.3s ease-out var(--d) both; } |
| +@keyframes equipo-half { 50% { transform: rotate(90deg) scale(1.28); } 100% { transform: rotate(180deg); } } |
| +@keyframes equipo-dust { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .12)) scale(1.2); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } } |
| +.mark[data-size="s"] { font-size: .85em; } |
| +.mark[data-size="s"] [data-mote] { display: none; } |
| +.mark[data-size="l"] { font-size: 1.6em; } |
| + |
| +/* ── Provider monograms: a tinted tile with a two-letter glyph ───── */ |
| +.pmark { display: inline-grid; place-items: center; flex: none; inline-size: 2.25rem; block-size: 2.25rem; border-radius: calc(1.5 * var(--rst-radius)); font-weight: 650; font-size: .9rem; letter-spacing: -.02em; color: light-dark(oklch(0.4 0.11 var(--h)), oklch(0.9 0.08 var(--h))); background: light-dark(oklch(0.955 0.03 var(--h)), oklch(0.29 0.05 var(--h))); box-shadow: inset 0 0 0 1px light-dark(oklch(0.9 0.05 var(--h)), oklch(0.38 0.07 var(--h))); } |
| +.pmark[data-size="s"] { inline-size: 1.5rem; block-size: 1.5rem; font-size: .65rem; border-radius: var(--rst-radius-sm); } |
| +.pmark[data-size="l"] { inline-size: 3rem; block-size: 3rem; font-size: 1.15rem; border-radius: calc(2 * var(--rst-radius)); } |
| +.pmark .icon { inline-size: 1.1em; block-size: 1.1em; } |
| +.pmark[data-provider="claude"] { --h: 42; } |
| +.pmark[data-provider="codex"] { --h: 170; } |
| +.pmark[data-provider="local"] { --h: 250; } |
| +.pmark[data-provider="mistral"] { --h: 24; } |
| +.pmark[data-provider="tensorx"] { --h: 300; } |
| +.pmark[data-dim] { filter: saturate(.2); opacity: .6; } |
| +.row[data-state="signed_out"] .pmark, .row[data-state="sign_in_again"] .pmark { filter: saturate(.35); opacity: .75; } |
| + |
| +/* ── What's answering: the summary at the top ─────────────────────── */ |
| +.answering { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--rst-sp-3); row-gap: var(--rst-sp-2); padding: var(--rst-sp-4) var(--rst-sp-4); margin: 0 0 var(--rst-sp-5); border: 1px solid color-mix(in srgb, var(--rst-accent) 22%, var(--rst-line)); border-radius: calc(2 * var(--rst-radius)); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 40%); } |
| +.answering[data-tone="attention"] { border-color: color-mix(in srgb, var(--rst-tone-warning-fg) 28%, var(--rst-line)); background: color-mix(in srgb, var(--rst-tone-warning-bg) 42%, var(--rst-surface)); } |
| +.answering[data-tone="rest"] { border-color: var(--rst-line); background: var(--rst-surface); } |
| +.answering > .mark, .answering > .lead-ic { grid-row: 1 / span 3; margin-block-start: .2rem; } |
| +.answering .lead-ic { inline-size: 1.25rem; block-size: 1.25rem; color: var(--rst-tone-warning-fg); } |
| +.answering .lead { margin: 0; font-size: var(--rst-fs-lg); line-height: 1.4; color: var(--rst-text); } |
| +.answering .lead b { font-weight: 600; } |
| +.answering .sub { margin: 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +.answering .sub a { color: inherit; text-decoration: underline; text-underline-offset: 2px; } |
| +.prefer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-2) var(--rst-sp-3); margin-block-start: var(--rst-sp-1); font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +.prefer .seg { background: color-mix(in srgb, var(--rst-surface) 70%, transparent); } |
| +.prefer .hint { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| +.answering[data-tone="rest"] .prefer { display: none; } |
| + |
| +/* ── The rows: one connection each ────────────────────────────────── */ |
| +.group { margin: 0 0 var(--rst-sp-5); } |
| +.group > h2 { display: flex; align-items: baseline; gap: var(--rst-sp-2); font-size: var(--rst-fs-base); font-weight: 600; margin: 0 0 var(--rst-sp-2); } |
| +.group > h2 .n { color: var(--rst-text-muted); font-weight: 400; font-variant-numeric: tabular-nums; } |
| +.group > h2 .hint { color: var(--rst-text-muted); font-weight: 400; font-size: var(--rst-fs-sm); margin-inline-start: auto; } |
| +.list { border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); overflow: hidden; } |
| +.row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--rst-sp-4); align-items: start; padding: var(--rst-sp-4); transition: background .15s; } |
| +.row + .row { border-block-start: 1px solid var(--rst-line); } |
| +.row:hover { background: var(--rst-tint-hover); } |
| +.row[data-new] { animation: row-in .55s var(--equipo-ease) both; } |
| +@keyframes row-in { from { opacity: 0; transform: translateY(-.5rem); } } |
| +.row[data-state="signed_out"] .name, .row[data-state="signed_out"] .acct { color: var(--rst-text-muted); } |
| +.row .body { min-width: 0; display: grid; gap: .45rem; } |
| +.row .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem var(--rst-sp-3); min-width: 0; } |
| +.row .name { font-weight: 600; font-size: var(--rst-fs-base); } |
| +.row .acct { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| +.row .pref { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); display: inline-flex; align-items: center; gap: .3em; } |
| +.row .pref .icon { inline-size: .9em; block-size: .9em; } |
| +.row .facts { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem var(--rst-sp-4); font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +.row .roles { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem var(--rst-sp-2); font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| +.row .roles .lbl { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| +.row .roles .none { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| +.chip { display: inline-flex; align-items: center; gap: .4em; padding: .1rem .55rem .1rem .45rem; border-radius: var(--rst-radius-pill); border: 1px solid var(--rst-line); background: var(--rst-surface-2); color: var(--rst-text); font-size: var(--rst-fs-xs); white-space: nowrap; } |
| +.chip[data-live] { border-color: color-mix(in srgb, var(--rst-accent) 35%, var(--rst-line)); background: var(--rst-accent-soft); color: var(--rst-accent); } |
| +.chip .icon { inline-size: .95em; block-size: .95em; color: var(--rst-text-faint); } |
| +.row .side { display: grid; justify-items: end; gap: .4rem; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); white-space: nowrap; } |
| +.row .side .top { display: inline-flex; align-items: center; gap: var(--rst-sp-2); min-block-size: 1.5rem; } |
| +.row .usage { font-variant-numeric: tabular-nums; } |
| +.row .usage b { color: var(--rst-text); font-weight: 500; } |
| +.row .usage .cost { color: var(--rst-text-muted); } |
| + |
| +/* State in words, with a small dot */ |
| +.st { display: inline-flex; align-items: center; gap: .45em; font-weight: 500; color: var(--rst-text); white-space: nowrap; } |
| +.st::before { content: ""; inline-size: .5rem; block-size: .5rem; border-radius: 50%; background: var(--rst-text-faint); flex: none; } |
| +.st[data-s="healthy"]::before { background: var(--rst-tone-positive-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rst-tone-positive-fg) 18%, transparent); } |
| +.st[data-s="limited"]::before { background: var(--rst-tone-warning-fg); } |
| +.st[data-s="sign_in_again"]::before { background: var(--rst-tone-negative-fg); } |
| +.st[data-s="signed_out"] { color: var(--rst-text-muted); font-weight: 400; } |
| +.st[data-s="signed_out"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rst-line-strong); } |
| +.st[data-s="connecting"]::before { background: var(--rst-accent); animation: st-pulse 1.4s ease-in-out infinite; } |
| +@keyframes st-pulse { 50% { opacity: .35; transform: scale(.7); } } |
| + |
| +/* Headroom: thin meters, only when the provider reports one */ |
| +.headroom { display: flex; flex-wrap: wrap; gap: .35rem var(--rst-sp-4); align-items: center; } |
| +.meter { display: inline-flex; align-items: center; gap: .5em; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); white-space: nowrap; } |
| +.meter .bar { display: inline-block; inline-size: 5.5rem; block-size: .35rem; border-radius: var(--rst-radius-pill); overflow: hidden; background: var(--rst-tone-neutral-bg); } |
| +.meter .bar i { display: block; block-size: 100%; border-radius: inherit; background: var(--rst-accent); transition: inline-size .6s var(--equipo-ease); } |
| +.meter[data-level="high"] .bar i { background: var(--rst-tone-warning-fg); } |
| +.meter[data-level="full"] .bar i { background: var(--rst-tone-warning-fg); } |
| +.meter .n { font-variant-numeric: tabular-nums; color: var(--rst-text); } |
| +.unknown { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| + |
| +/* Quiet actions: hover-revealed links, ⋯ on touch */ |
| +.row .quiet { display: inline-flex; gap: var(--rst-sp-3); opacity: 0; transition: opacity .15s; } |
| +.row:hover .quiet, .row:focus-within .quiet { opacity: 1; } |
| +.row .quiet a, .row .quiet button { font: inherit; font-size: var(--rst-fs-xs); color: var(--rst-text-muted); background: none; border: 0; padding: 0; text-decoration: none; cursor: pointer; } |
| +.row .quiet a:hover, .row .quiet button:hover { color: var(--rst-text); text-decoration: underline; text-underline-offset: 2px; } |
| +.row .quiet .danger:hover { color: var(--rst-tone-negative-fg); } |
| +.row .always a { font-size: var(--rst-fs-sm); color: var(--rst-accent); text-decoration: none; cursor: pointer; } |
| +.row .always a:hover { text-decoration: underline; text-underline-offset: 2px; } |
| +.menu { position: relative; display: none; } |
| +.menu > summary { list-style: none; display: inline-grid; place-items: center; inline-size: 1.75rem; block-size: 1.75rem; border-radius: var(--rst-radius-sm); color: var(--rst-text-muted); cursor: pointer; } |
| +.menu > summary::-webkit-details-marker { display: none; } |
| +.menu > summary:hover { background: var(--rst-tint-press); color: var(--rst-text); } |
| +.menu > summary .icon { inline-size: 1em; block-size: 1em; } |
| +.menu > div { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 2px); z-index: 3; min-inline-size: 13rem; padding: var(--rst-sp-1); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: var(--rst-surface); box-shadow: var(--rst-shadow-pop); font-size: var(--rst-fs-sm); } |
| +.menu > div button { display: block; inline-size: 100%; text-align: start; font: inherit; color: var(--rst-text); background: none; border: 0; padding: .4rem .6rem; border-radius: var(--rst-radius-sm); cursor: pointer; } |
| +.menu > div button:hover { background: var(--rst-tint-hover); } |
| +.menu > div .danger { color: var(--rst-tone-negative-fg); } |
| +@media (hover: none) { .row .quiet { display: none; } .menu { display: block; } } |
| +.phone .row .quiet { display: none; } |
| +.phone .menu { display: block; } |
| + |
| +/* ── Buttons ──────────────────────────────────────────────────────── */ |
| +.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-block-size: 2rem; padding: .3rem .85rem; font: inherit; font-size: var(--rst-fs-sm); font-weight: 500; border-radius: var(--rst-radius-sm); border: 1px solid var(--rst-control-border); background: var(--rst-control-face); color: var(--rst-text); cursor: pointer; text-decoration: none; white-space: nowrap; } |
| +.btn:hover { background: var(--rst-control-face-hover); border-color: var(--rst-control-border-hover); } |
| +.btn[data-primary] { background: var(--rst-accent-fill); border-color: var(--rst-accent-fill-edge); color: var(--rst-on-accent-fill); } |
| +.btn[data-primary]:hover { background: var(--rst-accent-fill-hover); } |
| +.btn[data-quiet] { border-color: transparent; background: transparent; color: var(--rst-text-muted); } |
| +.btn[data-quiet]:hover { background: var(--rst-tint-hover); color: var(--rst-text); } |
| +.btn .icon { inline-size: 1em; block-size: 1em; } |
| +.btn[data-copied] { color: var(--rst-tone-positive-fg); border-color: color-mix(in srgb, var(--rst-tone-positive-fg) 40%, var(--rst-control-border)); } |
| + |
| +/* ── Add a connection: the chooser and the connecting card ───────── */ |
| +.add-area { margin-block-start: var(--rst-sp-3); } |
| +.add-foot { display: flex; align-items: center; gap: var(--rst-sp-3); color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| +.chooser { border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); box-shadow: var(--rst-shadow-lift); max-inline-size: 34rem; animation: pop-in .25s var(--equipo-ease) both; overflow: hidden; } |
| +@keyframes pop-in { from { opacity: 0; transform: translateY(-.3rem) scale(.985); } } |
| +.chooser header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--rst-sp-3); padding: var(--rst-sp-3) var(--rst-sp-4) var(--rst-sp-2); } |
| +.chooser header h3 { margin: 0; font-size: var(--rst-fs-base); font-weight: 600; } |
| +.chooser header p { margin: 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +.chooser .opts { display: grid; } |
| +.chooser .opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--rst-sp-3); inline-size: 100%; padding: var(--rst-sp-3) var(--rst-sp-4); font: inherit; text-align: start; color: var(--rst-text); background: none; border: 0; border-block-start: 1px solid var(--rst-line); cursor: pointer; } |
| +.chooser .opt:hover:not([disabled]) { background: var(--rst-tint-hover); } |
| +.chooser .opt .t { font-weight: 500; } |
| +.chooser .opt .d { display: block; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +.chooser .opt .go { inline-size: 1em; block-size: 1em; color: var(--rst-text-faint); transform: rotate(-90deg); } |
| +.chooser .opt[disabled] { cursor: default; color: var(--rst-text-muted); } |
| +.chooser .opt[disabled] .t { color: var(--rst-text-muted); font-weight: 500; } |
| +.chooser .soon { font-size: var(--rst-fs-xs); color: var(--rst-text-faint); border: 1px solid var(--rst-line); border-radius: var(--rst-radius-pill); padding: .05rem .5rem; white-space: nowrap; } |
| +.chooser .sep { padding: var(--rst-sp-2) var(--rst-sp-4) var(--rst-sp-1); border-block-start: 1px solid var(--rst-line); font-size: var(--rst-fs-xs); color: var(--rst-text-faint); background: var(--rst-surface-2); } |
| +.chooser .sep + .opt { border-block-start: 0; } |
| + |
| +.connect { position: relative; border: 1px solid color-mix(in srgb, var(--rst-accent) 22%, var(--rst-line)); border-radius: calc(2 * var(--rst-radius)); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 25%); padding: var(--rst-sp-4) var(--rst-sp-5); max-inline-size: 34rem; animation: pop-in .3s var(--equipo-ease) both; overflow: hidden; } |
| +.connect .c-head { display: flex; align-items: center; gap: var(--rst-sp-3); margin-block-end: var(--rst-sp-3); } |
| +.connect .c-head h3 { margin: 0; font-size: var(--rst-fs-base); font-weight: 600; } |
| +.connect .c-head p { margin: 0; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +.connect .loading { display: grid; justify-items: center; gap: var(--rst-sp-3); padding: var(--rst-sp-5) 0 var(--rst-sp-4); text-align: center; } |
| +.connect .phrase { min-block-size: 1.5em; color: var(--rst-text-muted); font-size: var(--rst-fs-base); animation: word-in .4s var(--equipo-ease) both; } |
| +@keyframes word-in { from { opacity: 0; transform: translateY(.3em); filter: blur(1.5px); } } |
| +.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--rst-sp-3); counter-reset: s; } |
| +.steps li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: var(--rst-sp-3); align-items: start; counter-increment: s; } |
| +.steps li::before { content: counter(s); display: inline-grid; place-items: center; inline-size: 1.5rem; block-size: 1.5rem; border-radius: 50%; font-size: var(--rst-fs-xs); font-weight: 600; color: var(--rst-accent); background: var(--rst-accent-soft); margin-block-start: .15rem; } |
| +.steps li > div { min-width: 0; display: grid; gap: .4rem; } |
| +.steps li p { margin: 0; } |
| +.steps li[data-done]::before { content: "✓"; color: var(--rst-tone-positive-fg); background: var(--rst-tone-positive-bg); } |
| +.code { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-3); } |
| +.code .val { font-family: var(--rst-mono); font-size: 1.6rem; font-weight: 600; letter-spacing: .08em; padding: .2rem .7rem; border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: var(--rst-surface); color: var(--rst-text); user-select: all; } |
| +.code .cmd { font-family: var(--rst-mono); font-size: var(--rst-fs-sm); padding: .35rem .7rem; border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: var(--rst-surface); color: var(--rst-text); user-select: all; overflow-wrap: anywhere; } |
| +.code .once { flex-basis: 100%; color: var(--rst-text-faint); font-size: var(--rst-fs-xs); margin: 0; } |
| +.waiting { display: flex; align-items: center; gap: .55em; margin-block-start: var(--rst-sp-4); color: var(--rst-text); font-size: var(--rst-fs-sm); } |
| +.waiting .dots i { display: inline-block; inline-size: .3em; block-size: .3em; margin-inline-start: .15em; border-radius: 50%; background: var(--rst-text-muted); animation: dot-wave 1.4s ease-in-out infinite; } |
| +.waiting .dots i:nth-child(2) { animation-delay: .18s; } .waiting .dots i:nth-child(3) { animation-delay: .36s; } |
| +@keyframes dot-wave { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-.15em); } } |
| +.small { margin: var(--rst-sp-3) 0 0; color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| +.c-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--rst-sp-3); margin-block-start: var(--rst-sp-4); } |
| +.success { display: grid; justify-items: center; gap: var(--rst-sp-2); padding: var(--rst-sp-4) 0; text-align: center; animation: word-in .4s var(--equipo-ease) both; } |
| +.success .burst { position: relative; inline-size: 2.5rem; block-size: 2.5rem; } |
| +.success .burst .mark { font-size: 2.5rem; } |
| +.success .burst i[data-spark] { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; inline-size: .35rem; block-size: .35rem; margin: -.175rem; border-radius: 50%; background: var(--rst-accent); opacity: 0; animation: burst 1.1s ease-out var(--d) both; } |
| +.success .burst i[data-spark="warm"] { background: var(--rst-tone-warning-fg); } |
| +.success .burst i[data-spark="pale"] { background: color-mix(in srgb, var(--rst-accent) 40%, var(--rst-on-accent-fill)); } |
| +@keyframes burst { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 12% { opacity: 1; transform: translate(calc(var(--dx) * .2), calc(var(--dy) * .2)) scale(1.3); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } } |
| +.success p { margin: 0; } |
| +.success .big { font-size: var(--rst-fs-lg); font-weight: 600; } |
| +.success .acct { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| +.connect[data-leaving] { animation: leave .4s var(--equipo-ease) both; } |
| +@keyframes leave { to { opacity: 0; transform: translateY(-.4rem) scale(.985); } } |
| + |
| +/* ── Empty: the first run ──────────────────────────────────────────── */ |
| +.empty { display: grid; gap: var(--rst-sp-3); padding: var(--rst-sp-6) var(--rst-sp-5); border: 1px dashed var(--rst-line-strong); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); text-align: center; justify-items: center; max-inline-size: 36rem; margin-inline: auto; } |
| +.empty .pair { display: inline-flex; gap: .5rem; } |
| +.empty h2 { margin: 0; font-size: var(--rst-fs-lg); font-weight: 600; } |
| +.empty p { margin: 0; color: var(--rst-text-muted); max-inline-size: 42ch; } |
| +.empty .fine { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); } |
| +.empty .add-area { inline-size: 100%; display: grid; justify-items: center; } |
| +.empty .chooser, .empty .connect { text-align: start; inline-size: 100%; } |
| + |
| +/* ── Phone-width stacking, by container, so both frames agree ────── */ |
| +@container app (max-width: 600px) { |
| + .main { padding: var(--rst-sp-4) var(--rst-sp-3) var(--rst-sp-6); } |
| + .inner { max-inline-size: none; } |
| + .page-head { margin-block-end: var(--rst-sp-3); } |
| + .answering { padding: var(--rst-sp-3); } |
| + .answering .lead { font-size: var(--rst-fs-base); } |
| + .row { grid-template-columns: auto minmax(0, 1fr); row-gap: var(--rst-sp-2); padding: var(--rst-sp-3); } |
| + .row .side { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; justify-items: start; align-items: center; } |
| + .row .side .usage { grid-column: 1; grid-row: 1; } |
| + .row .side .top { grid-column: 2; grid-row: 1; justify-self: end; } |
| + .group > h2 { flex-wrap: wrap; } |
| + .group > h2 .hint { flex-basis: 100%; margin-inline-start: 0; } |
| + .row .acct { white-space: normal; } |
| + .meter .bar { inline-size: 4rem; } |
| + .chooser, .connect { max-inline-size: none; } |
| + .connect { padding: var(--rst-sp-4); } |
| + .code .val { font-size: 1.4rem; } |
| + .btn { min-block-size: 2.5rem; } |
| + .c-foot .btn, .add-area > .btn { inline-size: 100%; } |
| + .add-foot { flex-direction: column; align-items: stretch; } |
| + .empty { padding: var(--rst-sp-5) var(--rst-sp-3); } |
| +} |
| + |
| +/* ── Reduced motion: everything still, nothing missing ───────────── */ |
| +:root[data-motion="reduced"] * { animation: none !important; transition: none !important; } |
| +:root[data-motion="reduced"] .mark [data-sat="1"], :root[data-motion="reduced"] .mark [data-sat="2"] { opacity: .7; transform: scale(.8) rotate(45deg); } |
| +:root[data-motion="reduced"] .mark [data-mote], :root[data-motion="reduced"] [data-spark] { display: none; } |
| +:root[data-motion="reduced"] .mark circle { transform: scale(.9); opacity: 1; } |
| +:root[data-motion="reduced"] .waiting .dots { display: none; } |
| +@media (prefers-reduced-motion: reduce) { |
| + :root:not([data-motion="full"]) * { animation: none !important; transition: none !important; } |
| + :root:not([data-motion="full"]) .mark [data-sat="1"], :root:not([data-motion="full"]) .mark [data-sat="2"] { opacity: .7; transform: scale(.8) rotate(45deg); } |
| + :root:not([data-motion="full"]) .mark [data-mote], :root:not([data-motion="full"]) [data-spark] { display: none; } |
| + :root:not([data-motion="full"]) .waiting .dots { display: none; } |
| +} |
| +</style> |
| +</head> |
| +<body> |
| +<main class="page"> |
| + <section class="intro"> |
| + <h1>Connections</h1> |
| + <p>The page that says what is answering and lets you add an account in three steps. One row per connection with its state in words, the headroom the provider reports (nothing invented), the roles it is serving with the living mark, and today's use. "Add a connection" opens a small chooser, then a card that walks through the provider's own sign-in and finishes on its own. Copy is placeholder.</p> |
| + </section> |
| + |
| + <div class="controls"> |
| + <div class="control">State <span class="seg" data-control="scene"><button data-value="empty">Empty</button><button data-value="today">Today</button><button data-value="limited">All limited</button><button data-value="connecting">Connecting</button><button data-value="signedout">Signed out</button></span></div> |
| + <div class="control">Theme <span class="seg" data-control="theme"><button data-value="system">System</button><button data-value="light">Light</button><button data-value="dark">Dark</button></span></div> |
| + <div class="control">Motion <span class="seg" data-control="motion"><button data-value="full">Full</button><button data-value="reduced">Reduced</button></span></div> |
| + </div> |
| + |
| + <section class="band" style="margin-block-start: 0"> |
| + <h2>Desktop, 1280</h2> |
| + <p>Hover a row for its quiet actions. Press "Add a connection", pick Codex or Claude, and the card plays through: the loading line, the three steps, waiting, then the flourish and the new row sliding in. Copy on the code or the command is a real copy.</p> |
| + <div class="stage-wrap"><div class="stage" id="desk"></div></div> |
| + </section> |
| + |
| + <section class="band"> |
| + <h2>Phone, 390</h2> |
| + <p>The same screen on a phone. Quiet actions sit behind ⋯ on touch.</p> |
| + <div class="phones"> |
| + <div><div class="phone" id="phone"></div><p class="caption">The state chosen above.</p></div> |
| + </div> |
| + </section> |
| +</main> |
| + |
| +<script> |
| +(function () { |
| +"use strict"; |
| + |
| +/* ── Icons, the same strokes as the app's icon set ───────────────── */ |
| +const I = { |
| + users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><path d="M16 3.128a4 4 0 0 1 0 7.744"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><circle cx="9" cy="7" r="4"/>', |
| + "message-circle": '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>', |
| + inbox: '<path d="M22 12h-6l-2 3h-4l-2-3H2"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>', |
| + folder: '<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>', |
| + "check-circle": '<path d="M21.801 10A10 10 0 1 1 17 3.335"/><path d="m9 11 3 3L22 4"/>', |
| + notebook: '<path d="M2 6h4"/><path d="M2 10h4"/><path d="M2 14h4"/><path d="M2 18h4"/><rect width="16" height="20" x="4" y="2" rx="2"/><path d="M16 2v20"/>', |
| + plug: '<path d="M12 22v-5"/><path d="M9 8V2"/><path d="M15 8V2"/><path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"/>', |
| + "chevron-down": '<path d="m6 9 6 6 6-6"/>', |
| + more: '<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>', |
| + star: '<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>', |
| + copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>', |
| + external: '<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>', |
| + alert: '<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>', |
| + cpu: '<rect width="16" height="16" x="4" y="4" rx="2"/><rect width="6" height="6" x="9" y="9" rx="1"/><path d="M15 2v2"/><path d="M15 20v2"/><path d="M2 15h2"/><path d="M2 9h2"/><path d="M20 15h2"/><path d="M20 9h2"/><path d="M9 2v2"/><path d="M9 20v2"/>', |
| + check: '<path d="M20 6 9 17l-5-5"/>' |
| +}; |
| +function icon(name, cls) { return `<svg class="${cls || "icon"}" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" viewBox="0 0 24 24">${I[name]}</svg>`; } |
| +const STAR = '<svg viewBox="0 0 16 16" focusable="false"><path d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle cx="8" cy="8" r="1.7"/></svg><i data-sat="1"></i><i data-sat="2"></i><i data-sat="3"></i>'; |
| +function mark(size) { |
| + let motes = ""; |
| + if (size !== "s") for (let i = 0; i < 5; i++) { |
| + const dx = 1.7 + (i * 1.37) % 3, dy = (i * 0.53) % 1.4 - 0.7; |
| + motes += `<i data-mote="${i % 2 ? "light" : ""}" style="--dx:${dx.toFixed(2)}em;--dy:${dy.toFixed(2)}em;--d:${Math.round(i * 84)}ms"></i>`; |
| + } |
| + return `<span class="mark" aria-hidden="true"${size ? ` data-size="${size}"` : ""}>${STAR}${motes}</span>`; |
| +} |
| +function esc(s) { return String(s).replace(/[&<>"]/g, c => ({ "&": "&", "<": "<", ">": ">", '"': """ }[c])); } |
| + |
| +/* ── Providers ───────────────────────────────────────────────────── */ |
| +const PROVIDERS = { |
| + claude: { name: "Claude", glyph: "Cl", by: "Anthropic", d: "Your Claude subscription, through Claude Code." }, |
| + codex: { name: "Codex", glyph: "Cx", by: "OpenAI", d: "Your ChatGPT subscription, through Codex." }, |
| + local: { name: "Local models", glyph: null, iconName: "cpu", d: "Ollama, LM Studio or any OpenAI-compatible server." }, |
| + mistral: { name: "Mistral", glyph: "Mi", d: "A Mistral subscription or key." }, |
| + tensorx: { name: "TensorX", glyph: "Tx", d: "Open-weight models, metered." } |
| +}; |
| +function pmark(p, size, dim) { |
| + const pr = PROVIDERS[p]; |
| + return `<span class="pmark" data-provider="${p}"${size ? ` data-size="${size}"` : ""}${dim ? " data-dim" : ""} aria-hidden="true">${pr.glyph ? pr.glyph : icon(pr.iconName)}</span>`; |
| +} |
| +const ROLE = { coordinator: "Coordinator", engineering: "Engineering", review: "Review" }; |
| + |
| +/* ── Scenes: the five states Paul asked to see ────────────────────── */ |
| +function conn(o) { return Object.assign({ usage: "0", cost: null, roles: [], live: [], headroom: null, preferred: false }, o); } |
| +const SCENES = { |
| + empty: { conns: [], prefer: "auto", roles: {} }, |
| + today: { |
| + prefer: "auto", |
| + conns: [ |
| + conn({ id: "c1", provider: "claude", label: "paul@tito.io", state: "limited", resets: "Tue 21:00 UTC", headroom: { windows: [{ name: "Used", used: 100, resets: "resets Tue 21:00 UTC" }] }, usage: "412k" }), |
| + conn({ id: "c2", provider: "codex", label: "paul@tito.io", state: "healthy", plan: "Pro", headroom: { windows: [{ name: "5 h window", used: 38, resets: "resets in 2 h 10 m" }, { name: "Week", used: 61, resets: "resets Thu" }] }, roles: ["coordinator", "engineering", "review"], live: ["coordinator", "engineering"], usage: "1.2M" }) |
| + ] |
| + }, |
| + limited: { |
| + prefer: "auto", |
| + conns: [ |
| + conn({ id: "c1", provider: "claude", label: "paul@tito.io", state: "limited", resets: "Tue 21:00 UTC", headroom: { windows: [{ name: "Used", used: 100, resets: "resets Tue 21:00 UTC" }] }, usage: "412k" }), |
| + conn({ id: "c2", provider: "codex", label: "paul@tito.io", state: "limited", resets: null, headroom: { windows: [{ name: "5 h window", used: 100, resets: "no reset time reported" }, { name: "Week", used: 74, resets: "resets Thu" }] }, usage: "1.9M" }) |
| + ] |
| + }, |
| + connecting: { |
| + prefer: "auto", addState: "codex", |
| + conns: [ |
| + conn({ id: "c1", provider: "claude", label: "paul@tito.io", state: "healthy", roles: ["coordinator", "engineering", "review"], live: ["coordinator"], usage: "96k" }) |
| + ] |
| + }, |
| + signedout: { |
| + prefer: "claude", |
| + conns: [ |
| + conn({ id: "c1", provider: "claude", label: "paul@tito.io", state: "healthy", preferred: true, headroom: { windows: [{ name: "Used", used: 23, resets: "resets Wed 09:00 UTC" }] }, roles: ["coordinator", "engineering", "review"], live: ["engineering"], usage: "640k" }), |
| + conn({ id: "c3", provider: "claude", label: "paul@keymail.dev", state: "sign_in_again", usage: "0" }), |
| + conn({ id: "c2", provider: "codex", label: "paul@tito.io", state: "signed_out", usage: "118k" }) |
| + ] |
| + } |
| +}; |
| +const SIGNED_OUT_ROW = conn({ id: "c2", provider: "codex", label: "paul@tito.io", state: "signed_out", usage: "118k" }); |
| + |
| +/* ── State ───────────────────────────────────────────────────────── */ |
| +const state = { scene: "today", prefer: "auto", add: "idle", provider: null, phraseAt: 0, openMenu: null, conns: [] }; |
| +let timers = []; |
| +function later(ms, fn) { timers.push(setTimeout(fn, ms)); } |
| +function clearTimers() { timers.forEach(clearTimeout); timers = []; } |
| +function still() { const r = document.documentElement; return r.dataset.motion === "reduced" || (r.dataset.motion !== "full" && matchMedia("(prefers-reduced-motion: reduce)").matches); } |
| + |
| +function loadScene(key) { |
| + clearTimers(); |
| + const sc = SCENES[key]; |
| + state.scene = key; |
| + state.conns = JSON.parse(JSON.stringify(sc.conns)); |
| + state.prefer = sc.prefer; |
| + state.add = sc.addState || "idle"; |
| + state.provider = sc.addState || null; |
| + state.openMenu = null; |
| + state.newId = null; |
| + render(); |
| +} |
| + |
| +/* ── Words ───────────────────────────────────────────────────────── */ |
| +function stateWords(c) { |
| + switch (c.state) { |
| + case "healthy": return "Ready"; |
| + case "limited": return c.resets ? `Limited until ${c.resets}` : "Limited, no reset time reported"; |
| + case "sign_in_again": return "Needs signing in again"; |
| + case "signed_out": return "Signed out"; |
| + case "connecting": return "Connecting"; |
| + } |
| +} |
| +function eligible() { return state.conns.filter(c => c.state === "healthy"); } |
| +function pname(c) { return PROVIDERS[c.provider].name; } |
| +function shortReset(c) { return c.resets ? c.resets.replace(" UTC", "") : null; } |
| + |
| +function answering() { |
| + if (state.conns.length === 0) return ""; |
| + const ok = eligible(); |
| + const claude = state.conns.find(c => c.provider === "claude" && c.state !== "signed_out"); |
| + const codex = state.conns.find(c => c.provider === "codex"); |
| + let tone = "", lead = "", sub = "", leadIcon = mark("l"); |
| + if (ok.length === 0) { |
| + tone = "attention"; leadIcon = icon("alert", "lead-ic"); |
| + const parts = state.conns.map(c => c.state === "limited" ? (c.resets ? `${pname(c)} resets ${shortReset(c)}` : `${pname(c)} reported no reset time, so Equipo checks again in 15 minutes`) : c.state === "signed_out" ? `${pname(c)} is signed out` : c.state === "sign_in_again" ? `${pname(c)} needs signing in again` : null).filter(Boolean); |
| + lead = `<b>Nothing can answer right now.</b> ${parts.join("; ")}.`; |
| + sub = `Your message in the conversation is kept, and the reply arrives when a connection comes back. <a href="#conversation">See the conversation</a>`; |
| + } else { |
| + const coord = ok.find(c => c.roles.includes("coordinator")) || ok[0]; |
| + const resting = state.conns.filter(c => c.state === "limited"); |
| + const connecting = state.add !== "idle" && state.add !== "choose" && state.add !== "success" ? PROVIDERS[state.provider].name : null; |
| + lead = `Your coordinator is on <b>${pname(coord)}</b>`; |
| + if (resting.length) lead += ` while ${resting.map(c => `${pname(c)} rests${c.resets ? ` until ${shortReset(c)}` : ""}`).join(" and ")}.`; |
| + else lead += "."; |
| + if (connecting) sub = `${connecting} is connecting. Once it is ready, Review can run on another model family.`; |
| + else if (codex && codex.state === "signed_out") sub = `Codex is signed out, so Review runs on Claude with fresh context until another family is connected.`; |
| + else if (resting.length) sub = `Engineering and Review are on ${pname(coord)} too. Everything moves back when ${resting.map(pname).join(" and ")} returns.`; |
| + else if (claude && claude.state === "sign_in_again") sub = `${claude.label} needs signing in again before Equipo can use it.`; |
| + else sub = `Engineering and Review are on ${pname(coord)} too.`; |
| + } |
| + const prefer = `<div class="prefer"><span>Prefer</span><span class="seg" role="group" aria-label="Preferred connection">${[["auto", "Automatic"], ["claude", "Claude"], ["codex", "Codex"]].map(([v, l]) => `<button type="button" data-prefer="${v}" aria-pressed="${state.prefer === v}">${l}</button>`).join("")}</span><span class="hint">${state.prefer === "auto" ? "Equipo picks by health and headroom." : `Used when it is ready. A preference never overrides health.`}</span></div>`; |
| + return `<section class="answering"${tone ? ` data-tone="${tone}"` : ""} aria-label="What is answering">${leadIcon}<p class="lead">${lead}</p><p class="sub">${sub}</p>${prefer}</section>`; |
| +} |
| + |
| +/* ── Rows ────────────────────────────────────────────────────────── */ |
| +function meterLevel(u) { return u >= 100 ? "full" : u >= 80 ? "high" : "ok"; } |
| +function headroom(c) { |
| + if (c.state === "signed_out" || c.state === "sign_in_again") return ""; |
| + if (!c.headroom || !c.headroom.windows || !c.headroom.windows.length) return `<span class="unknown">Headroom unknown, ${pname(c)} did not report one</span>`; |
| + return `<span class="headroom">${c.headroom.windows.map(w => `<span class="meter" data-level="${meterLevel(w.used)}" title="${esc(w.name)}: ${w.used}% used, ${esc(w.resets)}"><span class="bar"><i style="inline-size:${Math.min(100, w.used)}%"></i></span><span>${esc(w.name)} <span class="n">${w.used}%</span>, ${esc(w.resets)}</span></span>`).join("")}</span>`; |
| +} |
| +function roles(c) { |
| + if (c.state === "signed_out") return ""; |
| + if (c.state === "sign_in_again") return `<div class="roles"><span class="none">Serving nothing until you sign in again</span></div>`; |
| + if (c.state === "limited") { const h = state.conns.find(x => x.state === "healthy"); return `<div class="roles"><span class="none">${h ? `Resting. Its work moved to ${pname(h)}.` : "Resting. Nothing can take its work right now."}</span></div>`; } |
| + if (!c.roles.length) return `<div class="roles"><span class="none">Not serving a role right now</span></div>`; |
| + return `<div class="roles"><span class="lbl">Serving</span>${c.roles.map(r => `<span class="chip"${c.live.includes(r) ? " data-live" : ""}>${c.live.includes(r) ? mark("s") : ""}${ROLE[r]}</span>`).join("")}</div>`; |
| +} |
| +function usage(c) { |
| + if (c.state === "signed_out") return `<span class="usage">${c.usage} tokens today before sign-out</span>`; |
| + return `<span class="usage"><b>${c.usage}</b> tokens today${c.cost ? ` <span class="cost">, about ${c.cost}</span>` : ""}</span>`; |
| +} |
| +function actions(c) { |
| + const quiet = [], always = []; |
| + if (c.state === "signed_out") always.push(`<a href="#" data-act="reconnect" data-id="${c.id}">Connect again</a>`); |
| + else if (c.state === "sign_in_again") always.push(`<a href="#" data-act="reconnect" data-id="${c.id}">Sign in again</a>`); |
| + if (c.state !== "signed_out") { |
| + if (!c.preferred) quiet.push(`<button type="button" data-act="prefer" data-id="${c.id}">Make preferred</button>`); |
| + quiet.push(`<button type="button" class="danger" data-act="signout" data-id="${c.id}">Sign out</button>`); |
| + } else quiet.push(`<button type="button" class="danger" data-act="forget" data-id="${c.id}">Forget</button>`); |
| + const menu = `<details class="menu"${state.openMenu === c.id ? " open" : ""} data-menu="${c.id}"><summary aria-label="More">${icon("more")}</summary><div>${quiet.join("")}</div></details>`; |
| + return `${always.length ? `<span class="always">${always.join("")}</span>` : ""}<span class="quiet">${quiet.join("")}</span>${menu}`; |
| +} |
| +function row(c) { |
| + const live = c.live.length > 0; |
| + return `<article class="row" data-state="${c.state}"${c.id === state.newId ? " data-new" : ""} aria-label="${pname(c)}, ${esc(c.label)}, ${stateWords(c)}"> |
| + ${pmark(c.provider)} |
| + <div class="body"> |
| + <div class="head"><span class="name">${pname(c)}</span><span class="acct">${esc(c.label)}${c.plan ? `, ${esc(c.plan)}` : ""}</span>${c.preferred ? `<span class="pref">${icon("star")}Preferred</span>` : ""}</div> |
| + <div class="facts"><span class="st" data-s="${c.state}">${stateWords(c)}</span>${headroom(c)}</div> |
| + ${roles(c)} |
| + </div> |
| + <div class="side"><span class="top">${actions(c)}</span>${usage(c)}</div> |
| + </article>`; |
| +} |
| + |
| +/* ── Add a connection ────────────────────────────────────────────── */ |
| +const PHRASES = { |
| + codex: ["Knocking on OpenAI's door…", "Finding a quiet room on the runner…", "Asking for a one-time code…", "Nearly there…"], |
| + claude: ["Knocking on Anthropic's door…", "Making a home for this account on docs-t1…", "Asking Claude Code to start its sign-in…", "Nearly there…"] |
| +}; |
| +function chooser() { |
| + return `<div class="chooser" role="dialog" aria-label="Add a connection"> |
| + <header><div><h3>Add a connection</h3><p>Equipo signs in through the provider's own flow and never sees your password.</p></div><button class="btn" data-quiet type="button" data-act="cancel">Cancel</button></header> |
| + <div class="opts"> |
| + <button class="opt" type="button" data-pick="claude">${pmark("claude")}<span><span class="t">Claude</span><span class="d">${PROVIDERS.claude.d}</span></span>${icon("chevron-down", "icon go")}</button> |
| + <button class="opt" type="button" data-pick="codex">${pmark("codex")}<span><span class="t">Codex</span><span class="d">${PROVIDERS.codex.d}</span></span>${icon("chevron-down", "icon go")}</button> |
| + <p class="sep">Coming soon</p> |
| + <button class="opt" type="button" disabled>${pmark("local", null, true)}<span><span class="t">Local models</span><span class="d">${PROVIDERS.local.d}</span></span><span class="soon">Coming soon</span></button> |
| + <button class="opt" type="button" disabled>${pmark("mistral", null, true)}<span><span class="t">Mistral</span><span class="d">${PROVIDERS.mistral.d}</span></span><span class="soon">Coming soon</span></button> |
| + <button class="opt" type="button" disabled>${pmark("tensorx", null, true)}<span><span class="t">TensorX</span><span class="d">${PROVIDERS.tensorx.d}</span></span><span class="soon">Coming soon</span></button> |
| + </div> |
| + </div>`; |
| +} |
| +function cardHead(p, sub) { return `<div class="c-head">${pmark(p)}<div><h3>Connecting ${PROVIDERS[p].name}</h3><p>${sub}</p></div></div>`; } |
| +function loadingCard(p) { |
| + const phrase = still() ? `Connecting to ${PROVIDERS[p].by}…` : PHRASES[p][state.phraseAt % PHRASES[p].length]; |
| + return `<div class="connect" aria-live="polite">${cardHead(p, "This takes a moment.")}<div class="loading">${mark("l")}<p class="phrase" data-phrase>${esc(phrase)}</p></div><div class="c-foot"><span></span><button class="btn" data-quiet type="button" data-act="cancel">Cancel</button></div></div>`; |
| +} |
| +function waitingLine(text) { return `<div class="waiting" aria-live="polite">${mark("s")}<span>${text}</span><span class="dots" aria-hidden="true"><i></i><i></i><i></i></span></div>`; } |
| +function codexCard() { |
| + return `<div class="connect">${cardHead("codex", "paul@tito.io's ChatGPT, through Codex.")} |
| + <ol class="steps"> |
| + <li><div><p><strong>Open OpenAI</strong></p><div><a class="btn" data-primary href="#" data-act="open">${icon("external")}Open OpenAI</a></div></div></li> |
| + <li><div><p>Enter this code:</p><div class="code"><span class="val" data-copy-src>703X-SUTH3</span><button class="btn" type="button" data-copy="703X-SUTH3">${icon("copy")}Copy</button><p class="once">Shown once. It expires in 15 minutes.</p></div></div></li> |
| + <li><div><p>Approve, then come back. Equipo connects on its own.</p></div></li> |
| + </ol> |
| + ${waitingLine("Waiting for you to approve")} |
| + <p class="small">OpenAI says device sign-in is off? Turn it on in ChatGPT, Settings, Security.</p> |
| + <div class="c-foot"><span class="small" style="margin:0">Nothing but the code OpenAI generated passes through Equipo.</span><button class="btn" data-quiet type="button" data-act="cancel">Cancel</button></div> |
| + </div>`; |
| +} |
| +function claudeCard() { |
| + const cmd = "equipo-runner login claude"; |
| + return `<div class="connect">${cardHead("claude", "Claude signs in on the machine that runs your runner.")} |
| + <ol class="steps"> |
| + <li><div><p><strong>Open a terminal on docs-t1</strong></p></div></li> |
| + <li><div><p>Run this:</p><div class="code"><code class="cmd" data-copy-src>${cmd}</code><button class="btn" type="button" data-copy="${cmd}">${icon("copy")}Copy</button></div></div></li> |
| + <li><div><p>Sign in in the browser it opens, then come back. Equipo connects on its own.</p></div></li> |
| + </ol> |
| + ${waitingLine("Waiting for the sign-in to finish on docs-t1")} |
| + <p class="small">The sign-in happens inside Claude Code itself. Equipo never sees the code or the token.</p> |
| + <div class="c-foot"><span class="small" style="margin:0">At the runner's machine? Sign in with one tap instead.</span><button class="btn" data-quiet type="button" data-act="cancel">Cancel</button></div> |
| + </div>`; |
| +} |
| +function successCard(p) { |
| + let sparks = ""; |
| + for (let i = 0; i < 14; i++) { |
| + const a = (i / 14) * Math.PI * 2, r = 1.9 + (i % 3) * .5; |
| + sparks += `<i data-spark="${["", "warm", "pale"][i % 3]}" style="--dx:${(Math.cos(a) * r).toFixed(2)}rem;--dy:${(Math.sin(a) * r).toFixed(2)}rem;--d:${(i % 4) * 60}ms"></i>`; |
| + } |
| + return `<div class="connect"${state.leaving ? " data-leaving" : ""} aria-live="polite"><div class="success"><div class="burst">${mark()}${sparks}</div><p class="big">${PROVIDERS[p].name} is connected</p><p class="acct">paul@tito.io. Your coordinator can use it from the next message.</p></div></div>`; |
| +} |
| +function addArea(primary) { |
| + switch (state.add) { |
| + case "choose": return chooser(); |
| + case "loading": return loadingCard(state.provider); |
| + case "codex": return codexCard(); |
| + case "claude": return claudeCard(); |
| + case "success": return successCard(state.provider); |
| + default: return `<div class="add-foot"><button class="btn" type="button" data-act="add"${primary ? " data-primary" : ""}>${icon("plug")}Add a connection</button>${primary ? "" : `<span>Another account of yours, or a second provider so Review can use a different model family.</span>`}</div>`; |
| + } |
| +} |
| +function empty() { |
| + return `<section class="empty"><div class="pair">${pmark("claude", "l")}${pmark("codex", "l")}</div> |
| + <h2>Equipo works through the accounts you already have</h2> |
| + <p>Add your Claude or ChatGPT subscription and your coordinator starts answering. Add both and Equipo switches between them when one rests, and reviews with a different model family.</p> |
| + <div class="add-area">${addArea(true)}</div> |
| + <p class="fine">Nothing to configure. Equipo picks who answers and tells you when it switches.</p> |
| + </section>`; |
| +} |
| + |
| +/* ── The screen ──────────────────────────────────────────────────── */ |
| +function screen() { |
| + if (state.conns.length === 0) return `<div class="inner"><div class="page-head"><h1>Connections</h1></div>${empty()}</div>`; |
| + return `<div class="inner"> |
| + <div class="page-head"><h1>Connections</h1><p>The accounts your team answers with.</p></div> |
| + ${answering()} |
| + <section class="group"><h2>Your connections <span class="n">${state.conns.length}</span><span class="hint">Usage resets at midnight UTC</span></h2> |
| + <div class="list">${state.conns.map(row).join("")}</div> |
| + <div class="add-area">${addArea(false)}</div> |
| + </section> |
| + </div>`; |
| +} |
| +function railSpecialists() { |
| + const live = {}; state.conns.forEach(c => c.live.forEach(r => live[r] = pname(c))); |
| + const ok = eligible().length > 0; |
| + return ["coordinator", "engineering", "review"].map(r => `<a href="#" data-noop>${live[r] ? mark("s") : icon("star")}<span>${ROLE[r]}</span><span class="state"${live[r] ? "" : " data-idle"}>${live[r] ? `on ${live[r]}` : ok ? "idle" : "waiting"}</span></a>`).join(""); |
| +} |
| +function rail() { |
| + const attention = state.conns.some(c => c.state === "limited" || c.state === "sign_in_again"); |
| + return `<aside class="rail"><a class="brand" href="#">${icon("users")}Oficina</a><nav> |
| + <a href="#" data-noop>${icon("message-circle")}<span>Conversation</span></a> |
| + <a href="#" data-noop>${icon("folder")}<span>Projects</span><span class="count">3</span></a> |
| + <a href="#" data-noop>${icon("check-circle")}<span>Tasks</span><span class="count">4</span></a> |
| + <a href="#" data-noop>${icon("inbox")}<span>Needs you</span><span class="count"${eligible().length === 0 && state.conns.length ? " data-attention" : ""}>${eligible().length === 0 && state.conns.length ? 1 : ""}</span></a> |
| + <p class="nav-group">Specialists</p> |
| + ${railSpecialists()} |
| + <p class="nav-group">Team</p> |
| + <a href="#" data-noop>${icon("users")}<span>People</span><span class="count">2</span></a> |
| + <a href="#" data-noop>${icon("notebook")}<span>Notebook</span></a> |
| + <a href="#" aria-current="page">${icon("plug")}<span>Connections</span>${attention ? `<span class="att-dot" title="Something needs attention"></span>` : `<span class="count">${state.conns.length || ""}</span>`}</a> |
| + </nav></aside>`; |
| +} |
| +function render() { |
| + const desk = document.getElementById("desk"), phone = document.getElementById("phone"); |
| + const sMain = desk.querySelector(".main") ? desk.querySelector(".main").scrollTop : 0; |
| + const sPhone = phone.querySelector(".app") ? phone.querySelector(".app").scrollTop : 0; |
| + desk.innerHTML = `<div class="shell">${rail()}<div class="main">${screen()}</div></div>`; |
| + phone.innerHTML = `<div class="status"><span>21:18</span><span>5G</span></div><header><a class="back" href="#" data-noop>${icon("chevron-down")}Oficina</a><span class="ptitle">Connections</span></header><div class="app"><div class="main">${screen()}</div></div>`; |
| + desk.querySelector(".main").scrollTop = sMain; |
| + phone.querySelector(".app").scrollTop = sPhone; |
| +} |
| + |
| +/* ── The flows ───────────────────────────────────────────────────── */ |
| +function startAdd(p) { |
| + clearTimers(); |
| + state.provider = p; state.add = "loading"; state.phraseAt = 0; render(); |
| + const n = PHRASES[p].length; |
| + for (let i = 1; i < n; i++) later(i * 1100, () => { state.phraseAt = i; document.querySelectorAll("[data-phrase]").forEach(el => { el.textContent = still() ? el.textContent : PHRASES[p][i]; el.style.animation = "none"; void el.offsetWidth; el.style.animation = ""; }); }); |
| + later(n * 1100 + 300, () => { state.add = p; render(); later(7000, () => finish(p)); }); |
| +} |
| +function finish(p) { |
| + clearTimers(); |
| + const existing = state.conns.find(c => c.provider === p && (c.state === "signed_out" || c.state === "sign_in_again")); |
| + state.add = "success"; state.leaving = false; render(); |
| + const addRow = () => { |
| + const fresh = p === "codex" |
| + ? conn({ id: "n" + Date.now(), provider: "codex", label: "paul@tito.io", state: "healthy", plan: "Pro", headroom: { windows: [{ name: "5 h window", used: 4, resets: "resets in 4 h 52 m" }, { name: "Week", used: 12, resets: "resets Thu" }] }, roles: ["review"], live: [], usage: "0" }) |
| + : conn({ id: "n" + Date.now(), provider: "claude", label: "paul@tito.io", state: "healthy", roles: state.conns.length ? ["review"] : ["coordinator", "engineering", "review"], live: [], usage: "0" }); |
| + if (existing) { Object.assign(existing, fresh, { id: existing.id, label: existing.label, usage: existing.usage }); state.newId = existing.id; } |
| + else { state.conns.push(fresh); state.newId = fresh.id; } |
| + if (state.conns.length === 1) fresh.roles = ["coordinator", "engineering", "review"]; |
| + state.add = "idle"; state.leaving = false; render(); |
| + later(800, () => { state.newId = null; }); |
| + }; |
| + if (still()) later(900, addRow); |
| + else { later(1700, () => { state.leaving = true; render(); }); later(2100, addRow); } |
| +} |
| +function cancel() { clearTimers(); state.add = "idle"; state.provider = null; render(); } |
| + |
| +/* ── Events ──────────────────────────────────────────────────────── */ |
| +document.addEventListener("click", e => { |
| + const noop = e.target.closest("[data-noop]"); if (noop) { e.preventDefault(); return; } |
| + const ctl = e.target.closest("[data-control] button"); if (ctl) { setControl(ctl.parentElement.dataset.control, ctl.dataset.value); return; } |
| + const pref = e.target.closest("[data-prefer]"); if (pref) { state.prefer = pref.dataset.prefer; state.conns.forEach(c => c.preferred = c.provider === state.prefer && c.state !== "signed_out"); render(); return; } |
| + const pick = e.target.closest("[data-pick]"); if (pick) { startAdd(pick.dataset.pick); return; } |
| + const copy = e.target.closest("[data-copy]"); if (copy) { navigator.clipboard && navigator.clipboard.writeText(copy.dataset.copy).catch(() => {}); copy.setAttribute("data-copied", ""); copy.innerHTML = icon("check") + "Copied"; later(1600, () => { copy.removeAttribute("data-copied"); copy.innerHTML = icon("copy") + "Copy"; }); return; } |
| + const act = e.target.closest("[data-act]"); |
| + if (act) { |
| + e.preventDefault(); |
| + const id = act.dataset.id, c = state.conns.find(x => x.id === id); |
| + switch (act.dataset.act) { |
| + case "add": state.add = "choose"; render(); break; |
| + case "cancel": cancel(); break; |
| + case "open": if (state.add === "codex") { /* the real card opens chatgpt.com/codex/device; here the approval arrives on its own */ } break; |
| + case "prefer": state.conns.forEach(x => x.preferred = x.id === id); state.prefer = c.provider; state.openMenu = null; render(); break; |
| + case "signout": c.state = "signed_out"; c.roles = []; c.live = []; c.preferred = false; c.headroom = null; state.openMenu = null; render(); break; |
| + case "forget": state.conns = state.conns.filter(x => x.id !== id); state.openMenu = null; render(); break; |
| + case "reconnect": state.openMenu = null; startAdd(c.provider); break; |
| + } |
| + return; |
| + } |
| + if (!e.target.closest(".menu")) { if (state.openMenu) { state.openMenu = null; render(); } } |
| +}); |
| +document.addEventListener("toggle", e => { const m = e.target.closest && e.target.closest(".menu"); if (m) state.openMenu = m.open ? m.dataset.menu : null; }, true); |
| + |
| +function setControl(name, value) { |
| + const root = document.documentElement; |
| + if (name === "scene") loadScene(value); |
| + else root.dataset[name] = value; |
| + if (name === "motion") render(); |
| + document.querySelectorAll(`[data-control="${name}"] button`).forEach(b => b.setAttribute("aria-pressed", String(b.dataset.value === value))); |
| + const q = new URLSearchParams(location.search); q.set(name, value); history.replaceState(null, "", "?" + q); |
| +} |
| + |
| +/* Every few seconds the big marks shed a little dust, as in tasks.html. */ |
| +setInterval(() => { |
| + if (still()) return; |
| + document.querySelectorAll('.mark:not([data-size="s"])').forEach(m => { m.removeAttribute("data-flourish"); void m.offsetWidth; m.setAttribute("data-flourish", ""); }); |
| +}, 3600); |
| + |
| +/* ── Fit the desktop frame to the viewport ───────────────────────── */ |
| +function fit() { |
| + const wrap = document.querySelector(".stage-wrap"), stage = document.getElementById("desk"); |
| + const w = wrap.clientWidth, k = Math.min(1, w / 1280); |
| + stage.style.transform = `scale(${k})`; wrap.style.blockSize = (860 * k) + "px"; |
| +} |
| +addEventListener("resize", fit); |
| + |
| +/* ── Start ───────────────────────────────────────────────────────── */ |
| +const q = new URLSearchParams(location.search); |
| +["theme", "motion"].forEach(k => { if (q.get(k)) document.documentElement.dataset[k] = q.get(k); }); |
| +const scene = SCENES[q.get("scene")] ? q.get("scene") : "today"; |
| +["theme", "motion"].forEach(k => document.querySelectorAll(`[data-control="${k}"] button`).forEach(b => b.setAttribute("aria-pressed", String(b.dataset.value === document.documentElement.dataset[k])))); |
| +document.querySelectorAll('[data-control="scene"] button').forEach(b => b.setAttribute("aria-pressed", String(b.dataset.value === scene))); |
| +loadScene(scene); fit(); |
| +/* ?add=choose|loading|codex|claude|success&provider=codex|claude opens straight into a stage of the add flow. */ |
| +if (q.get("add") && ["choose", "loading", "codex", "claude", "success"].includes(q.get("add"))) { |
| + state.add = q.get("add"); state.provider = q.get("provider") || (q.get("add") === "claude" ? "claude" : "codex"); render(); |
| +} |
| +})(); |
| +</script> |
| +</body> |
| +</html> |