- docs/mockups/conversation-motion.html: the review sheet — 41 looping mockups (35 proposals, 6 of today's behaviour) for every element of the conversation page that snaps today: new rows, Claude typing, your sent message's hand-off, status tags, dividers, the jump flash, summary folds, page swaps, opening any card, calls finishing and grouping, every widget's state change, the waiting card, task panel, corner gizmos, strips, menus and the header; replay and ½× / ¼× per section - conversation-motion/build.py + kit.py: one generator for the sheet and the form's script-free snippets (each one its own iframe in ask-form) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1540 lines
117 KiB
Python
1540 lines
117 KiB
Python
#!/usr/bin/env python3
|
||
"""Conversation-page motion mockups → the review page + the form's snippets.
|
||
|
||
python3 docs/mockups/conversation-motion/build.py [--out DIR]
|
||
|
||
Writes docs/mockups/conversation-motion.html (the review sheet: every motion,
|
||
looping, with replay and ½× / ¼× speed) and DIR/form/<key>.html (one
|
||
script-free snippet per mockup) + DIR/form/manifest.json (the questions they
|
||
answer). Shared kit: kit.py. Sibling of docs/mockups/home-motion.html.
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import argparse
|
||
import html as H
|
||
import json
|
||
import pathlib
|
||
|
||
from kit import (
|
||
EASE_IN,
|
||
EASE_OUT,
|
||
LIN,
|
||
SPRING,
|
||
Mock,
|
||
cap,
|
||
claude,
|
||
composer,
|
||
group,
|
||
ic,
|
||
tool,
|
||
you,
|
||
)
|
||
|
||
HERE = pathlib.Path(__file__).resolve().parent
|
||
MOCKS: dict[str, dict] = {}
|
||
|
||
|
||
def reg(m: Mock, body: str, title: str, label: str = "", desc: str = "") -> None:
|
||
MOCKS[m.key] = {"html": m.html(body), "title": title, "label": label or title, "desc": desc, "w": m.w, "h": m.h}
|
||
|
||
|
||
# Row geometry (kit.py): a card is 37 + 19·lines px, a tool row 28 px, and
|
||
# every thread row sits in a slot whose 8 px top padding is the thread's gap —
|
||
# so a slot opening from 0 moves the rows above by exactly its own height.
|
||
ROW = 28
|
||
GAP = 8
|
||
|
||
|
||
def card_h(lines: int) -> int:
|
||
return 37 + 19 * lines
|
||
|
||
|
||
GEOM = f".tr{{height:{ROW}px}}.ln{{height:19px;line-height:19px}}.hd{{height:15px}}.sl{{padding-top:{GAP}px;overflow:hidden}}"
|
||
|
||
|
||
def sl(inner: str, cls: str = "") -> str:
|
||
return f'<div class="sl {cls}"><div class="in">{inner}</div></div>'
|
||
|
||
|
||
def typer(m: Mock, sel: str, t0: float, dur: float, end: float | None = None, steps: int = 30) -> None:
|
||
"""A line typing in (clip from the right), held, reset at the cycle's end."""
|
||
end = end if end is not None else m.T - 0.3
|
||
m.anim(
|
||
sel,
|
||
[
|
||
(0, "clip-path:inset(0 100% 0 0)"),
|
||
(t0, "clip-path:inset(0 100% 0 0)", f"steps({steps})"),
|
||
(t0 + dur, "clip-path:inset(0 0 0 0)"),
|
||
(end, "clip-path:inset(0 0 0 0)"),
|
||
(m.T, "clip-path:inset(0 0 0 0)"),
|
||
],
|
||
)
|
||
|
||
|
||
def room(m: Mock, sel: str, t0: float, h: int, h0: int = 0, ms: float = 0.24) -> None:
|
||
m.anim(sel, [(0, f"height:{h0}px"), (t0, f"height:{h0}px", EASE_OUT), (t0 + ms, f"height:{h}px"), (m.T, f"height:{h}px")])
|
||
|
||
|
||
def enter(m: Mock, sel: str, t0: float, frm: str = "translateY(16px)", ms: float = 0.38, ease: str = EASE_OUT) -> None:
|
||
m.anim(
|
||
sel,
|
||
[
|
||
(0, f"opacity:0;transform:{frm}"),
|
||
(t0, f"opacity:0;transform:{frm}", ease),
|
||
(t0 + ms, "opacity:1;transform:none"),
|
||
(m.T, "opacity:1;transform:none"),
|
||
],
|
||
)
|
||
|
||
|
||
def pop(m: Mock, sel: str, t0: float, ms: float = 0.32, origin: str = "50% 50%") -> None:
|
||
m.anim(
|
||
sel,
|
||
[
|
||
(0, "opacity:0;transform:scale(.4)"),
|
||
(t0, "opacity:0;transform:scale(.4)", SPRING),
|
||
(t0 + ms, "opacity:1;transform:none"),
|
||
(m.T, "opacity:1;transform:none"),
|
||
],
|
||
extra=f"transform-origin:{origin}",
|
||
)
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 1 · A new row arrives (Claude's message, a tool call, any widget)
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_arrive(key: str, style: str) -> None:
|
||
T = 7.0
|
||
m = Mock(key, T, 330)
|
||
m.style(GEOM + ".th{bottom:64px}")
|
||
# history already there
|
||
hist = (
|
||
sl(claude(["…so the parser keeps the offset and", "resumes from there on the next read."], "10:11"))
|
||
+ sl(group("Ran 3 commands, Read parse.py", 4))
|
||
+ sl(claude(["Running the test suite now."], "10:12"))
|
||
)
|
||
new1 = sl(tool("Ran", "npm test -- --run", right='<span class="dot1" style="width:6px;height:6px;border-radius:50%;background:var(--amber)"></span>'), "n1")
|
||
new2 = sl(
|
||
claude(["All 214 tests pass. Committing the", "fix on the branch next."], "10:13"),
|
||
"n2",
|
||
)
|
||
t1, t2 = 0.8, 3.0
|
||
if style == "today":
|
||
# the whole row lands at once (no room), 4 px fade-up over 300 ms
|
||
m.anim(".n1", [(0, "height:0"), (t1, "height:0", "steps(1,end)"), (t1 + 0.01, f"height:{GAP + ROW}px"), (T, f"height:{GAP + ROW}px")])
|
||
enter(m, ".n1 .in", t1, "translateY(4px)", 0.3, "ease-out")
|
||
m.anim(".n2", [(0, "height:0"), (t2, "height:0", "steps(1,end)"), (t2 + 0.01, f"height:{GAP + card_h(1)}px"),
|
||
(t2 + 0.9, f"height:{GAP + card_h(1)}px", "steps(1,end)"), (t2 + 0.91, f"height:{GAP + card_h(2)}px"), (T, f"height:{GAP + card_h(2)}px")])
|
||
enter(m, ".n2 .in", t2, "translateY(4px)", 0.3, "ease-out")
|
||
else:
|
||
frm = {"rise": "translateY(18px)", "side": "translateX(-28px)", "fade": "none"}[style]
|
||
room(m, ".n1", t1, GAP + ROW)
|
||
enter(m, ".n1 .in", t1 + 0.24, frm)
|
||
m.anim(".n2", [(0, "height:0"), (t2, "height:0", EASE_OUT), (t2 + 0.24, f"height:{GAP + card_h(1)}px"),
|
||
(t2 + 0.95, f"height:{GAP + card_h(1)}px", EASE_OUT), (t2 + 1.13, f"height:{GAP + card_h(2)}px"), (T, f"height:{GAP + card_h(2)}px")])
|
||
enter(m, ".n2 .in", t2 + 0.24, frm)
|
||
base = t2 + (0.01 if style == "today" else 0.3)
|
||
typer(m, ".n2 .l0", base, 0.65)
|
||
typer(m, ".n2 .l1", base + 0.68 if style != "today" else base + 0.9, 0.6)
|
||
m.anim(".dot1", [(0, "opacity:1"), (2.2, "opacity:1"), (2.35, "opacity:0;transform:scale(.3)"), (T, "opacity:0")], fill="both")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{hist}{new1}{new2}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
titles = {
|
||
"today": ("Today", "The row's full height lands at once — everything above jumps up — then it fades up 4 px."),
|
||
"rise": ("A · Make room, then rise from below", "The thread glides up to open the slot (240 ms), then the row rises in from the bottom (380 ms). Recommended."),
|
||
"side": ("B · Make room, then slide in from the left", "Same room first; Claude's rows slide in from the left edge, yours from the right."),
|
||
"fade": ("C · Make room, then fade in place", "Same room first; the row only fades in, no movement."),
|
||
}
|
||
reg(m, body, titles[style][0], desc=titles[style][1])
|
||
|
||
|
||
for s in ("today", "rise", "side", "fade"):
|
||
m_arrive(f"arrive-{s}", s)
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 2 · Claude's message typing — the card growing line by line
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_typing(key: str, style: str) -> None:
|
||
T = 6.5
|
||
m = Mock(key, T, 300)
|
||
m.style(GEOM + ".th{bottom:64px}")
|
||
lines = ["The cache misses came from the resumed", "agents: each resume re-wrote the whole", "context. Pinning the TTL to 1 h fixes it,"]
|
||
hist = sl(group("Ran 6 commands", 6)) + sl(you(["why is the cache hit rate so low?"], "10:20")) + sl(group("Read 3 files, Ran 2 commands", 5))
|
||
msg = sl(claude(lines + ["and the next turn reads 92 % cached."], "10:21", line_cls="l"), "m")
|
||
t0, per = 0.7, 0.95
|
||
hs = [GAP + card_h(n) for n in (1, 2, 3, 4)]
|
||
frames = [(0, f"height:{hs[0]}px")]
|
||
for i in range(1, 4):
|
||
t = t0 + per * i - 0.06
|
||
if style == "today":
|
||
frames += [(t, f"height:{hs[i-1]}px", "steps(1,end)"), (t + 0.01, f"height:{hs[i]}px")]
|
||
else:
|
||
frames += [(t, f"height:{hs[i-1]}px", EASE_OUT), (t + 0.18, f"height:{hs[i]}px")]
|
||
frames.append((T, f"height:{hs[3]}px"))
|
||
m.anim(".m", frames)
|
||
for i in range(4):
|
||
typer(m, f".m .l{i}", t0 + per * i, per - 0.08, steps=34)
|
||
if style == "caret":
|
||
# a caret riding the end of the typed text
|
||
m.style(".m .bd{position:relative}.cr{position:absolute;width:2px;height:14px;background:var(--pr);border-radius:1px}")
|
||
fr = [(0, "left:0;top:2px;opacity:1")]
|
||
for i in range(4):
|
||
a, b = t0 + per * i, t0 + per * i + per - 0.08
|
||
fr += [(a, f"left:0;top:{2 + 19 * i}px;opacity:1", LIN), (b, f"left:{[268, 262, 270, 236][i]}px;top:{2 + 19 * i}px;opacity:1")]
|
||
fr += [(t0 + per * 4 + 0.6, "left:236px;top:59px;opacity:1"), (t0 + per * 4 + 0.7, "left:236px;top:59px;opacity:0"), (T, "left:236px;top:59px;opacity:0")]
|
||
m.anim(".cr", fr)
|
||
msg = msg.replace('<div class="bd">', '<div class="bd"><i class="cr"></i>', 1)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{hist}{msg}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
titles = {
|
||
"today": ("Today", "Each wrapped line adds 19 px at once: the card and everything above it jump a line at a time."),
|
||
"glide": ("A · The card glides to each new line", "Its height eases (180 ms) as a line starts, so the thread scrolls up smoothly while Claude types. Recommended."),
|
||
"caret": ("B · Glide + a caret", "Same glide, with an orange caret riding the end of the text until the message is done."),
|
||
}
|
||
reg(m, body, titles[style][0], desc=titles[style][1])
|
||
|
||
|
||
for s in ("today", "glide", "caret"):
|
||
m_typing(f"typing-{s}", s)
|
||
|
||
|
||
def shrink(m: Mock, sel: str, t0: float, ms: float = 0.2, origin: str = "50% 50%", back: float | None = None) -> None:
|
||
"""Shrink out (scale .4 + fade) at t0; optionally pop back at `back`."""
|
||
fr = [(0, "opacity:1;transform:none"), (t0, "opacity:1;transform:none", EASE_IN), (t0 + ms, "opacity:0;transform:scale(.4)")]
|
||
if back is not None:
|
||
fr += [(back, "opacity:0;transform:scale(.4)", SPRING), (back + 0.32, "opacity:1;transform:none")]
|
||
fr.append((m.T, "opacity:1;transform:none"))
|
||
else:
|
||
fr.append((m.T, "opacity:0;transform:scale(.4)"))
|
||
m.anim(sel, fr, extra=f"transform-origin:{origin}")
|
||
|
||
|
||
def show(m: Mock, sel: str, a: float, b: float | None = None, ms: float = 0.25) -> None:
|
||
"""Fade in at a (and out at b)."""
|
||
fr = [(0, "opacity:0"), (a, "opacity:0", EASE_OUT), (a + ms, "opacity:1")]
|
||
if b is not None:
|
||
fr += [(b, "opacity:1", EASE_OUT), (b + ms, "opacity:0"), (m.T, "opacity:0")]
|
||
else:
|
||
fr.append((m.T, "opacity:1"))
|
||
m.anim(sel, fr)
|
||
|
||
|
||
def hide(m: Mock, sel: str, a: float, b: float | None = None, ms: float = 0.25) -> None:
|
||
"""Fade out at a (and back at b)."""
|
||
fr = [(0, "opacity:1"), (a, "opacity:1", EASE_OUT), (a + ms, "opacity:0")]
|
||
if b is not None:
|
||
fr += [(b, "opacity:0", EASE_OUT), (b + ms, "opacity:1"), (m.T, "opacity:1")]
|
||
else:
|
||
fr.append((m.T, "opacity:0"))
|
||
m.anim(sel, fr)
|
||
|
||
|
||
def snap(m: Mock, sel: str, a: float, before: str, after: str, b: float | None = None) -> None:
|
||
"""A property that changes at once at a (and back at b)."""
|
||
fr = [(0, before), (a, before, "steps(1,end)"), (a + 0.01, after)]
|
||
if b is not None:
|
||
fr += [(b, after, "steps(1,end)"), (b + 0.01, before), (m.T, before)]
|
||
else:
|
||
fr.append((m.T, after))
|
||
m.anim(sel, fr)
|
||
|
||
|
||
def heights(m: Mock, sel: str, h0: int, steps: list[tuple], snap_: bool = False) -> None:
|
||
"""Height h0, then (t, h[, ms]) glides (or snaps)."""
|
||
fr = [(0, f"height:{h0}px")]
|
||
cur = h0
|
||
for st in steps:
|
||
t, h = st[0], st[1]
|
||
ms = st[2] if len(st) > 2 else 0.24
|
||
if snap_:
|
||
fr += [(t, f"height:{cur}px", "steps(1,end)"), (t + 0.01, f"height:{h}px")]
|
||
else:
|
||
fr += [(t, f"height:{cur}px", EASE_OUT), (t + ms, f"height:{h}px")]
|
||
cur = h
|
||
fr.append((m.T, f"height:{cur}px"))
|
||
m.anim(sel, fr)
|
||
|
||
|
||
def swapto(m: Mock, a_sel: str, b_sel: str, t: float, back: float | None = None, ms: float = 0.16) -> None:
|
||
"""Two labels stacked in one cell (.ovl): a gives way to b at t (and back)."""
|
||
hide(m, a_sel, t, back, ms)
|
||
show(m, b_sel, t, back, ms)
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 3 · Your message: sent → echo → landed
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
ECHO_CSS = (
|
||
".st{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:1px 7px;font-size:9.5px;font-weight:600;color:var(--pr);background:rgba(249,122,31,.12)}"
|
||
".q{display:flex;align-items:center;gap:6px;border-top:1px solid rgba(249,122,31,.15);margin-top:6px;padding-top:5px;height:28px;font-size:10.5px;color:var(--mfg);white-space:nowrap}"
|
||
".q .b{margin-left:auto;display:flex;gap:6px}.q .b span{border-radius:7px;padding:2px 7px;font-size:10.5px}"
|
||
".q .now{border:1px solid rgba(249,122,31,.4);background:rgba(249,122,31,.1);color:var(--pr);font-weight:600}"
|
||
".held{position:absolute;left:10px;right:10px;bottom:10px;height:44px;border-radius:12px;z-index:7;overflow:hidden;"
|
||
"display:flex;align-items:center;padding:0 12px;font:12px var(--mono);color:var(--fg);border:1px solid var(--border);background:var(--card)}"
|
||
".held .sw{position:absolute;left:0;top:0;bottom:0;width:100%;background:rgba(249,122,31,.13);transform-origin:left}"
|
||
".held .lb{position:absolute;right:10px;font:600 10px var(--ui);color:var(--pr)}"
|
||
)
|
||
|
||
|
||
def m_echo(key: str, style: str) -> None:
|
||
T = 8.5
|
||
m = Mock(key, T, 330)
|
||
m.style(GEOM + ECHO_CSS + ".th{bottom:64px}")
|
||
hist = sl(group("Ran 4 commands, Edited 2 files", 6)) + sl(claude(["The unit tests pass. Want the e2e suite", "too before I commit?"], "10:13"))
|
||
eh0 = card_h(1) # the echo: header + one line
|
||
q = 34 # the queued row (6 px margin + 28 px)
|
||
echo_head = '<span class="st sx">' + ic("loader", 10, "currentColor", "spin") + '<span class="s1">sending…</span><span class="s2">queued</span></span>'
|
||
echo = (
|
||
f'<div class="c you ec"><div class="hd">{ic("user", 12)}You{echo_head}<span class="ts tsx">· Nov 3, 10:14</span></div>'
|
||
f'<div class="bd"><span class="ln">yes, run the e2e tests too</span></div>'
|
||
f'<div class="qw"><div class="q">{ic("loader", 10, "currentColor", "spin")}after this step<span class="b"><span>Cancel</span><span class="now">Stop & send now</span></span></div></div></div>'
|
||
)
|
||
real = you(["yes, run the e2e tests too"], "10:14")
|
||
tsend, tout, tq, tland = 0.7, 2.3, 3.5, 5.4
|
||
# the composer: typed text, then the 3 s un-send window (as today, compressed here)
|
||
m.anim(".held", [(0, "opacity:0"), (tsend, "opacity:0", "steps(1,end)"), (tsend + 0.01, "opacity:1"), (tout, "opacity:1", EASE_OUT), (tout + 0.2, "opacity:0"), (T, "opacity:0")])
|
||
m.anim(".held .sw", [(0, "transform:scaleX(0)"), (tsend, "transform:scaleX(0)", LIN), (tout, "transform:scaleX(1)"), (T, "transform:scaleX(1)")])
|
||
m.anim(".cmp .tx", [(0, "opacity:1"), (tsend, "opacity:1", "steps(1,end)"), (tsend + 0.01, "opacity:0"), (T, "opacity:0")])
|
||
m.style(".qw{overflow:hidden;height:0}.s1,.s2{display:inline-block;overflow:hidden;white-space:nowrap;vertical-align:bottom}.s2{width:0}")
|
||
snap(m, ".cmp .go", tsend, "background:var(--pr);color:#0a0a0a", "background:var(--muted);color:var(--mfg)")
|
||
if style == "today":
|
||
m.anim(".e1", [(0, "height:0"), (tout, "height:0", "steps(1,end)"), (tout + 0.01, f"height:{GAP + eh0}px"), (tq, f"height:{GAP + eh0}px", "steps(1,end)"),
|
||
(tq + 0.01, f"height:{GAP + eh0 + q}px"), (tland, f"height:{GAP + eh0 + q}px", "steps(1,end)"), (tland + 0.01, "height:0"), (T, "height:0")])
|
||
# the whole card pulses while it is sending
|
||
m.anim(".e1 .ec", [(0, "opacity:1"), (tout, "opacity:1", "ease-in-out"), (tout + 0.6, "opacity:.45", "ease-in-out"), (tout + 1.2, "opacity:1"), (T, "opacity:1")])
|
||
snap(m, ".e1 .qw", tq, "height:0", f"height:{q}px")
|
||
snap(m, ".e1 .s1", tq, "width:44px", "width:0")
|
||
snap(m, ".e1 .s2", tq, "width:0", "width:38px")
|
||
# landed: the echo unmounts at once… and the real row comes in later, on its own
|
||
snap(m, ".r1", tland + 0.6, "height:0", f"height:{GAP + card_h(1)}px")
|
||
enter(m, ".r1 .in", tland + 0.6, "translateY(4px)", 0.3, "ease-out")
|
||
body_rows = sl(echo, "e1") + sl(real, "r1")
|
||
m.style(".hd .sx{margin-left:2px}.tsx{display:none}")
|
||
else:
|
||
# room at the thread's foot, then the card rises from the composer
|
||
heights(m, ".e1", 0, [(tout, GAP + eh0), (tq, GAP + eh0 + q, 0.26), (tland, GAP + eh0, 0.26)])
|
||
enter(m, ".e1 .in", tout + 0.2, "translateY(46px) scale(.96)", 0.42)
|
||
heights(m, ".e1 .qw", 0, [(tq, q, 0.26), (tland, 0, 0.26)])
|
||
show(m, ".e1 .q", tq + 0.18, None, 0.2)
|
||
# status pill retypes sending… → queued, then shrinks away as it lands
|
||
m.anim(".e1 .s1", [(0, "width:44px"), (tq - 0.1, "width:44px", "steps(8)"), (tq + 0.12, "width:0"), (T, "width:0")])
|
||
m.anim(".e1 .s2", [(0, "width:0"), (tq + 0.12, "width:0", "steps(7)"), (tq + 0.4, "width:38px"), (T, "width:38px")])
|
||
m.anim(".e1 .sx", [(0, "opacity:1;transform:none;max-width:120px;padding:1px 7px;margin-right:0"), (tland + 0.1, "opacity:1;transform:none", EASE_IN),
|
||
(tland + 0.3, "opacity:0;transform:scale(.4);max-width:120px;padding:1px 7px;margin-right:0", EASE_OUT),
|
||
(tland + 0.52, "opacity:0;transform:scale(.4);max-width:0;padding:1px 0;margin-right:-5px"), (T, "opacity:0;max-width:0;padding:1px 0;margin-right:-5px")],
|
||
extra="transform-origin:0 50%;overflow:hidden;white-space:nowrap")
|
||
m.style(".tsx{display:inline-block;overflow:hidden;white-space:nowrap;vertical-align:bottom}")
|
||
if style == "morph":
|
||
m.anim(".e1 .tsx", [(0, "width:0"), (tland + 0.25, "width:0", "steps(14)"), (tland + 0.7, "width:80px"), (T, "width:80px")])
|
||
body_rows = sl(echo, "e1")
|
||
else: # cross-fade at the same spot
|
||
m.style(".e1{position:relative}.r1{position:absolute;left:0;right:0;top:0}")
|
||
m.anim(".e1 .tsx", [(0, "width:0"), (T, "width:0")])
|
||
show(m, ".r1", tland + 0.15, None, 0.35)
|
||
hide(m, ".e1 .ec", tland + 0.15, None, 0.35)
|
||
body_rows = f'<div class="sl e1" style="position:relative"><div class="in">{echo}<div class="r1" style="position:absolute;left:0;right:0;top:0">{real}</div></div></div>'
|
||
m.fade_cycle()
|
||
held = f'<div class="held"><i class="sw"></i>yes, run the e2e tests too<span class="lb">Sending… tap to cancel</span></div>'
|
||
body = f'<div class="th">{hist}{body_rows}</div>' + composer("yes, run the e2e tests too", armed=True) + held + m.tap(332, 296, tsend)
|
||
titles = {
|
||
"today": ("Today", "After the 3 s un-send window the echo lands at once and pulses; when the transcript has it, the echo unmounts and the real message comes in later, on its own — a gap, then a second arrival."),
|
||
"morph": ("A · One card, from send to landed", "Room opens at the thread's foot, the card rises from the composer; its pill retypes sending… → queued, the queued row glides in and out; when it lands the pill shrinks and the time types in — same card, no remount. Recommended."),
|
||
"xfade": ("B · Echo and message cross-fade", "Same arrival; when it lands the real message fades in over the echo at the same spot (no gap, no second arrival)."),
|
||
}
|
||
reg(m, body, titles[style][0], desc=titles[style][1])
|
||
|
||
|
||
for s in ("today", "morph", "xfade"):
|
||
m_echo(f"echo-{s}", s)
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 4 · Status tags pop (interrupted · paused · held · mid-turn · cancelled)
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_pills() -> None:
|
||
T = 6.0
|
||
m = Mock("pills", T, 300)
|
||
m.style(GEOM + ".th{bottom:64px}.rt{display:flex;justify-content:flex-end}.mt{margin-left:2px}")
|
||
hist = sl(claude(["Rebuilding the image — phase 2 of 6."], "10:30")) + sl(group("Ran 2 commands", 2))
|
||
p1 = sl(f'<div class="rt"><span class="pl rose pp1">{ic("ban", 10)}interrupted</span></div>', "n1")
|
||
u = you(["skip the e2e run, just deploy"], "10:31", head_extra=f'<span class="pl sky n mt" style="padding:0 5px;font-size:9px">MID-TURN</span>')
|
||
p2 = sl(u, "n2")
|
||
p3 = sl(f'<div class="rt"><span class="pl amber pp3">{ic("hour", 10)}turn held 60 s for a background shell</span></div>', "n3")
|
||
room(m, ".n1", 0.8, GAP + 20)
|
||
pop(m, ".pp1", 1.04, origin="100% 50%")
|
||
room(m, ".n2", 2.0, GAP + card_h(1))
|
||
enter(m, ".n2 .in", 2.24)
|
||
room(m, ".n3", 3.8, GAP + 20)
|
||
pop(m, ".pp3", 4.04, origin="100% 50%")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{hist}{p1}{p2}{p3}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Status tags pop in", desc="interrupted, paused, held, mid-turn, cancelled: room opens, then the pill pops from 40 % with a small overshoot (the home's pill rule).")
|
||
|
||
|
||
m_pills()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 5 · Dividers draw out (model switch · compaction)
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_dividers() -> None:
|
||
T = 6.0
|
||
m = Mock("dividers", T, 280)
|
||
m.style(
|
||
GEOM
|
||
+ ".th{bottom:64px}.dv{display:flex;align-items:center;gap:7px;height:20px;font-size:10px;color:var(--mfg);white-space:nowrap}"
|
||
".dv .l{flex:1;height:1px;background:var(--border)}.dv .l.a{transform-origin:100% 50%}.dv .l.b{transform-origin:0 50%}"
|
||
".dv .lab{display:flex;align-items:center;gap:5px}.mtag{border-radius:5px;padding:0 5px;font:10px var(--mono);color:var(--vio);background:rgba(167,139,250,.12)}"
|
||
".mtag.o{opacity:.6}.dv.cp .l{border-top:1px dashed #3a3a3a;background:none;height:0}"
|
||
)
|
||
hist = sl(claude(["Done — the deploy is live."], "11:02")) + sl(you(["now review it with opus"], "11:04"))
|
||
d1 = sl(f'<div class="dv"><i class="l a"></i><span class="lab lb1">switched <span class="mtag o">sonnet-5-5</span>→<span class="mtag">opus-5-5</span></span><i class="l b"></i></div>', "n1")
|
||
c2 = sl(claude(["Reviewing the diff now."], "11:04"), "n2")
|
||
d3 = sl(f'<div class="dv cp"><i class="l a"></i><span class="lab lb3">{ic("folds", 11)}context compacted · 142k → 18k</span><i class="l b"></i></div>', "n3")
|
||
for n, t0 in (("1", 0.8), ("3", 3.4)):
|
||
room(m, f".n{n}", t0, GAP + 20)
|
||
for side in ("a", "b"):
|
||
m.anim(f".n{n} .l.{side}", [(0, "transform:scaleX(0)"), (t0 + 0.2, "transform:scaleX(0)", EASE_OUT), (t0 + 0.75, "transform:none"), (T, "transform:none")])
|
||
pop(m, f".lb{n}", t0 + 0.24)
|
||
room(m, ".n2", 1.9, GAP + card_h(1))
|
||
enter(m, ".n2 .in", 2.14)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{hist}{d1}{c2}{d3}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Dividers draw out", desc="A model switch or a compaction: room opens, the label pops, the rule draws out from it to both edges.")
|
||
|
||
|
||
m_dividers()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 6 · Jumping to a message — the flash ring fades in and breathes out
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_flash() -> None:
|
||
T = 6.0
|
||
m = Mock("flash", T, 320)
|
||
m.style(
|
||
".fl{position:absolute;left:10px;right:10px;top:0;bottom:64px;overflow:hidden}.sc{position:absolute;left:0;right:0;top:0;display:flex;flex-direction:column;gap:8px;padding-top:10px}"
|
||
".jp{display:inline-flex;border:1px solid var(--border);border-radius:7px;background:var(--card);overflow:hidden}.jp span{width:28px;height:22px;display:grid;place-items:center;color:var(--mfg)}"
|
||
".jp span+span{border-left:1px solid var(--border)}.ring{position:absolute;inset:-4px;border-radius:15px;border:2px solid var(--pr);pointer-events:none}"
|
||
".tgt{position:relative}" + GEOM.replace(".sl{", ".slx{")
|
||
)
|
||
rows = (
|
||
f'<div class="tgt">{you(["add a stale state for the usage widgets"], "09:12")}<i class="ring"></i></div>'
|
||
+ claude(["Done: the widgets are grey until the", "reading lands, then the figures type in."], "09:14")
|
||
+ group("Ran 3 commands, Edited 2 files", 7)
|
||
+ claude(["Committed on home-motion and pushed."], "09:20")
|
||
+ f'<div><span class="jp"><span>{ic("up", 14)}</span><span>{ic("down", 14)}</span></span></div>'
|
||
+ you(["now the notification stacks"], "09:41")
|
||
+ claude(["Stacks now fan out on a tap."], "09:44")
|
||
)
|
||
# tap ▲, the thread smooth-scrolls up (as today), the ring fades in, breathes out
|
||
m.anim(".sc", [(0, "transform:translateY(-246px)"), (1.0, "transform:translateY(-246px)", "cubic-bezier(.4,0,.2,1)"), (1.75, "transform:translateY(0)"), (T - 0.5, "transform:translateY(0)"), (T, "transform:translateY(0)")])
|
||
m.anim(".ring", [(0, "opacity:0;transform:scale(1.04)"), (1.6, "opacity:0;transform:scale(1.04)", EASE_OUT), (1.85, "opacity:1;transform:none"),
|
||
(3.4, "opacity:1;transform:none", "ease-in-out"), (4.2, "opacity:0;transform:none"), (T, "opacity:0")])
|
||
m.fade_cycle()
|
||
body = f'<div class="fl"><div class="sc">{rows}</div></div>' + composer() + m.tap(47, 21, 0.9)
|
||
reg(m, body, "Jump flash: in, hold, breathe out", desc="The arrows, a search hit or a form jump: the thread glides there (as today), the ring fades in (250 ms), holds, then breathes out (800 ms) — on every card, widgets included (today they snap on and off).")
|
||
|
||
|
||
m_flash()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 7 · A summary fold opens
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_fold() -> None:
|
||
T = 6.5
|
||
m = Mock("fold", T, 330)
|
||
m.style(
|
||
GEOM
|
||
+ ".th{bottom:64px}.fd{display:flex;align-items:center;gap:7px;height:18px;font-size:10.5px;color:var(--mfg);white-space:nowrap}"
|
||
".fd .l{flex:1;border-top:1px dashed var(--border)}.fd .lab{display:flex;align-items:center;gap:4px}.fd .cv{transition:none}"
|
||
".body{overflow:hidden}.body .r{padding-top:8px}"
|
||
)
|
||
inner = (
|
||
f'<div class="r r1">{claude(["Reading the parser first."], "10:02")}</div>'
|
||
f'<div class="r r2">{group("Read 4 files", 4)}</div>'
|
||
f'<div class="r r3">{group("Ran 6 commands", 6)}</div>'
|
||
)
|
||
fold = (
|
||
f'<div class="fd"><i class="l"></i><span class="lab"><span class="cv">{ic("chev", 11)}</span><span class="ovl"><span class="w1">3 messages · 10 tools</span><span class="w2">hide 3 messages · 10 tools</span></span></span><i class="l"></i></div>'
|
||
f'<div class="body">{inner}</div>'
|
||
)
|
||
rows = sl(you(["fix the resume offset bug"], "10:01")) + sl(fold, "fo") + sl(claude(["Fixed: the parser resumes at the byte", "offset it stopped at. Tests pass."], "10:19"))
|
||
open_h = 8 + card_h(1) + 8 + ROW + 8 + ROW
|
||
t1, t2 = 0.9, 4.0
|
||
heights(m, ".body", 0, [(t1, open_h, 0.34), (t2, 0, 0.3)])
|
||
m.anim(".cv", [(0, "transform:none"), (t1, "transform:none", EASE_OUT), (t1 + 0.2, "transform:rotate(90deg)"), (t2, "transform:rotate(90deg)", EASE_OUT), (t2 + 0.2, "transform:none"), (T, "transform:none")])
|
||
m.style(".ovl{display:inline-grid;justify-items:center}.ovl>*{grid-area:1/1}.w2{opacity:0}")
|
||
swapto(m, ".w1", ".w2", t1, t2)
|
||
m.anim(".fd .lab", [(0, "color:var(--mfg)"), (t1, "color:var(--mfg)"), (t1 + 0.2, "color:var(--pr)"), (t2, "color:var(--pr)"), (t2 + 0.2, "color:var(--mfg)"), (T, "color:var(--mfg)")])
|
||
for i in (1, 2, 3):
|
||
d = t1 + 0.12 + 0.07 * i
|
||
m.anim(f".r{i}", [(0, "opacity:0;transform:translateY(8px)"), (d, "opacity:0;transform:translateY(8px)", EASE_OUT), (d + 0.34, "opacity:1;transform:none"),
|
||
(t2 - 0.05, "opacity:1;transform:none", EASE_IN), (t2 + 0.15, "opacity:0;transform:none"), (T, "opacity:0;transform:translateY(8px)")])
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer() + m.tap(175, 174, t1) + m.tap(175, 38, t2)
|
||
reg(m, body, "A summary fold opens", desc="The dashed “3 messages · 10 tools” row: its run glides open under it (340 ms) and the rows cascade in (70 ms apart); closing fades them, then the gap closes.")
|
||
|
||
|
||
m_fold()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 8 · Page swaps — Summary ↔ Full, a run finishing (folds to summary), Thread ↔ Changes
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
HDR_CSS = (
|
||
".hdr{position:absolute;left:0;right:0;top:0;height:44px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:7px;padding:0 10px;background:var(--bg);z-index:8}"
|
||
".hdr .tl{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;color:var(--pr);border:1px solid rgba(249,122,31,.55);background:rgba(249,122,31,.13);flex:none}"
|
||
".hdr .tt{flex:1;min-width:0;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden}"
|
||
".hdr .ib{width:26px;height:26px;border-radius:7px;display:grid;place-items:center;color:var(--mfg);flex:none}"
|
||
".hdr .ib.on{color:var(--pr);background:rgba(249,122,31,.1)}"
|
||
)
|
||
|
||
|
||
def m_swap(key: str, style: str) -> None:
|
||
T = 7.0
|
||
m = Mock(key, T, 330)
|
||
m.style(GEOM + HDR_CSS + ".pg{position:absolute;left:0;right:0;top:44px;bottom:64px;overflow:hidden}.th{top:0;bottom:0}"
|
||
".fd{display:flex;align-items:center;gap:7px;height:18px;font-size:10.5px;color:var(--mfg);white-space:nowrap}.fd .l{flex:1;border-top:1px dashed var(--border)}")
|
||
fd = lambda s: f'<div class="fd"><i class="l"></i>{ic("chev", 11)}{s}<i class="l"></i></div>'
|
||
summ = sl(you(["fix the resume offset bug"], "10:01")) + sl(fd("3 messages · 10 tools")) + sl(claude(["Fixed: the parser resumes at the byte", "offset it stopped at. Tests pass."], "10:19"))
|
||
full = (sl(group("Read 4 files", 4)) + sl(claude(["Found it: the offset is reset after", "a compaction."], "10:09")) + sl(group("Ran 6 commands, Edited parse.py", 7))
|
||
+ sl(claude(["Fixed: the parser resumes at the byte", "offset it stopped at. Tests pass."], "10:19")))
|
||
hdr = (f'<div class="hdr"><span class="ib">{ic("arrowl", 14)}</span><span class="tl">{ic("brain", 14)}</span><span class="tt">Resume offset bug</span>'
|
||
f'<span class="ib on sm1">{ic("folds", 14)}</span><span class="ib">{ic("eye", 14)}</span><span class="ib">{ic("panel", 14)}</span></div>')
|
||
t1, t2 = 1.2, 4.3
|
||
if style == "today":
|
||
snap(m, ".pA", t1, "opacity:1", "opacity:0", t2)
|
||
snap(m, ".pB", t1, "opacity:0", "opacity:1", t2)
|
||
elif style == "slide":
|
||
m.anim(".pA", [(0, "transform:none;opacity:1"), (t1, "transform:none;opacity:1", EASE_IN), (t1 + 0.22, "transform:translateX(-40%);opacity:0"),
|
||
(t2 + 0.22, "transform:translateX(-40%);opacity:0", EASE_OUT), (t2 + 0.6, "transform:none;opacity:1"), (T, "transform:none;opacity:1")])
|
||
m.anim(".pB", [(0, "transform:translateX(40%);opacity:0"), (t1 + 0.22, "transform:translateX(40%);opacity:0", EASE_OUT), (t1 + 0.6, "transform:none;opacity:1"),
|
||
(t2, "transform:none;opacity:1", EASE_IN), (t2 + 0.22, "transform:translateX(40%);opacity:0"), (T, "transform:translateX(40%);opacity:0")])
|
||
else: # cross-fade
|
||
m.anim(".pA", [(0, "opacity:1"), (t1, "opacity:1", EASE_OUT), (t1 + 0.3, "opacity:0"), (t2, "opacity:0", EASE_OUT), (t2 + 0.3, "opacity:1"), (T, "opacity:1")])
|
||
m.anim(".pB", [(0, "opacity:0"), (t1, "opacity:0", EASE_OUT), (t1 + 0.3, "opacity:1"), (t2, "opacity:1", EASE_OUT), (t2 + 0.3, "opacity:0"), (T, "opacity:0")])
|
||
m.anim(".sm1", [(0, "background:rgba(249,122,31,.1);color:var(--pr)"), (t1, "background:rgba(249,122,31,.1);color:var(--pr)"), (t1 + 0.15, "background:transparent;color:var(--mfg)"),
|
||
(t2, "background:transparent;color:var(--mfg)"), (t2 + 0.15, "background:rgba(249,122,31,.1);color:var(--pr)"), (T, "background:rgba(249,122,31,.1);color:var(--pr)")])
|
||
m.fade_cycle()
|
||
body = (hdr + f'<div class="pg"><div class="th pA">{summ}</div><div class="th pB" style="opacity:0">{full}</div></div>' + composer()
|
||
+ m.tap(270, 22, t1) + m.tap(270, 22, t2))
|
||
titles = {
|
||
"today": ("Today", "The thread's content is replaced in one frame."),
|
||
"slide": ("A · Slide like tabs", "The page slides out to one side and the other slides in (transform + opacity only — the profile switch's swap). Same for Thread ↔ Changes, and when a finishing run folds the thread into its summary. Recommended."),
|
||
"fade": ("B · Cross-fade", "The two pages cross-fade in place (300 ms)."),
|
||
}
|
||
reg(m, body, titles[style][0], desc=titles[style][1])
|
||
|
||
|
||
for s in ("today", "slide", "fade"):
|
||
m_swap(f"swap-{s}", s)
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 9 · Opening and closing a card (tool, group, thinking, commit, MCP, folds)
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_open(key: str, style: str) -> None:
|
||
T = 6.0
|
||
m = Mock(key, T, 300)
|
||
m.style(GEOM + ".th{bottom:64px}.cv{display:block}")
|
||
out_lines = ["✓ 214 passed · 0 failed", " src/parse.test.ts (38)", " src/outbox.test.ts (52)", " src/motion.test.tsx (17)", "Duration 3.21s"]
|
||
outh = 10 + 15.5 * len(out_lines)
|
||
out = '<div class="out">' + "".join(f'<span class="ol ol{i}" style="display:block">{t}</span>' for i, t in enumerate(out_lines)) + "</div>"
|
||
card = (
|
||
f'<div class="box bx"><div class="tr" style="height:{ROW - 2}px"><span class="cv">{ic("chev", 11, "#777")}</span>{ic("term", 12, "var(--mfg)")}<b>Ran</b>'
|
||
f'<span class="tg">npm test -- --run</span><span class="r">142 ln · 3.2 s</span></div><div class="ob">{out}</div></div>'
|
||
)
|
||
rows = sl(claude(["Running the whole suite once more."], "10:40")) + sl(card) + sl(claude(["All green."], "10:41"))
|
||
t1, t2 = 1.0, 3.9
|
||
m.style(".ob{overflow:hidden}")
|
||
m.anim(".cv", [(0, "transform:none"), (t1, "transform:none", EASE_OUT), (t1 + 0.2, "transform:rotate(90deg)"), (t2, "transform:rotate(90deg)", EASE_OUT), (t2 + 0.2, "transform:none"), (T, "transform:none")])
|
||
if style == "today":
|
||
heights(m, ".ob", 0, [(t1, int(outh)), (t2, 0)], snap_=True)
|
||
else:
|
||
heights(m, ".ob", 0, [(t1, int(outh), 0.3), (t2, 0, 0.26)])
|
||
if style == "glide":
|
||
show(m, ".out", t1 + 0.08, t2 - 0.05, 0.22)
|
||
else: # lines cascade
|
||
for i in range(len(out_lines)):
|
||
d = t1 + 0.1 + 0.05 * i
|
||
m.anim(f".ol{i}", [(0, "opacity:0;transform:translateY(5px)"), (d, "opacity:0;transform:translateY(5px)", EASE_OUT), (d + 0.28, "opacity:1;transform:none"),
|
||
(t2 - 0.08, "opacity:1;transform:none"), (t2 + 0.1, "opacity:0;transform:none"), (T, "opacity:0;transform:translateY(5px)")])
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer() + m.tap(24, 188, t1) + m.tap(24, 101, t2)
|
||
titles = {
|
||
"today": ("Today", "The body snaps open and shut; only the chevron turns."),
|
||
"glide": ("A · Height glides, body fades", "Open: the card's height glides to its body (300 ms) while the body fades in; closing reverses it. Every fold in the thread — tool cards, groups, thinking, commits, MCP and web cards, the prompt / report folds. Recommended."),
|
||
"cascade": ("B · Glide + the lines cascade", "Same glide, the body's lines rising in 50 ms apart."),
|
||
}
|
||
reg(m, body, titles[style][0], desc=titles[style][1])
|
||
|
||
|
||
for s in ("today", "glide", "cascade"):
|
||
m_open(f"open-{s}", s)
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 10 · A call finishing — running dot, then its figures pop in
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_finish() -> None:
|
||
T = 6.0
|
||
m = Mock("finish", T, 260)
|
||
m.style(GEOM + ".th{bottom:64px}.rd{width:6px;height:6px;border-radius:50%;background:var(--amber)}.mf{display:inline-flex;gap:6px}.er .tg,.er b{color:var(--red)}"
|
||
".ed{width:6px;height:6px;border-radius:50%;background:var(--red)}")
|
||
r1 = tool("Ran", "npm test -- --run", right='<i class="rd d1"></i><span class="mf"><span class="f1">142 ln</span><span class="f2">3.2 s</span></span>')
|
||
r2 = tool("Edited", "motion.tsx", "pen", right='<i class="rd d2"></i><span class="mf"><span class="add f3">+12</span><span class="del f4">−3</span></span>')
|
||
r3 = tool("Ran", "npm run lint", cls="r3", right='<i class="rd d3"></i><i class="ed f5"></i>')
|
||
rows = sl(claude(["Checking everything before the commit."], "10:44")) + sl(r1) + sl(r2) + sl(r3)
|
||
for d in (1, 2, 3):
|
||
m.anim(f".d{d}", [(0, "opacity:.35"), (0.6, "opacity:1", "ease-in-out"), (1.2, "opacity:.35", "ease-in-out"), (1.8, "opacity:1", "ease-in-out"), (T, "opacity:1")])
|
||
for d, t0 in ((".d1", 2.0), (".d2", 2.6), (".d3", 3.4)):
|
||
m.anim(d, [(0, "opacity:1;transform:none;width:6px"), (t0, "opacity:1;transform:none;width:6px", EASE_IN), (t0 + 0.18, "opacity:0;transform:scale(.3);width:0"), (T, "opacity:0;width:0")])
|
||
pop(m, ".f1", 2.18, origin="100% 50%")
|
||
pop(m, ".f2", 2.27, origin="100% 50%")
|
||
pop(m, ".f3", 2.78, origin="100% 50%")
|
||
pop(m, ".f4", 2.87, origin="100% 50%")
|
||
pop(m, ".f5", 3.58)
|
||
m.anim(".r3 b,.r3 .tg", [(0, "color:inherit"), (3.4, "color:var(--fg)", EASE_OUT), (3.8, "color:var(--red)"), (T, "color:var(--red)")])
|
||
m.style(".r3 .tg{color:var(--mfg)}")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "A call finishing", desc="While a call runs, a small amber dot breathes on its row (today nothing marks it). When the result lands the dot goes and the row's figures pop in left to right — lines, duration, +/−; a failure tints the row red and pops its red dot.")
|
||
|
||
|
||
m_finish()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 11 · Calls folding into a group, the group growing
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_grow() -> None:
|
||
T = 8.0
|
||
m = Mock("grow", T, 330)
|
||
m.style(GEOM + ".th{bottom:64px}.gx{position:relative}.ia,.ib{display:grid}.ib{position:absolute;left:21px;top:7px}"
|
||
".nm{display:inline-block;overflow:hidden;white-space:nowrap;vertical-align:bottom}.cnt{display:inline-block;min-width:8px;text-align:right}"
|
||
".gb{overflow:hidden}.gb .tr{border:0;border-top:1px solid var(--border);border-radius:0;background:transparent}")
|
||
# one row whose label retypes: “Ran git status” → “Ran 2 commands” → “Ran 3 commands”
|
||
head = (f'<div class="tr gx" style="border:0;border-radius:0"><span class="cv">{ic("chev", 11, "#777")}</span><span class="ia">{ic("term", 12, "var(--mfg)")}</span>'
|
||
f'<span class="ib">{ic("layers", 13, "var(--mfg)")}</span><b>Ran</b><span><span class="nm n0 tg">git status</span><span class="nm n1">2 commands</span>'
|
||
f'<span class="nm n2">3 commands</span></span><span class="r"><span class="ovl"><span class="cnt c2">2</span><span class="cnt c3">3</span></span></span></div>')
|
||
sub = lambda t, cls: f'<div class="tr {cls}">{ic("term", 12, "var(--mfg)")}<b>Ran</b><span class="tg">{t}</span><span class="r">4 ln</span></div>'
|
||
gbody = f'<div class="gb">{sub("git status", "")}{sub("git diff --stat", "")}<div class="sx3">{sub("git log -3", "")}</div></div>'
|
||
card = f'<div class="box">{head}{gbody}</div>'
|
||
rows = sl(you(["rebase the branch on main and push"], "10:49")) + sl(claude(["Let me look at the branch first."], "10:50")) + sl(card)
|
||
ta, tb, to, tc = 1.2, 2.8, 3.8, 5.2
|
||
# retyping: backspace to the shared prefix (“Ran ”), type the rest
|
||
m.anim(".n0", [(0, "width:58px"), (ta, "width:58px", "steps(6)"), (ta + 0.3, "width:0"), (T, "width:0")])
|
||
m.anim(".n1", [(0, "width:0"), (ta + 0.3, "width:0", "steps(10)"), (ta + 0.75, "width:72px"), (tb, "width:72px", "steps(10)"), (tb + 0.32, "width:0"), (T, "width:0")])
|
||
m.anim(".n2", [(0, "width:0"), (tb + 0.32, "width:0", "steps(10)"), (tb + 0.72, "width:72px"), (T, "width:72px")])
|
||
m.style(".n0{color:var(--mfg);font:10.5px var(--mono)}.ovl{display:inline-grid}.ovl>*{grid-area:1/1}")
|
||
m.anim(".c2", [(0, "opacity:0;transform:scale(.4)"), (ta + 0.3, "opacity:0;transform:scale(.4)", SPRING), (ta + 0.62, "opacity:1;transform:none"),
|
||
(tb + 0.2, "opacity:1;transform:none", EASE_IN), (tb + 0.5, "opacity:0;transform:translateY(8px)"), (T, "opacity:0;transform:translateY(8px)")], extra="transform-origin:100% 50%")
|
||
m.anim(".c3", [(0, "transform:translateY(-8px);opacity:0"), (tb + 0.2, "transform:translateY(-8px);opacity:0", EASE_OUT), (tb + 0.5, "transform:none;opacity:1"), (T, "transform:none;opacity:1")])
|
||
# the terminal icon becomes the group's layers
|
||
m.anim(".ia", [(0, "opacity:1;transform:none"), (ta, "opacity:1;transform:none", EASE_IN), (ta + 0.18, "opacity:0;transform:scale(.4)"), (T, "opacity:0;transform:scale(.4)")])
|
||
pop(m, ".ib", ta + 0.2)
|
||
# opened (tap), then a third call makes room inside it and rises in
|
||
m.anim(".cv", [(0, "transform:none"), (to, "transform:none", EASE_OUT), (to + 0.2, "transform:rotate(90deg)"), (T, "transform:rotate(90deg)")])
|
||
heights(m, ".gb", 0, [(to, 2 * (ROW - 1) + 2, 0.3), (tc, 3 * (ROW - 1) + 3, 0.24)])
|
||
m.style(".gb .tr{height:28px}")
|
||
heights(m, ".sx3", 0, [(tc, ROW, 0.24)])
|
||
enter(m, ".sx3 .tr", tc + 0.24, "translateY(10px)")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…") + m.tap(24, 252, to)
|
||
reg(m, body, "Calls fold into a group, the group grows", desc="Today a second call remounts the row as a group (closed, its title typed from empty). Instead the same row becomes the group: the icon pops to the group's, the label backspaces to “Ran ” and types “2 commands”, the count pops; an open group gives each new call room, then it rises in.")
|
||
|
||
|
||
m_grow()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 12 · Widgets
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
WCSS = (
|
||
".wc{border:1px solid var(--border);border-radius:12px;background:var(--card);overflow:hidden}"
|
||
".wh{display:flex;align-items:center;gap:6px;padding:7px 10px;font-size:11.5px;white-space:nowrap}"
|
||
".wh .lbl{font-weight:600;overflow:hidden;text-overflow:ellipsis;min-width:0}"
|
||
".chip{border:1px solid #3a3a3a;border-radius:999px;padding:1px 7px;font:10px var(--mono);color:var(--mfg)}"
|
||
".fold{display:flex;align-items:center;gap:4px;padding:4px 12px;font-size:10.5px;color:var(--mfg);border-top:1px solid #222}"
|
||
".bt{display:inline-flex;align-items:center;gap:4px;border-radius:8px;padding:4px 9px;font-size:11px;font-weight:600;white-space:nowrap}"
|
||
".bt.p{background:var(--pr);color:#0a0a0a}.bt.o{border:1px solid var(--border);color:var(--fg)}"
|
||
".ov{position:relative;display:grid}.ov>*{grid-area:1/1}"
|
||
)
|
||
|
||
|
||
def m_subagent() -> None:
|
||
T = 7.0
|
||
m = Mock("subagent", T, 300)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.sa{position:relative}.sa .bg{position:absolute;inset:0;border-radius:12px;pointer-events:none}"
|
||
".bg.a{border:1px solid rgba(245,158,11,.45);background:rgba(245,158,11,.06)}.bg.b{border:1px solid rgba(249,122,31,.4);background:rgba(249,122,31,.05)}"
|
||
".rs{font:600 10px var(--mono);color:var(--amber);letter-spacing:.04em}.dn{font:10px var(--mono);color:var(--mfg)}.rep{overflow:hidden}")
|
||
card = (
|
||
f'<div class="wc sa" style="border:0;background:transparent"><i class="bg a"></i><i class="bg b"></i>'
|
||
f'<div class="wh" style="position:relative"><span class="ov"><span class="sp">{ic("loader", 14, "var(--amber)", "spin")}</span><span class="bo">{ic("bot", 14, "var(--pr)")}</span></span>'
|
||
f'<span class="chip">Explore</span><span class="lbl">Inventory widget states</span>'
|
||
f'<span class="ov" style="margin-left:auto"><span class="rs">RUNNING · <span class="mono">8m 31s</span></span><span class="dn">68 msg · 192K · €1.04</span></span>{ic("chev", 12, "#777")}</div>'
|
||
f'<div class="fold" style="position:relative">{ic("chev", 10)}prompt</div><div class="rep"><div class="fold" style="position:relative">{ic("chev", 10)}report</div></div></div>'
|
||
)
|
||
rows = sl(group("Ran 4 commands, Read 3 files", 7)) + sl(claude(["One background agent inventories the", "widgets while I take screenshots."], "10:12")) + sl(card)
|
||
t = 2.6
|
||
hide(m, ".bg.a", t, None, 0.45)
|
||
show(m, ".bg.b", t, None, 0.45)
|
||
shrink(m, ".sp", t, 0.18)
|
||
pop(m, ".bo", t + 0.16)
|
||
hide(m, ".rs", t, None, 0.18)
|
||
m.anim(".dn", [(0, "clip-path:inset(0 100% 0 0)"), (t + 0.2, "clip-path:inset(0 100% 0 0)", "steps(20)"), (t + 0.75, "clip-path:inset(0 0 0 0)"), (T, "clip-path:inset(0 0 0 0)")])
|
||
heights(m, ".rep", 0, [(t + 0.5, 24, 0.24)])
|
||
enter(m, ".rep .fold", t + 0.74, "translateY(8px)")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Subagent card: running → finished", desc="Amber cross-fades to the finished colour (450 ms), the spinner shrinks and the bot pops, RUNNING · 8m 31s gives way to its figures typing in, and the report fold makes room then rises in.")
|
||
|
||
|
||
m_subagent()
|
||
|
||
|
||
def m_form() -> None:
|
||
T = 8.0
|
||
m = Mock("form", T, 330)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.fh{display:flex;align-items:center;gap:6px;padding:3px 10px;font-size:9.5px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--mfg);background:#161616;border-bottom:1px solid #222}"
|
||
".wt{display:inline-flex;align-items:center;gap:4px;color:var(--amber);text-transform:none;letter-spacing:0}.wt i{width:6px;height:6px;border-radius:50%;background:currentColor}"
|
||
".fb{padding:8px 10px}.ft{font-size:12.5px;font-weight:600;margin-bottom:6px}.acts{display:flex;align-items:center;gap:8px;overflow:hidden}"
|
||
".rc{overflow:hidden}.rc dl{display:grid;grid-template-columns:96px 1fr;gap:3px 10px;margin:0;font-size:11px}.rc dt{color:var(--mfg)}.rc dd{margin:0}")
|
||
recap = "".join(f'<dt class="k{i}">{k}</dt><dd class="k{i}">{v}</dd>' for i, (k, v) in enumerate([("Pace", "As shown"), ("New rows", "Rise from below"), ("Next step", "Implement + deploy")]))
|
||
card = (
|
||
f'<div class="wc"><div class="fh">{ic("form", 11)}ask-form<span class="ov"><span class="wt w1"><i></i>agent is waiting</span><span class="wt w2" style="color:var(--em)">{ic("check", 10)}answered</span></span></div>'
|
||
f'<div class="fb"><div class="ft">Conversation motion — your picks</div><div class="acts"><span class="bt p">Answer ↗</span><span class="bt o">Revoke</span><span class="dim" style="font-size:10.5px">13 questions</span></div>'
|
||
f'<div class="rc"><dl>{recap}</dl></div></div></div>'
|
||
)
|
||
rows = sl(group("Wrote 41 mockups", 41)) + sl(claude(["Mockups are ready — the form has one", "question per motion."], "11:20")) + sl(card)
|
||
t = 2.8
|
||
m.style(".w2{opacity:0}")
|
||
show(m, ".w2", t + 0.15, None, 0.2)
|
||
hide(m, ".w1", t, None, 0.15)
|
||
pop(m, ".w2", t + 0.15, origin="0 50%")
|
||
m.anim(".w1 i", [(0, "opacity:1"), (0.5, "opacity:.3", "ease-in-out"), (1.1, "opacity:1", "ease-in-out"), (1.7, "opacity:.3", "ease-in-out"), (2.3, "opacity:1"), (T, "opacity:1")])
|
||
heights(m, ".acts", 24, [(t, 0, 0.24)])
|
||
m.anim(".acts>*", [(0, "opacity:1;transform:none"), (t - 0.05, "opacity:1;transform:none", EASE_IN), (t + 0.15, "opacity:0;transform:scale(.6)"), (T, "opacity:0")])
|
||
heights(m, ".rc", 0, [(t + 0.25, 3 * 17 + 4, 0.28)])
|
||
for i in range(3):
|
||
m.anim(f".k{i}", [(0, "clip-path:inset(0 100% 0 0)"), (t + 0.5 + 0.35 * i, "clip-path:inset(0 100% 0 0)", "steps(16)"), (t + 0.85 + 0.35 * i, "clip-path:inset(0 0 0 0)"), (T, "clip-path:inset(0 0 0 0)")])
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Form card: waiting → answered", desc="The action row shrinks away (its gap closing), the waiting tag gives way to a popped “answered”, and the answers make room then type in, one line after another. Same for hub forms, AskUserQuestion and a Workflow's phase chips (they pop green).")
|
||
|
||
|
||
m_form()
|
||
|
||
|
||
def m_ask() -> None:
|
||
T = 6.5
|
||
m = Mock("ask", T, 280)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.ak{position:relative;border-radius:12px;padding:9px 11px}.ak .bg{position:absolute;inset:0;border-radius:12px}"
|
||
".bg.a{border:1px solid rgba(245,158,11,.45);background:rgba(245,158,11,.06)}.bg.b{border:1px solid var(--border);background:var(--card)}"
|
||
".aq{position:relative;display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600}.ops{position:relative;display:flex;gap:6px;margin-top:8px}"
|
||
".ops .bt{border:1px solid var(--border);color:var(--fg)}.ops .o1{position:relative}.af{position:relative;margin-top:6px;font-size:10.5px;color:var(--mfg);overflow:hidden;height:0}")
|
||
card = (
|
||
f'<div class="ak"><i class="bg a"></i><i class="bg b"></i><div class="aq">{ic("bell", 13, "var(--amber)")}Deploy the change now?</div>'
|
||
f'<div class="ops"><span class="bt o1">{ic("check", 11)}Deploy</span><span class="bt o2">Wait</span><span class="bt o3">Skip</span></div>'
|
||
f'<div class="af"><span class="afl">answered in the app · 11:31</span></div></div>'
|
||
)
|
||
rows = sl(group("Ran 3 commands", 3)) + sl(claude(["Everything is merged on main."], "11:30")) + sl(card)
|
||
t = 1.6
|
||
m.style(".bg.b{opacity:0}.o1 svg{width:0}")
|
||
m.anim(".o1", [(0, "background:transparent;border-color:var(--border);color:var(--fg)"), (t, "background:transparent;border-color:var(--border);color:var(--fg)", EASE_OUT),
|
||
(t + 0.2, "background:rgba(249,122,31,.12);border-color:rgba(249,122,31,.5);color:var(--pr)"), (T, "background:rgba(249,122,31,.12);border-color:rgba(249,122,31,.5);color:var(--pr)")])
|
||
m.anim(".o1 svg", [(0, "width:0"), (t + 0.2, "width:0", SPRING), (t + 0.5, "width:11px"), (T, "width:11px")])
|
||
shrink(m, ".o3", t + 0.15, 0.2)
|
||
shrink(m, ".o2", t + 0.24, 0.2)
|
||
hide(m, ".bg.a", t + 0.3, None, 0.45)
|
||
show(m, ".bg.b", t + 0.3, None, 0.45)
|
||
heights(m, ".af", 0, [(t + 0.5, 16, 0.22)])
|
||
m.anim(".afl", [(0, "clip-path:inset(0 100% 0 0)"), (t + 0.72, "clip-path:inset(0 100% 0 0)", "steps(24)"), (t + 1.3, "clip-path:inset(0 0 0 0)"), (T, "clip-path:inset(0 0 0 0)")])
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…") + m.tap(51, 193, t)
|
||
reg(m, body, "notify-ask: a tap answers it", desc="The tapped option lights and gets its check, the others shrink away (stagger), the amber card cross-fades to neutral and “answered in the app · 11:31” types in under it.")
|
||
|
||
|
||
m_ask()
|
||
|
||
|
||
def m_commit() -> None:
|
||
T = 7.0
|
||
m = Mock("commit", T, 300)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.cm{height:58px;border:1px solid rgba(249,122,31,.42);border-radius:12px;background:var(--card);padding:6px 10px}"
|
||
".cl{display:flex;align-items:center;gap:6px;font-size:11.5px;white-space:nowrap}.sha{font:10.5px var(--mono);color:var(--pr)}"
|
||
".cp{display:flex;gap:5px;margin-top:5px}.mg{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--mfg);white-space:nowrap;height:20px}")
|
||
commit = (
|
||
f'<div class="cm"><div class="cl">{ic("chev", 11, "#777")}{ic("commit", 12, "var(--pr)")}<span class="sha">dff31ad</span>'
|
||
f'<span style="overflow:hidden;text-overflow:ellipsis">feat(images): open in a browser tab</span>'
|
||
f'<span class="mono" style="margin-left:auto;font-size:10px"><span class="add">+812</span> <span class="del">−34</span></span></div>'
|
||
f'<div class="cp"><span class="tag">{ic("fork", 9)}open-image-file</span><span class="tag">21 files</span><span class="pl em n pu" style="padding:1px 7px">{ic("check", 9)}pushed</span></div></div>'
|
||
)
|
||
merged = f'<div class="mg">{ic("merge", 12)}Merged <b style="color:var(--fg)">open-image-file</b> into <b style="color:var(--fg)">main</b><span class="sha">e4a7235</span></div>'
|
||
rows = sl(you(["commit it and merge to main"], "11:09")) + sl(group("Ran 2 commands", 2)) + sl(claude(["Committing the fix on the branch."], "11:10")) + sl(commit, "n1") + sl(merged, "n2")
|
||
room(m, ".n1", 0.8, GAP + 58)
|
||
enter(m, ".n1 .in", 1.04)
|
||
pop(m, ".pu", 2.3, origin="0 50%")
|
||
room(m, ".n2", 3.6, GAP + 20)
|
||
enter(m, ".n2 .in", 3.84, "translateY(10px)")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Commit cards", desc="A commit arrives like any row; its “pushed” pill pops in when the push lands; the merge line makes room then rises; the diff opens with the shared glide.")
|
||
|
||
|
||
m_commit()
|
||
|
||
|
||
def m_media() -> None:
|
||
T = 7.5
|
||
m = Mock("media", T, 340)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.dh{display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:9.5px;font-weight:600;letter-spacing:.05em;color:var(--mfg);border-bottom:1px solid #222}"
|
||
".db{position:relative;overflow:hidden}.dw{display:flex;align-items:center;gap:6px;padding:8px 10px;font-size:11px;color:var(--mfg)}"
|
||
".pv{position:absolute;left:10px;right:10px;top:8px;height:96px;border-radius:8px;background:#1b1b1b;overflow:hidden}"
|
||
".pv .site{position:absolute;inset:0;background:linear-gradient(160deg,#1f2937,#0f172a);}"
|
||
".pv .site i{position:absolute;left:12px;right:60px;height:8px;border-radius:3px;background:#334155}.pv .u{position:absolute;left:10px;right:10px;bottom:8px;font:10px var(--mono);color:var(--sky)}"
|
||
".im{position:relative;height:0;overflow:hidden}.im .ph2{position:absolute;inset:6px 10px;border-radius:8px;background:#1d1d1d}"
|
||
".im .pic{position:absolute;inset:6px 10px;border-radius:8px;background:linear-gradient(135deg,#7c2d12,#f97a1f 45%,#fde68a);}")
|
||
dep = (
|
||
f'<div class="wc"><div class="dh">{ic("rocket", 11)}DEPLOY<span class="chip">deploy.sh</span></div><div class="db">'
|
||
f'<div class="dw w1">{ic("loader", 12, "var(--pr)", "spin")}deploying…</div>'
|
||
f'<div class="pv"><div class="site"><i style="top:14px"></i><i style="top:30px;right:120px"></i><i style="top:46px;right:90px"></i></div><span class="u">ai-agent.lab.gabvdl.xyz</span></div></div></div>'
|
||
)
|
||
shot = (f'<div class="wc"><div class="dh">{ic("image", 11)}SCREENSHOT<span class="chip">conv-phone.jpeg</span></div>'
|
||
f'<div class="dw w2">{ic("loader", 12, "var(--pr)", "spin")}capturing…</div><div class="im"><i class="ph2"></i><i class="pic"></i></div></div>')
|
||
rows = sl(claude(["Deploying, then a phone screenshot."], "11:40")) + sl(dep) + sl(shot)
|
||
t1, t2 = 1.8, 4.4
|
||
heights(m, ".db", 32, [(t1, 112, 0.3)])
|
||
hide(m, ".w1", t1 - 0.1, None, 0.15)
|
||
show(m, ".pv", t1 + 0.18, None, 0.35)
|
||
m.anim(".pv .u", [(0, "clip-path:inset(0 100% 0 0)"), (t1 + 0.5, "clip-path:inset(0 100% 0 0)", "steps(22)"), (t1 + 1.0, "clip-path:inset(0 0 0 0)"), (T, "clip-path:inset(0 0 0 0)")])
|
||
m.anim(".w2", [(0, "height:30px;padding:8px 10px;opacity:1"), (t2, "height:30px;padding:8px 10px;opacity:1", EASE_OUT), (t2 + 0.2, "height:0;padding:0 10px;opacity:0"), (m.T, "height:0;padding:0 10px;opacity:0")])
|
||
m.style(".w2{overflow:hidden}")
|
||
heights(m, ".im", 0, [(t2, 92, 0.3)])
|
||
show(m, ".pic", t2 + 0.7, None, 0.45)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Deploy and screenshot cards", desc="“deploying…” / “capturing…” give way to the result: the card's height glides to the preview's size, the room shows grey (empty, no shimmer) and the picture fades in once it has loaded; the URL types in.")
|
||
|
||
|
||
m_media()
|
||
|
||
|
||
def m_monitor() -> None:
|
||
T = 7.5
|
||
m = Mock("monitor", T, 330)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.mw{overflow:hidden}.mh{display:flex;align-items:center;gap:6px;padding:7px 10px;font-size:11.5px;white-space:nowrap}"
|
||
".lv{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:1px 7px;font-size:9.5px;font-weight:600;color:var(--sky);background:rgba(56,189,248,.12)}"
|
||
".lv i{width:5px;height:5px;border-radius:50%;background:currentColor}.bar{height:3px;margin:0 10px 6px;border-radius:2px;background:var(--muted);overflow:hidden}"
|
||
".bar b{display:block;height:100%;background:var(--sky);border-radius:2px}.ev{overflow:hidden}.ev span{display:block;padding:2px 10px;font:10px/16px var(--mono);color:#bbb}"
|
||
".mrow{position:absolute;left:0;right:0;top:0}")
|
||
evs = ["phase 1/6 · building image", "phase 2/6 · standby healthy", "phase 3/6 · traefik cut over"]
|
||
mon = (
|
||
f'<div class="wc mw" style="position:relative"><div class="mcard"><div class="mh">{ic("eye", 12, "var(--sky)")}<b>Monitor</b><span class="tg dim mono" style="font-size:10.5px">deploy phases</span>'
|
||
f'<span class="lv" style="margin-left:auto"><i></i>watching</span></div><div class="bar"><b></b></div>'
|
||
+ "".join(f'<div class="ev e{i}"><span>{e}</span></div>' for i, e in enumerate(evs))
|
||
+ f'</div><div class="mrow">{tool("Monitored", "deploy phases (done)", "eye", right="3 events")}</div></div>'
|
||
)
|
||
rows = sl(group("Ran 2 commands", 2)) + sl(claude(["Merged. Starting the blue-green deploy,", "detached; watching its phases."], "11:42")) + sl(mon, "mo")
|
||
full = 7 + 26 + 9 + 3 * 20 + 2
|
||
m.style(".ev{height:0}.ev.e0{height:20px}.mrow{opacity:0}")
|
||
m.anim(".bar b", [(0, "width:16%"), (1.4, "width:16%", EASE_OUT), (2.4, "width:33%"), (3.4, "width:33%", EASE_OUT), (4.4, "width:50%"), (T, "width:50%")])
|
||
for i, t0 in ((1, 1.4), (2, 3.4)):
|
||
heights(m, f".e{i}", 0, [(t0, 20, 0.24)])
|
||
enter(m, f".e{i} span", t0 + 0.24, "translateY(8px)")
|
||
m.anim(".lv i", [(0, "opacity:1"), (0.6, "opacity:.3", "ease-in-out"), (1.2, "opacity:1"), (T, "opacity:1")])
|
||
# it ends: the card folds back into its compact tool row
|
||
tf = 5.4
|
||
heights(m, ".mw", full - 20 * 2 + 0, [(1.4, full - 20, 0.24), (3.4, full, 0.24), (tf, ROW, 0.32)])
|
||
hide(m, ".mcard", tf, None, 0.2)
|
||
show(m, ".mrow", tf + 0.12, None, 0.25)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "Monitor and wake-up cards", desc="Each event makes room in the card, then rises in; when the watch ends the card folds back into its compact tool row (a height glide and a cross-fade) instead of being swapped out. A wake-up's “in 4 min” rolls like the other figures.")
|
||
|
||
|
||
m_monitor()
|
||
|
||
|
||
def m_error() -> None:
|
||
T = 7.5
|
||
m = Mock("error", T, 320)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.er{border:1px solid rgba(239,68,68,.32);background:rgba(239,68,68,.05);border-radius:12px;padding:8px 11px}"
|
||
".eh{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--red);margin-bottom:3px}.et{font-size:12px}"
|
||
".rb{display:flex;align-items:center;gap:7px;margin-top:8px;overflow:hidden;height:26px}.rz{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--mfg);height:0;overflow:hidden}"
|
||
".cd{display:inline-block;height:14px;overflow:hidden;vertical-align:bottom}.cd span{display:block;line-height:14px}")
|
||
err = (
|
||
f'<div class="er"><div class="eh">{ic("alert", 12)}Usage limit reached</div><div class="et">You hit the 5-hour limit. It resets at 14:00.</div>'
|
||
f'<div class="rb"><span class="bt p r1">Resume at 14:00</span><span class="bt o r2">Resume now</span><span class="dim r3" style="font-size:10.5px">in 2 h <span class="cd"><span class="cdi"><span>14</span><span>13</span></span></span> min</span></div>'
|
||
f'<div class="rz"><span>{ic("loader", 12, "var(--pr)", "spin")}</span><span class="rzt">resuming on the work account…</span></div></div>'
|
||
)
|
||
rows = sl(group("Ran 5 commands", 5)) + sl(err, "n1") + sl(claude(["Picking up where I stopped: the e2e run."], "12:02"), "n2")
|
||
room(m, ".n1", 0.6, GAP + 37 + 19 + 34 + 4)
|
||
enter(m, ".n1 .in", 0.84)
|
||
m.anim(".cdi", [(0, "transform:none"), (2.0, "transform:none", EASE_OUT), (2.45, "transform:translateY(-14px)"), (T, "transform:translateY(-14px)")])
|
||
t = 3.4
|
||
for i, sel in enumerate((".r2", ".r1", ".r3")):
|
||
shrink(m, sel, t + 0.07 * i, 0.18)
|
||
heights(m, ".rb", 26, [(t + 0.2, 0, 0.22)])
|
||
heights(m, ".rz", 0, [(t + 0.2, 22, 0.22)])
|
||
m.anim(".rzt", [(0, "clip-path:inset(0 100% 0 0)"), (t + 0.42, "clip-path:inset(0 100% 0 0)", "steps(26)"), (t + 1.0, "clip-path:inset(0 0 0 0)"), (T, "clip-path:inset(0 0 0 0)")])
|
||
room(m, ".n2", 5.3, GAP + card_h(1))
|
||
enter(m, ".n2 .in", 5.54)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer() + m.tap(172, 200, t)
|
||
reg(m, body, "An error card and its Resume", desc="It arrives like any row; “in 2 h 14 min” rolls as it counts down; a tap on Resume shrinks the buttons away and “resuming…” types in its place, then the run's next row rises below.")
|
||
|
||
|
||
m_error()
|
||
|
||
|
||
def m_end() -> None:
|
||
T = 8.5
|
||
m = Mock("end", T, 330)
|
||
m.style(GEOM + WCSS + ".th{bottom:64px}.cc{display:flex;align-items:center;gap:5px;margin-top:5px;font-size:10px;color:var(--mfg)}"
|
||
".cd{display:inline-block;height:13px;overflow:hidden;vertical-align:bottom}.cd span{display:block;line-height:13px}"
|
||
".sm{border:1px solid var(--border);border-radius:12px;background:var(--card);padding:8px 11px}.sm .s1{display:flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600}"
|
||
".ex{display:flex;justify-content:center}.ex .pl{color:var(--amber)}")
|
||
last = claude(["Deployed and pushed. Everything is", "on main."], "12:20")
|
||
last = last[: -len("</div>")] + f'<div class="cc cdw">{ic("clock", 10)}cache warm · <span class="cd"><span class="cdi"><span>2</span><span>1</span></span></span> min left</div></div>'
|
||
summ = f'<div class="sm"><div class="s1">{ic("check", 13, "var(--em)")}<span class="stl">Summary — Conversation page motion</span>{ic("chev", 11, "#777")}</div></div>'
|
||
exp = f'<div class="ex"><span class="pl amber n xp" style="text-transform:none">{ic("clock", 10)}Cache expired just now</span></div>'
|
||
rows = sl(group("Ran 3 commands", 3)) + sl(last, "n0") + sl(summ, "n1") + sl(exp, "n2")
|
||
m.style(".n0 .c{height:auto}")
|
||
show(m, ".cdw", 0.94, 5.0, 0.25)
|
||
m.anim(".cdi", [(0, "transform:none"), (2.2, "transform:none", EASE_OUT), (2.65, "transform:translateY(-13px)"), (T, "transform:translateY(-13px)")])
|
||
room(m, ".n1", 3.2, GAP + 37)
|
||
enter(m, ".n1 .in", 3.44)
|
||
m.anim(".stl", [(0, "clip-path:inset(0 100% 0 0)"), (3.8, "clip-path:inset(0 100% 0 0)", "steps(30)"), (4.5, "clip-path:inset(0 0 0 0)"), (T, "clip-path:inset(0 0 0 0)")])
|
||
m.anim(".n0", [(0, f"height:{GAP + card_h(2)}px"), (0.7, f"height:{GAP + card_h(2)}px", EASE_OUT), (0.94, f"height:{GAP + card_h(2) + 18}px"),
|
||
(5.2, f"height:{GAP + card_h(2) + 18}px", EASE_OUT), (5.44, f"height:{GAP + card_h(2)}px"), (T, f"height:{GAP + card_h(2)}px")])
|
||
room(m, ".n2", 5.3, GAP + 20)
|
||
pop(m, ".xp", 5.54)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer()
|
||
reg(m, body, "The thread's end: cache, summary", desc="The cache countdown makes room under Claude's last message, its minutes roll; the run's published summary makes room and rises, its title typing; at expiry the countdown leaves (gap closes) and “Cache expired” pops at the thread's end.")
|
||
|
||
|
||
m_end()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 13 · Around the composer and the floating gizmos
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
WAIT_CSS = (
|
||
".wt2{position:absolute;left:10px;right:10px;z-index:3;border:1px solid rgba(239,68,68,.4);background:#160d0d;border-radius:12px;padding:8px 10px}"
|
||
".wt2 .a{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600}.wt2 .a .ago{margin-left:auto;font:10px var(--mono);color:var(--mfg)}"
|
||
".wt2 .b{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:10.5px;color:var(--mfg)}"
|
||
)
|
||
|
||
|
||
def m_waiting(key: str, style: str) -> None:
|
||
T = 7.5
|
||
m = Mock(key, T, 340)
|
||
WH = 64 # the waiting card + its gap
|
||
m.style(GEOM + WAIT_CSS + ".th{bottom:var(--tb)}.ws{position:absolute;left:0;right:0;bottom:64px;overflow:hidden;z-index:3}.wt2{bottom:0}")
|
||
rows = (sl(claude(["Three questions before I build it."], "12:30")) + sl(group("Wrote clarifier brief", 1))
|
||
+ sl(f'<div class="tr">{ic("bot", 12, "var(--pr)")}<span class="chip">clarifier</span><span class="tg">Ask about the motion picks</span><span class="r" style="color:var(--amber)">waiting</span></div>'))
|
||
card = (f'<div class="wt2"><div class="a">{ic("form", 13, "var(--red)")}Conversation motion — your picks<span class="ago">2 min</span></div>'
|
||
f'<div class="b"><span class="bt p">Answer ↗</span>13 questions · from the clarifier</div></div>')
|
||
t1, t2 = 1.0, 4.6
|
||
if style == "today":
|
||
snap(m, ".th", t1, "bottom:64px", f"bottom:{64 + WH}px", t2)
|
||
snap(m, ".ws", t1, "height:0", f"height:{WH}px", t2)
|
||
else:
|
||
m.anim(".th", [(0, "bottom:64px"), (t1, "bottom:64px", EASE_OUT), (t1 + 0.24, f"bottom:{64 + WH}px"), (t2 + 0.32, f"bottom:{64 + WH}px", EASE_OUT), (t2 + 0.56, "bottom:64px"), (T, "bottom:64px")])
|
||
heights(m, ".ws", 0, [(t1, WH, 0.24), (t2 + 0.32, 0, 0.24)])
|
||
frm = "translateY(70px)" if style == "rise" else "translateY(-70px)"
|
||
m.anim(".wt2", [(0, f"transform:{frm};opacity:0"), (t1 + 0.24, f"transform:{frm};opacity:0", EASE_OUT), (t1 + 0.66, "transform:none;opacity:1"),
|
||
(t2, "transform:none;opacity:1", EASE_IN), (t2 + 0.32, f"transform:{frm};opacity:0"), (T, f"transform:{frm};opacity:0")])
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div><div class="ws" style="height:0">{card}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
titles = {
|
||
"today": ("Today", "The card appears above the composer in one frame and the whole thread jumps up by its height; when it's answered it vanishes and the thread drops back."),
|
||
"rise": ("A · Rises from behind the composer", "Room first — the thread's foot glides up — then the card rises out from behind the composer (420 ms); answered, it sinks back behind it and the room closes. Recommended."),
|
||
"drop": ("B · Drops into its slot", "Same room; the card comes down into it from above (like the home's banners) and goes back up."),
|
||
}
|
||
reg(m, body, titles[style][0], desc=titles[style][1])
|
||
|
||
|
||
for s in ("today", "rise", "drop"):
|
||
m_waiting(f"waiting-{s}", s)
|
||
|
||
|
||
def m_tasks() -> None:
|
||
T = 9.0
|
||
m = Mock("tasks", T, 330)
|
||
m.style(
|
||
GEOM + ".th{bottom:64px}.tp{position:absolute;right:10px;top:10px;z-index:9;width:206px;border:1px solid var(--border);border-radius:12px;background:rgba(18,18,18,.96);"
|
||
"box-shadow:0 8px 22px -8px rgba(0,0,0,.7);overflow:hidden;transform-origin:100% 0}"
|
||
".tph{display:flex;align-items:center;gap:6px;padding:5px 9px;border-bottom:1px solid var(--border);font-size:11px;font-weight:600}"
|
||
".tph .ct{font:600 10px var(--mono);color:var(--amber)}.tph .mn{margin-left:auto;color:var(--mfg)}"
|
||
".tl{padding:4px 6px}.tk{display:flex;align-items:center;gap:6px;font-size:10px;line-height:15px;overflow:hidden}.tk>span{padding:2px 3px}"
|
||
".bx2{position:relative;width:12px;height:12px;flex:none}.bx2>*{position:absolute;inset:0}.bx2 .e{border:1px solid #666;border-radius:3px}"
|
||
".bx2 .f{border-radius:3px;background:var(--em);display:grid;place-items:center;color:#fff}.bx2 .s{display:grid;place-items:center}"
|
||
".tx2{position:relative;white-space:nowrap}.tx2 .stk{position:absolute;left:0;top:50%;height:1px;width:100%;background:var(--mfg);transform-origin:0 50%;transform:scaleX(0)}"
|
||
".cd{display:inline-block;height:13px;overflow:hidden;vertical-align:bottom}.cd span{display:block;line-height:13px}"
|
||
".pill2{position:absolute;right:10px;top:10px;z-index:9;display:flex;align-items:center;gap:5px;border:1px solid var(--border);border-radius:999px;background:var(--card);padding:3px 9px;"
|
||
"font:600 10.5px var(--mono);color:var(--amber);transform-origin:100% 0}"
|
||
)
|
||
tasks = ["Inventory the widgets", "Build the mockups", "Send the form"]
|
||
tl = "".join(
|
||
f'<div class="tk k{i}"><span class="bx2"><i class="e"></i><span class="s s{i}">{ic("loader", 11, "var(--amber)", "spin")}</span><span class="f f{i}">{ic("check", 9, "#fff", sw=3.5)}</span></span>'
|
||
f'<span class="tx2 x{i}">{t}<i class="stk k{i}s"></i></span></div>' for i, t in enumerate(tasks))
|
||
panel = (f'<div class="tp"><div class="tph">{ic("list", 12, "var(--amber)")}Tasks<span class="ct"><span class="cd"><span class="cdi"><span>0</span><span>1</span><span>2</span></span></span>/3</span>'
|
||
f'<span class="mn">{ic("minus", 12)}</span></div><div class="tl">{tl}</div></div>')
|
||
pill = f'<div class="pill2">{ic("list", 12)}2/3</div>'
|
||
rows = sl(claude(["Breaking this into three tasks."], "09:58")) + sl(group("Created 3 tasks", 3)) + sl(group("Ran 4 commands", 4)) + sl(claude(["The inventory is back."], "10:20"))
|
||
# in from the right edge; tasks make room then rise; one finishes: box fills, strike draws, count rolls
|
||
m.anim(".tp", [(0, "transform:translateX(240px)"), (0.6, "transform:translateX(240px)", EASE_OUT), (1.12, "transform:none"),
|
||
(5.6, "transform:none", EASE_IN), (5.85, "transform:scale(.35);opacity:0"), (7.0, "transform:scale(.35);opacity:0", SPRING), (7.35, "transform:none;opacity:1"), (T, "transform:none;opacity:1")])
|
||
for i in range(3):
|
||
t0 = 1.15 + 0.25 * i
|
||
m.anim(f".k{i}", [(0, "height:0;opacity:0"), (t0, "height:0;opacity:0", EASE_OUT), (t0 + 0.24, "height:19px;opacity:1"), (T, "height:19px;opacity:1")])
|
||
m.style(".s1,.s2,.f0,.f1,.f2{opacity:0}")
|
||
hide(m, ".s0", 2.8, None, 0.15)
|
||
pop(m, ".f0", 2.85)
|
||
m.anim(".k0s", [(0, "transform:scaleX(0)"), (2.95, "transform:scaleX(0)", EASE_OUT), (3.3, "transform:scaleX(1)"), (T, "transform:scaleX(1)")])
|
||
m.anim(".x0", [(0, "color:var(--fg)"), (2.95, "color:var(--fg)"), (3.3, "color:var(--mfg)"), (T, "color:var(--mfg)")])
|
||
show(m, ".s1", 3.0, 4.2, 0.15)
|
||
pop(m, ".f1", 4.25)
|
||
m.anim(".k1s", [(0, "transform:scaleX(0)"), (4.35, "transform:scaleX(0)", EASE_OUT), (4.7, "transform:scaleX(1)"), (T, "transform:scaleX(1)")])
|
||
m.anim(".x1", [(0, "color:var(--fg)"), (4.35, "color:var(--fg)"), (4.7, "color:var(--mfg)"), (T, "color:var(--mfg)")])
|
||
m.anim(".cdi", [(0, "transform:none"), (2.9, "transform:none", EASE_OUT), (3.3, "transform:translateY(-13px)"), (4.3, "transform:translateY(-13px)", EASE_OUT), (4.7, "transform:translateY(-26px)"), (T, "transform:translateY(-26px)")])
|
||
m.anim(".pill2", [(0, "opacity:0;transform:scale(.5)"), (5.75, "opacity:0;transform:scale(.5)", SPRING), (6.05, "opacity:1;transform:none"), (6.95, "opacity:1;transform:none", EASE_IN), (7.1, "opacity:0;transform:scale(.5)"), (T, "opacity:0;transform:scale(.5)")])
|
||
m.style(".k0 .tx2,.k1 .tx2{color:var(--fg)}.k2 .tx2{color:#ddd}.tk.k1 .tx2{font-weight:500}")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>{panel}{pill}' + composer(placeholder="Send to interrupt & continue…") + m.tap(330, 22, 5.5) + m.tap(330, 22, 6.9)
|
||
reg(m, body, "The task panel", desc="It slides in from the right edge with the first task; each task makes room then shows; a task done fills its box (pop), the strike draws across, x/3 rolls. Collapsing shrinks the panel into its pill toward the corner and back.")
|
||
|
||
|
||
m_tasks()
|
||
|
||
|
||
def m_gizmos() -> None:
|
||
T = 8.0
|
||
m = Mock("gizmos", T, 300)
|
||
m.style(GEOM + ".th{bottom:64px;padding-bottom:42px}.gz svg.rg{transform:rotate(-90deg)}.rg .tk{stroke:#333}.rg .vl{stroke:var(--pr);stroke-dasharray:31.4;stroke-dashoffset:25.7}"
|
||
".cd{display:inline-block;height:14px;overflow:hidden;vertical-align:bottom}.cd span{display:block;line-height:14px}.gzr{display:flex;gap:6px;position:absolute;right:10px;bottom:74px;z-index:6}"
|
||
".gzr .gz{position:static}.dp{width:34px;height:22px;border-radius:6px;background:linear-gradient(160deg,#1f2937,#0f172a);border:1px solid #3a3a3a}")
|
||
ring = '<svg class="rg" width="14" height="14" viewBox="0 0 12 12"><circle class="tk" cx="6" cy="6" r="5" fill="none" stroke-width="2"/><circle class="vl" cx="6" cy="6" r="5" fill="none" stroke-width="2" stroke-linecap="round"/></svg>'
|
||
ff = f'<div class="gz l ff">{ic("ff", 12)}3×</div>'
|
||
right = (f'<div class="gzr"><div class="gz dg">{ic("rocket", 11)}<i class="dp"></i></div>'
|
||
f'<div class="gz cx">{ring}<span><span class="cd"><span class="cdi"><span>18</span><span>31</span><span>72</span></span></span>%</span></div></div>')
|
||
rows = sl(you(["go ahead and deploy"], "12:40")) + sl(group("Ran 2 commands", 2)) + sl(claude(["Building the image now."], "12:41"))
|
||
m.anim(".ff", [(0, "transform:translateX(-90px);color:var(--mfg);border-color:var(--border)"), (0.8, "transform:translateX(-90px);color:var(--mfg);border-color:var(--border)", EASE_OUT), (1.3, "transform:none;color:var(--mfg);border-color:var(--border)"),
|
||
(2.0, "transform:none;color:var(--mfg);border-color:var(--border)", "ease-out"), (2.08, "transform:scale(.94);color:var(--pr);border-color:var(--pr)"), (2.5, "transform:scale(.94);color:var(--pr);border-color:var(--pr)", "ease-out"), (2.6, "transform:none;color:var(--mfg);border-color:var(--border)"),
|
||
(6.2, "transform:none;color:var(--mfg);border-color:var(--border)", EASE_IN), (6.6, "transform:translateX(-90px);color:var(--mfg);border-color:var(--border)"), (T, "transform:translateX(-90px)")])
|
||
pop(m, ".cx", 1.1, origin="100% 100%")
|
||
m.anim(".vl", [(0, "stroke-dashoffset:25.7;stroke:var(--pr)"), (2.6, "stroke-dashoffset:25.7;stroke:var(--pr)", EASE_OUT), (3.1, "stroke-dashoffset:21.7;stroke:var(--pr)"),
|
||
(4.6, "stroke-dashoffset:21.7;stroke:var(--pr)", EASE_OUT), (5.1, "stroke-dashoffset:8.8;stroke:var(--amber)"), (T, "stroke-dashoffset:8.8;stroke:var(--amber)")])
|
||
m.anim(".cdi", [(0, "transform:none"), (2.6, "transform:none", EASE_OUT), (3.05, "transform:translateY(-14px)"), (4.6, "transform:translateY(-14px)", EASE_OUT), (5.05, "transform:translateY(-28px)"), (T, "transform:translateY(-28px)")])
|
||
m.anim(".cx", [(0, "opacity:0;transform:scale(.4);color:var(--mfg)"), (1.1, "opacity:0;transform:scale(.4);color:var(--mfg)", SPRING), (1.42, "opacity:1;transform:none;color:var(--mfg)"),
|
||
(4.6, "opacity:1;transform:none;color:var(--mfg)"), (5.1, "opacity:1;transform:none;color:var(--amber)"), (T, "opacity:1;transform:none;color:var(--amber)")], extra="transform-origin:100% 100%")
|
||
m.anim(".dg", [(0, "opacity:0;transform:scale(.4);margin-right:-50px"), (3.6, "opacity:0;transform:scale(.4);margin-right:-50px", EASE_OUT), (3.84, "opacity:0;transform:scale(.4);margin-right:0"),
|
||
(3.84, "opacity:0;transform:scale(.4);margin-right:0", SPRING), (4.16, "opacity:1;transform:none;margin-right:0"), (T, "opacity:1;transform:none;margin-right:0")], extra="transform-origin:100% 100%")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>{ff}{right}' + composer(placeholder="Send to interrupt & continue…") + m.tap(32, 215, 2.1)
|
||
reg(m, body, "The corner gizmos", desc="3× slides in from the left edge when a run starts and back out when it ends (a press shrinks it a little); the context ring pops in from its corner, sweeps and rolls as it fills (turning amber past 70 %); the deploy preview makes room beside it and pops in with the first deploy.")
|
||
|
||
|
||
m_gizmos()
|
||
|
||
|
||
def m_pending() -> None:
|
||
T = 6.5
|
||
m = Mock("pending", T, 300)
|
||
m.style(GEOM + ".fl{position:absolute;left:10px;right:10px;top:0;bottom:64px;overflow:hidden}.sc{position:absolute;left:0;right:0;top:0;display:flex;flex-direction:column;gap:8px;padding-top:10px}"
|
||
".ps{position:absolute;left:50%;bottom:72px;z-index:7;display:flex;align-items:center;gap:5px;border:1px solid rgba(249,122,31,.3);border-radius:999px;background:rgba(18,18,18,.92);"
|
||
"padding:4px 11px;font-size:10.5px;font-weight:500;color:var(--pr);white-space:nowrap;transform:translateX(-50%)}")
|
||
rows = (claude(["Here is the plan for the parser: keep", "the byte offset across compactions."], "10:02") + group("Read 4 files", 4)
|
||
+ claude(["The offset was reset after each", "compaction — fixed, tests pass."], "10:19") + group("Ran 2 commands", 2)
|
||
+ you(["also check the resume path"], "10:24", head_extra=f'<span class="pl pr n" style="padding:0 6px;font-size:9px;margin-left:2px">{ic("loader", 9, "currentColor", "spin")}queued</span>').replace('<span class="ts">· Nov 3, 10:24</span>', ''))
|
||
strip = f'<div class="ps">{ic("down", 13)}1 waiting · 1 queued</div>'
|
||
m.anim(".sc", [(0, "transform:none"), (3.3, "transform:none", "cubic-bezier(.4,0,.2,1)"), (4.0, "transform:translateY(-78px)"), (T, "transform:translateY(-78px)")])
|
||
m.anim(".ps", [(0, "transform:translate(-50%,60px);opacity:0"), (0.9, "transform:translate(-50%,60px);opacity:0", EASE_OUT), (1.32, "transform:translate(-50%,0);opacity:1"),
|
||
(3.2, "transform:translate(-50%,0);opacity:1", EASE_IN), (3.5, "transform:translate(-50%,60px);opacity:0"), (T, "transform:translate(-50%,60px);opacity:0")])
|
||
m.fade_cycle()
|
||
body = f'<div class="fl"><div class="sc">{rows}</div></div>{strip}' + composer() + m.tap(180, 217, 3.1)
|
||
reg(m, body, "“Waiting” strip while you're scrolled up", desc="Scrolled up while your message waits at the thread's foot: the strip rises from behind the composer; a tap glides the thread down (as today) and the strip sinks back.")
|
||
|
||
|
||
m_pending()
|
||
|
||
|
||
def m_gen() -> None:
|
||
T = 7.0
|
||
m = Mock("gen", T, 280)
|
||
m.style(GEOM + ".th{bottom:64px}.gp{border:1px solid rgba(56,189,248,.35);background:rgba(56,189,248,.05);border-radius:9px;padding:6px 10px;font-size:11px}"
|
||
".gp .a{display:flex;align-items:center;gap:6px;white-space:nowrap}.gp .a b{color:var(--sky);font-weight:600}.gp .dt{color:var(--mfg);font-family:var(--mono);font-size:10px}"
|
||
".gp .br{height:3px;margin-top:5px;border-radius:2px;background:var(--muted);overflow:hidden}.gp .br i{display:block;height:100%;background:var(--sky);border-radius:2px}"
|
||
".pd{position:relative;width:7px;height:7px}.pd i{position:absolute;inset:0;border-radius:50%;background:var(--sky)}")
|
||
strip = f'<div class="gp"><div class="a"><span class="pd"><i class="p1"></i><i></i></span><b>generating</b><span class="dt">qwen 3.8 · 412 tok · 38 tok/s</span></div><div class="br"><i></i></div></div>'
|
||
rows = sl(you(["summarize the radar feed"], "08:00")) + sl(strip, "g") + sl(claude(["Six items today, two worth reading."], "08:01"), "n2")
|
||
room(m, ".g", 0.7, GAP + 44)
|
||
enter(m, ".g .in", 0.94)
|
||
m.anim(".br i", [(0, "width:4%"), (1.3, "width:4%", EASE_OUT), (2.0, "width:34%"), (2.6, "width:34%", EASE_OUT), (3.3, "width:71%"), (T, "width:71%")])
|
||
m.anim(".p1", [(0, "transform:scale(1);opacity:.6"), (0.8, "transform:scale(2.2);opacity:0"), (0.81, "transform:scale(1);opacity:.6"), (1.6, "transform:scale(2.2);opacity:0"), (T, "transform:scale(2.2);opacity:0")])
|
||
hide(m, ".g .in", 4.0, None, 0.2)
|
||
heights(m, ".g", 0, [(0.7, GAP + 44), (4.2, 0, 0.24)])
|
||
room(m, ".n2", 4.2, GAP + card_h(1))
|
||
enter(m, ".n2 .in", 4.44)
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>' + composer(placeholder="Send to interrupt & continue…")
|
||
reg(m, body, "A local model's progress strip", desc="A pi run on the EVOX2 with nothing in its transcript yet: the strip makes room then rises; when the first real row lands, the strip fades and its gap closes while the row comes in.")
|
||
|
||
|
||
m_gen()
|
||
|
||
|
||
def m_menu() -> None:
|
||
T = 6.5
|
||
m = Mock("menu", T, 300)
|
||
m.style(GEOM + ".th{bottom:64px}.mm{position:absolute;left:128px;top:158px;z-index:9;width:170px;border:1px solid var(--border);border-radius:10px;background:#171717;"
|
||
"box-shadow:0 12px 28px -8px rgba(0,0,0,.8);padding:4px;transform-origin:0 0}.mm>span{display:flex;align-items:center;gap:7px;padding:6px 8px;border-radius:6px;font-size:11.5px}"
|
||
".mm .c2{background:#222}.lift{position:relative}.cpd{color:var(--em)}.ovl{display:grid}.ovl>*{grid-area:1/1;display:flex;align-items:center;gap:7px}")
|
||
msg = f'<div class="lift">{you(["make the summary fold glide open", "instead of snapping"], "10:01")}</div>'
|
||
rows = sl(claude(["Done — the folds glide now."], "09:58")) + sl(msg) + sl(claude(["Pushed on conv-motion."], "10:03"))
|
||
menu = (f'<div class="mm"><span>{ic("fork", 12)}Edit & fork</span><span class="c2"><span class="ovl"><span class="cpy">{ic("copy", 12)}Copy</span>'
|
||
f'<span class="cpd">{ic("check", 12)}Copied</span></span></span></div>')
|
||
t1, t2, t3 = 0.9, 2.6, 3.8
|
||
m.anim(".lift", [(0, "transform:none;box-shadow:none"), (t1 + 0.4, "transform:none;box-shadow:none", EASE_OUT), (t1 + 0.6, "transform:scale(1.015);box-shadow:0 10px 24px -10px rgba(0,0,0,.9)"),
|
||
(t3, "transform:scale(1.015);box-shadow:0 10px 24px -10px rgba(0,0,0,.9)", EASE_OUT), (t3 + 0.2, "transform:none;box-shadow:none"), (T, "transform:none;box-shadow:none")], extra="border-radius:12px")
|
||
m.anim(".mm", [(0, "opacity:0;transform:scale(.9)"), (t1 + 0.45, "opacity:0;transform:scale(.9)", EASE_OUT), (t1 + 0.63, "opacity:1;transform:none"),
|
||
(t3, "opacity:1;transform:none", EASE_IN), (t3 + 0.14, "opacity:0;transform:scale(.95)"), (T, "opacity:0")])
|
||
hide(m, ".cpy", t2 + 0.1, None, 0.12)
|
||
pop(m, ".cpd", t2 + 0.12, origin="0 50%")
|
||
m.fade_cycle()
|
||
body = f'<div class="th">{rows}</div>{menu}' + composer() + m.tap(128, 158, t1) + m.tap(170, 207, t2)
|
||
reg(m, body, "Your message's menu", desc="Long-press your message: it lifts a little and the menu grows from the press point (180 ms); Copy turns into a popped “Copied”; the menu shrinks back. The Edit & fork dialog, the deploy's full-screen preview and the Browser panel open the same way — from where you tapped.")
|
||
|
||
|
||
m_menu()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# 14 · The header
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def m_retitle() -> None:
|
||
T = 5.5
|
||
m = Mock("retitle", T, 120)
|
||
m.style(HDR_CSS + ".hdr{position:relative}.tt{position:relative}.t0,.t1{display:inline-block;overflow:hidden;white-space:nowrap;vertical-align:bottom}"
|
||
".t0{color:var(--mfg);font-style:italic;font-weight:500}.sub{padding:6px 12px;font:10px var(--mono);color:var(--mfg)}")
|
||
hdr = (f'<div class="hdr"><span class="ib">{ic("arrowl", 14)}</span><span class="tl">{ic("brain", 14)}</span>'
|
||
f'<span class="tt"><span class="t0">You are the mail secretary. Once a day you…</span><span class="t1">Mail recap · 3 new</span></span>'
|
||
f'<span class="ib">{ic("eye", 14)}</span><span class="ib">{ic("panel", 14)}</span></div><div class="sub">sonnet-5-5 · gabrielvidal/homelab · just now</div>')
|
||
m.anim(".t0", [(0, "width:220px"), (1.0, "width:220px", "steps(16)"), (1.5, "width:0"), (T, "width:0")])
|
||
m.anim(".t1", [(0, "width:0"), (1.5, "width:0", "steps(18)"), (2.2, "width:130px"), (T, "width:130px")])
|
||
m.fade_cycle()
|
||
reg(m, hdr, "The title retypes", desc="Haiku's short title replaces a long auto title: the old one backspaces, the new one types in (the home cards' CardTitle).")
|
||
|
||
|
||
m_retitle()
|
||
|
||
|
||
def m_interrupt() -> None:
|
||
T = 7.5
|
||
m = Mock("interrupt", T, 120)
|
||
m.style(HDR_CSS + ".hdr{position:relative}.stp{display:flex;align-items:center;gap:5px;height:26px;border:1px solid rgba(244,63,94,.35);border-radius:7px;padding:0 8px;"
|
||
"font-size:11px;font-weight:600;color:var(--rose);white-space:nowrap;overflow:hidden;flex:none}.ov2{display:grid}.ov2>*{grid-area:1/1}"
|
||
".tl{position:relative}.tl .ring{position:absolute;inset:-4px;border-radius:11px;border:2px solid var(--em);opacity:0}.tl .arc{position:absolute;inset:-2px;border-radius:9px;"
|
||
"border:2px solid transparent;border-top-color:var(--pr);animation:spin 1.4s linear infinite}.sub{padding:6px 12px;font:10px var(--mono);color:var(--mfg)}.ovl{display:inline-grid}.ovl>*{grid-area:1/1}.l2{opacity:0}")
|
||
hdr = (f'<div class="hdr"><span class="ib">{ic("arrowl", 14)}</span><span class="tl">{ic("brain", 14)}<i class="arc"></i><i class="ring"></i></span>'
|
||
f'<span class="tt">Conversation page motion</span><span class="stp"><span class="ov2"><span class="i1">{ic("stop", 13)}</span><span class="i2">{ic("loader", 13, "currentColor", "spin")}</span></span>'
|
||
f'<span class="ovl"><span class="l1">Interrupt</span><span class="l2">Stopping…</span></span></span><span class="ib">{ic("eye", 14)}</span><span class="ib">{ic("panel", 14)}</span></div>'
|
||
f'<div class="sub">opus-5-5 · gabrielvidal/homelab · just now</div>')
|
||
t1, t2, t3 = 0.8, 3.0, 4.4
|
||
m.anim(".stp", [(0, "width:0;padding:0;opacity:0;border-width:0;transform:scale(.4)"), (t1, "width:0;padding:0 0;opacity:0;border-width:0;transform:scale(.4)", EASE_OUT),
|
||
(t1 + 0.24, "width:86px;padding:0 8px;opacity:0;border-width:1px;transform:scale(.4)", SPRING), (t1 + 0.56, "width:86px;padding:0 8px;opacity:1;border-width:1px;transform:none"),
|
||
(t2, "width:86px;padding:0 8px;opacity:1;border-width:1px;transform:none", EASE_OUT), (t2 + 0.2, "width:98px;padding:0 8px;opacity:.75;border-width:1px;transform:none"),
|
||
(t3, "width:98px;padding:0 8px;opacity:.75;border-width:1px;transform:none", EASE_IN), (t3 + 0.2, "width:98px;padding:0 8px;opacity:0;border-width:1px;transform:scale(.4)"),
|
||
(t3 + 0.44, "width:0;padding:0;opacity:0;border-width:0;transform:scale(.4)"), (T, "width:0;padding:0;opacity:0;border-width:0")])
|
||
m.style(".i2{opacity:0}")
|
||
snap(m, ".i1", t2, "opacity:1", "opacity:0")
|
||
snap(m, ".i2", t2, "opacity:0", "opacity:1")
|
||
swapto(m, ".l1", ".l2", t2)
|
||
m.style(".tl .arc{animation:none;border-top-color:var(--pr)}")
|
||
m.anim(".tl .arc", [(0, "opacity:1;transform:rotate(0)"), (t3, "opacity:1;transform:rotate(1080deg)", EASE_OUT), (t3 + 0.25, "opacity:0;transform:rotate(1150deg)"), (T, "opacity:0")])
|
||
m.anim(".tl .ring", [(0, "opacity:0;transform:none"), (t3 + 0.2, "opacity:0;transform:none", EASE_OUT), (t3 + 0.35, "opacity:1;transform:none"), (t3 + 1.0, "opacity:0;transform:scale(1.3)"), (T, "opacity:0")])
|
||
m.fade_cycle()
|
||
body = hdr + m.tap(241, 22, t2)
|
||
reg(m, body, "Interrupt and the state tile", desc="Interrupt pops in when a run starts (its neighbours glide over); a tap retypes it “Stopping…”; when the run stops it shrinks out, the gap closes, and the tile's running arc ends in one ring pulse — the home card's ending.")
|
||
|
||
|
||
m_interrupt()
|
||
|
||
|
||
def m_changes() -> None:
|
||
T = 6.0
|
||
m = Mock("changes", T, 120)
|
||
m.style(HDR_CSS + ".hdr{position:relative}.seg{display:flex;align-items:center;gap:2px;height:26px;border:1px solid var(--border);border-radius:7px;padding:2px;overflow:hidden;flex:none;white-space:nowrap}"
|
||
".seg>span{display:flex;align-items:center;gap:4px;height:100%;border-radius:5px;padding:0 6px;font-size:11px;font-weight:500;color:var(--mfg)}.seg>.on{background:rgba(249,122,31,.1);color:var(--pr)}"
|
||
".cd{display:inline-block;height:13px;overflow:hidden;vertical-align:bottom}.cd i{display:block;line-height:13px;font-style:normal}.sub{padding:6px 12px;font:10px var(--mono);color:var(--mfg)}")
|
||
hdr = (f'<div class="hdr"><span class="ib">{ic("arrowl", 14)}</span><span class="tl">{ic("brain", 14)}</span><span class="tt">Conversation page motion</span>'
|
||
f'<span class="seg"><span class="on">{ic("msgs", 12)}</span><span>{ic("commit", 12)}<span class="mono"><span class="cd"><span class="cdi"><i>1</i><i>2</i></span></span></span></span></span>'
|
||
f'<span class="ib">{ic("eye", 14)}</span><span class="ib">{ic("panel", 14)}</span></div><div class="sub">opus-5-5 · gabrielvidal/homelab · just now</div>')
|
||
m.anim(".seg", [(0, "width:0;padding:0;border-width:0;opacity:0;transform:scale(.4)"), (1.0, "width:0;padding:0;border-width:0;opacity:0;transform:scale(.4)", EASE_OUT),
|
||
(1.24, "width:72px;padding:2px;border-width:1px;opacity:0;transform:scale(.4)", SPRING), (1.56, "width:72px;padding:2px;border-width:1px;opacity:1;transform:none"), (T, "width:72px;opacity:1;transform:none")])
|
||
m.anim(".cdi", [(0, "transform:none"), (3.2, "transform:none", EASE_OUT), (3.65, "transform:translateY(-13px)"), (T, "transform:translateY(-13px)")])
|
||
m.fade_cycle()
|
||
reg(m, hdr, "The Changes tab appears", desc="With the first commit the Thread | Changes switch makes room (the title gives way) and pops in; every later commit rolls its count.")
|
||
|
||
|
||
m_changes()
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# chapters — the review page's sections and the form's questions
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
SECTIONS = [
|
||
("thread", "The thread"),
|
||
("tools", "Tool cards"),
|
||
("widgets", "Widgets"),
|
||
("around", "Composer and corners"),
|
||
("header", "Header"),
|
||
]
|
||
|
||
CHAPTERS = [
|
||
dict(id="arrive", sec="thread", kind="radio", default="arrive-rise",
|
||
eyebrow="Every row that lands while you watch", title="A new row arrives",
|
||
q="A new row in the thread (a message, a tool call, any widget)",
|
||
lede="Today a row's whole height lands in one frame, so the thread jumps up, then the row fades up 4 px. The home page's rule, applied to the thread: room first, then the row enters.",
|
||
mocks=["arrive-today", "arrive-rise", "arrive-side", "arrive-fade"],
|
||
spec=["<b>Room</b>: the slot opens from 0 to the row's height (240 ms). The thread is pinned to the bottom, so the rows above glide up.",
|
||
"<b>Enter</b>: then the row comes in (380 ms). Every kind: Claude's message, a tool call or group, every widget card.",
|
||
"<b>Only live arrivals move.</b> History, a cached repaint and a catch-up backlog (rows older than 30 s) land at once, as today.",
|
||
"Same pace as today: rows still come one after another, about 3 a second."]),
|
||
dict(id="typing", sec="thread", kind="radio", default="typing-glide",
|
||
eyebrow="Claude typing", title="The message grows line by line",
|
||
q="Claude's message while it types",
|
||
lede="The typewriter stays. What changes is the card around it: today each wrapped line adds 19 px at once and the whole thread hops a line.",
|
||
mocks=["typing-today", "typing-glide", "typing-caret"],
|
||
spec=["The card's height eases to each new line (180 ms); the pinned thread follows it.",
|
||
"A table still reveals header first, then row by row, with the same glide.",
|
||
"Holding 3× still speeds the typing and the glide up together."]),
|
||
dict(id="echo", sec="thread", kind="radio", default="echo-morph",
|
||
eyebrow="The message you send", title="Sent → queued → landed",
|
||
q="Your message, from send to landed",
|
||
lede="Today the echo appears at once and pulses; when the transcript has your message the echo unmounts and the real one arrives later on its own, so there is a gap and a second arrival.",
|
||
mocks=["echo-today", "echo-morph", "echo-xfade"],
|
||
spec=["The composer's 3 s un-send window stays as it is.",
|
||
"<b>Out</b>: room opens at the thread's foot, then the card rises out of the composer.",
|
||
"<b>Queued</b>: the pill retypes sending… → queued, and the “after this step” row (Cancel · Stop & send now) glides open.",
|
||
"<b>Landed</b>: the transcript's copy takes the same spot. The pill shrinks away and the time types in. The whole-card pulse goes; the pill's spinner says it's on its way."]),
|
||
dict(id="thread-more", sec="thread", kind="multi",
|
||
eyebrow="Smaller moments in the thread", title="Tags, dividers, jumps and folds",
|
||
q="Also in the thread (untick what you don't want)",
|
||
lede="Each follows a home-page rule: pills pop, text types, rules draw, nothing snaps.",
|
||
mocks=["pills", "dividers", "flash", "fold"],
|
||
spec=["<b>Status tags</b>: interrupted, paused, held, mid-turn, cancelled pop in after their room.",
|
||
"<b>Dividers</b>: model switch and compaction. The label pops, the rule draws out to both edges.",
|
||
"<b>Jump flash</b>: the ring fades in (250 ms), holds, then breathes out (800 ms). Widgets too; today their ring snaps.",
|
||
"<b>Summary folds</b>: the run glides open under its dashed row and its rows cascade in (70 ms apart)."]),
|
||
dict(id="swap", sec="thread", kind="radio", default="swap-slide",
|
||
eyebrow="When the whole view changes", title="Summary ↔ Full, Thread ↔ Changes",
|
||
q="Switching what the page shows",
|
||
lede="The header's Summary / Full toggle, a run that finishes while you watch (the thread folds into its summary), and Thread ↔ Changes. Today the content is replaced in one frame.",
|
||
mocks=["swap-today", "swap-slide", "swap-fade"],
|
||
spec=["Moved as one piece: the profile switch's rule (<code>swapPage</code>), transform + opacity only, nothing re-laid out row by row.",
|
||
"The direction follows the toggle: to Full or Changes slides left, back slides right.",
|
||
"You land where you were reading, as today."]),
|
||
dict(id="open", sec="tools", kind="radio", default="open-glide",
|
||
eyebrow="Every fold in the thread", title="Opening and closing a card",
|
||
q="Opening and closing any card",
|
||
lede="Every <code><details></code> on the page snaps open and shut today; only its chevron turns. That covers tool cards, groups, thinking, commits, MCP and web cards, a subagent's prompt / report, and a compaction's summary.",
|
||
mocks=["open-today", "open-glide", "open-cascade"],
|
||
spec=["Open: the height glides to the body (300 ms) while the body fades in; close: 260 ms.",
|
||
"A card opening while you're pinned to the bottom pushes the thread up smoothly.",
|
||
"A long output (a 2 000-line log) opens with a capped glide, so it never takes longer than a short one."]),
|
||
dict(id="tools-more", sec="tools", kind="multi",
|
||
eyebrow="A call's life", title="Running, finishing, grouping",
|
||
q="Tool calls (untick what you don't want)",
|
||
lede="A running call looks the same as a finished one today, and its figures snap in. A second call in a row remounts the first as a group: it closes and its title types again from empty.",
|
||
mocks=["finish", "grow"],
|
||
spec=["<b>Finishing</b>: a small amber dot breathes while the call runs. On the result it goes and the figures pop in left to right. A failure tints the row red.",
|
||
"<b>Grouping</b>: the same row turns into the group, so nothing remounts. The icon pops, the label backspaces to the shared “Ran ” and types the rest, and an open group stays open. In an open group each new call makes room, then rises in."]),
|
||
dict(id="widgets", sec="widgets", kind="multi",
|
||
eyebrow="The cards that change state", title="Widgets",
|
||
q="Widgets (untick what you don't want)",
|
||
lede="Every widget flips state in one frame today: colours, badges, the action rows swapped for results. Each change below becomes a move.",
|
||
mocks=["subagent", "form", "ask", "commit", "media", "monitor", "error", "end"],
|
||
spec=["<b>Subagent</b>: amber cross-fades to done, the spinner gives way to the bot, the figures type in and the report fold makes room.",
|
||
"<b>Forms</b>: the action row shrinks away, “answered” pops and the answers type in. Hub forms, AskUserQuestion and Workflow phases work the same way.",
|
||
"<b>notify-ask</b>: the tapped option lights up, the others shrink away and the card cross-fades to neutral.",
|
||
"<b>Commits</b>: the “pushed” pill pops, and the merge line makes room and rises.",
|
||
"<b>Deploy / screenshot</b>: the card glides to the preview's size. The room stays grey (no shimmer) until the picture fades in.",
|
||
"<b>Monitor / wake-up</b>: events make room and rise; at the end the card folds into its tool row.",
|
||
"<b>Errors</b>: the countdown rolls; Resume shrinks the buttons and “resuming…” types in.",
|
||
"<b>Thread's end</b>: the cache countdown makes room and rolls, the summary rises and its title types, then “Cache expired” pops."]),
|
||
dict(id="waiting", sec="around", kind="radio", default="waiting-rise",
|
||
eyebrow="A question waiting on you", title="The card above the composer",
|
||
q="The waiting card above the composer",
|
||
lede="A form or a notify-ask waiting on you sits right above the composer. Today it appears in one frame and the thread jumps up by its height.",
|
||
mocks=["waiting-today", "waiting-rise", "waiting-drop"],
|
||
spec=["Room first: the thread's foot glides up by the card's height (240 ms).",
|
||
"Then the card comes in (420 ms). Answered, it leaves the same way and the room closes."]),
|
||
dict(id="around-more", sec="around", kind="multi",
|
||
eyebrow="Floating over the thread", title="Task panel, gizmos, strips and menus",
|
||
q="Floating pieces (untick what you don't want)",
|
||
lede="The corner gizmos, the task panel, the strips and the menus all mount and unmount in one frame today.",
|
||
mocks=["tasks", "gizmos", "pending", "gen", "menu"],
|
||
spec=["<b>Task panel</b>: slides in from the right edge. A task makes room, its box pops, the strike draws and x/n rolls. Collapse shrinks it into its pill.",
|
||
"<b>Corner gizmos</b>: 3× slides in from the left while a run streams. The context ring pops in and turns amber past 70 %. The deploy preview makes room beside it.",
|
||
"<b>Waiting strip</b>: rises from behind the composer when you've scrolled up, and sinks back after the jump.",
|
||
"<b>Local-model strip</b>: makes room and rises, then fades out with its gap closing when the first row lands.",
|
||
"<b>Menus and previews</b>: they grow from where you tapped: the message menu, Edit & fork, the deploy preview, the Browser panel."]),
|
||
dict(id="header", sec="header", kind="multi",
|
||
eyebrow="Above the thread", title="The header",
|
||
q="Header (untick what you don't want)",
|
||
lede="Three header changes happen live today, each in one frame.",
|
||
mocks=["retitle", "interrupt", "changes"],
|
||
spec=["<b>Title</b>: Haiku's short title backspaces the long one and types in.",
|
||
"<b>Interrupt</b>: pops in when a run starts; “Stopping…” retypes; it shrinks out when the run stops, and the tile ends with a ring pulse.",
|
||
"<b>Changes tab</b>: makes room and pops in with the first commit; its count rolls."]),
|
||
]
|
||
|
||
STILL = [
|
||
("Typing", "Claude's messages, a tool's target, a group's title (it already backspaces to the shared prefix)."),
|
||
("Rolling figures", "Every count, cost, duration and token figure (<code>Roll</code>)."),
|
||
("Bars and rings", "The Monitor and local-model progress bars, the wake-up ring and the context ring's sweep."),
|
||
("Spinners and pulses", "Running spinners, the waiting dots and the lead tile's running arc."),
|
||
("The composer", "The composer itself (round of 11-02: guideline pills, resources row, toolbar rise, the un-send sweep)."),
|
||
("Modals", "The Fresh-context sheet already uses the library modal's own entrance."),
|
||
]
|
||
LATER = [
|
||
("Details drawer", "The Details drawer's cards: costs, subagents, commits, forms, plans, memories. Their figures already roll, but cards appear and reorder in one frame."),
|
||
("Changes view", "The Changes view itself: the commit list, the diff and the review composer."),
|
||
("Show earlier", "Older rows still mount above you while your place stays put. Nothing to animate there."),
|
||
]
|
||
|
||
|
||
def esc(s: str) -> str:
|
||
return H.escape(s, quote=True)
|
||
|
||
|
||
def manifest(form_dir: pathlib.Path, url: str) -> list[dict]:
|
||
groups = dict(SECTIONS)
|
||
qs = []
|
||
for ch in CHAPTERS:
|
||
opts = []
|
||
for k in ch["mocks"]:
|
||
mk = MOCKS[k]
|
||
label = mk["label"] if ch["kind"] == "radio" else mk["title"]
|
||
if ch["kind"] == "radio" and k.endswith("-today"):
|
||
label = "Keep today's (snaps)"
|
||
opts.append({"value": k, "label": label, "description": mk["desc"], "mockup": str(form_dir / f"{k}.html"), "w": mk["w"], "h": mk["h"]})
|
||
q = {
|
||
"key": ch["id"].replace("-", "_"),
|
||
"type": "radio" if ch["kind"] == "radio" else "multiselect",
|
||
"page": groups[ch["sec"]],
|
||
"label": ch["q"],
|
||
"help": f"{H.unescape(re.sub('<[^>]+>', '', ch['lede']))} Full spec: {url}#{ch['id']}",
|
||
"options": opts,
|
||
"default": ch.get("default") if ch["kind"] == "radio" else [o["value"] for o in opts],
|
||
}
|
||
qs.append(q)
|
||
return qs
|
||
|
||
|
||
import re # noqa: E402 (used by manifest)
|
||
|
||
|
||
def page(url_fallback: str) -> str:
|
||
style = (HERE.parent / "home-motion.html").read_text()
|
||
# the home sheet's chrome (tokens, top bar, chapters, spec lists), not its mockup frames
|
||
css = style[style.index("<style>") + 7: style.index("/* ─", style.index(".hint {"))]
|
||
toc = "".join(f'<a href="#{c["id"]}">{esc(c["title"].split(" ")[0] if False else c["title"])}</a>' for c in CHAPTERS)
|
||
out = []
|
||
for sid, stitle in SECTIONS:
|
||
chs = [c for c in CHAPTERS if c["sec"] == sid]
|
||
out.append(f'<section class="sec-h" id="sec-{sid}"><div class="eyebrow">Section</div><h2 class="sh">{esc(stitle)}</h2></section>')
|
||
for c in chs:
|
||
figs = []
|
||
for k in c["mocks"]:
|
||
mk = MOCKS[k]
|
||
rec = c.get("default") == k
|
||
tag = '<span class="pill ok">recommended</span>' if rec else ('<span class="pill no">today</span>' if k.endswith("-today") else "")
|
||
figs.append(
|
||
f'<figure class="mk{" rec" if rec else ""}"><div class="mock" data-k="{k}" style="width:{mk["w"]}px;height:{mk["h"]}px"></div>'
|
||
f'<figcaption><div class="vlabel">{esc(mk["title"])} {tag}</div><p>{esc(mk["desc"])}</p></figcaption></figure>'
|
||
)
|
||
q = "Pick one in the form" if c["kind"] == "radio" else "Untick any you don't want in the form"
|
||
out.append(
|
||
f'<section class="ch" id="{c["id"]}"><div class="ch-head"><div><div class="eyebrow">{esc(c["eyebrow"])}</div><h2>{esc(c["title"])}</h2></div>'
|
||
f'<button class="replay" type="button" data-replay="{c["id"]}">↻ Replay</button></div>'
|
||
f'<p class="lede">{c["lede"]}</p><div class="stage">{"".join(figs)}</div>'
|
||
f'<ul class="spec">{"".join(f"<li>{s}</li>" for s in c["spec"])}</ul><p class="ask">{q} · question “{esc(c["q"])}”.</p></section>'
|
||
)
|
||
tmpl = "".join(f'<template id="t-{k}">{v["html"]}</template>' for k, v in MOCKS.items())
|
||
still = "".join(f"<li><b>{a}</b> — {b}</li>" for a, b in STILL)
|
||
later = "".join(f"<li><b>{a}</b> — {b}</li>" for a, b in LATER)
|
||
n_snaps = sum(1 for k in MOCKS if not k.endswith("-today"))
|
||
return f"""<title>Conversation Motion Mockups</title>
|
||
<meta name="claude:viewport-fit-sides" content="cover">
|
||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700&family=JetBrains+Mono:wght@400;600&display=swap">
|
||
<style>{css}
|
||
/* conversation sheet */
|
||
.sec-h {{ padding-block: 56px 0; scroll-margin-top: 64px; }}
|
||
.sec-h .sh {{ font: 700 clamp(30px, 4.6vw, 44px)/1.05 var(--display); margin: 6px 0 0; letter-spacing: -.02em; }}
|
||
.ch {{ margin-top: 28px; }}
|
||
.stage {{ align-items: stretch; }}
|
||
.mk {{ margin: 0; display: flex; flex-direction: column; gap: 10px; width: min(360px, 100%); }}
|
||
.mk .mock {{ max-width: 100%; border-radius: 18px; }}
|
||
.mk.rec .mock {{ box-shadow: 0 0 0 2px var(--primary); }}
|
||
.mk figcaption p {{ margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }}
|
||
.vlabel {{ display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }}
|
||
.ask {{ margin: 14px 0 0; font: 600 12px/1.5 var(--mono); color: var(--primary); }}
|
||
.lists {{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; margin-top: 18px; }}
|
||
.lists > div {{ border: 1px solid var(--rule); border-radius: 14px; padding: 14px 18px; background: var(--page-2); min-width: 0; }}
|
||
.lists h3 {{ margin: 0 0 8px; font: 700 15px/1.3 var(--display); }}
|
||
.lists ul {{ margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 5px; }}
|
||
.lists b {{ color: var(--ink); }}
|
||
.rules {{ margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }}
|
||
.rules > div {{ border: 1px solid var(--rule); border-radius: 14px; padding: 12px 16px; background: var(--page-2); min-width: 0; }}
|
||
.rules h3 {{ margin: 0 0 4px; font: 700 14px/1.3 var(--display); }}
|
||
.rules p {{ margin: 0; font-size: 13.5px; color: var(--ink-2); }}
|
||
@media (max-width: 400px) {{ .mk {{ width: 100%; }} .mk .mock {{ zoom: .86; }} }}
|
||
</style>
|
||
|
||
<header class="top">
|
||
<div class="wrap">
|
||
<div class="brand"><i></i><span>ai-agent · conversation</span></div>
|
||
<nav class="toc" aria-label="Sections">{"".join(f'<a href="#sec-{s}">{esc(t)}</a>' for s, t in SECTIONS)}</nav>
|
||
<div class="speed" role="group" aria-label="Playback speed">
|
||
<button type="button" data-speed="1" aria-pressed="true">1×</button>
|
||
<button type="button" data-speed="0.5" aria-pressed="false">½×</button>
|
||
<button type="button" data-speed="0.25" aria-pressed="false">¼×</button>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<main class="wrap">
|
||
<section class="intro">
|
||
<div class="eyebrow">Round 1 · the messages flow and the widgets</div>
|
||
<h1>Conversation page motion</h1>
|
||
<p>The home page moves now; the conversation page mostly doesn't. Today it animates numbers, typed text, the ring and bar sweeps, and a 4 px fade-up on each new row. Everything else changes in one frame: rows landing, every fold, every widget's state, your sent message's hand-off, the floating gizmos.</p>
|
||
<p>Below, every one of them is animated with the home page's rules: {len(MOCKS)} looping mockups, {n_snaps} proposals and {len(MOCKS) - n_snaps} of today's behaviour. Where there's a real choice, <b>today</b> is shown next to the variants; the outlined one is my recommendation. Use ½× or ¼× to watch a move closely, or ↻ to restart a section. The form asks the same questions: <a href="{esc(url_fallback)}">fallback copy</a> (Tailscale, http).</p>
|
||
<div class="rules">
|
||
<div><h3>Make room, then enter</h3><p>The slot opens first (240 ms) and everything around it glides. Then the newcomer comes in from its edge (380–520 ms). Leaving is the reverse: out by an edge, then the gap closes.</p></div>
|
||
<div><h3>Pills pop, text types</h3><p>Tags and badges pop from 40 % with a small overshoot. New labels and answers type in, and changed figures roll.</p></div>
|
||
<div><h3>Only what lands live</h3><p>History, a cached repaint and a backlog catch-up are simply there. The <b>Animations</b> switch and reduced motion turn it all off.</p></div>
|
||
<div><h3>No skeletons</h3><p>A waiting room is just grey, like empty, and the picture fades in once it has loaded.</p></div>
|
||
</div>
|
||
</section>
|
||
{"".join(out)}
|
||
<section class="ch" id="left"><div class="ch-head"><div><div class="eyebrow">For the record</div><h2>Already moving, and next round</h2></div></div>
|
||
<div class="lists"><div><h3>Left as they are</h3><ul>{still}</ul></div><div><h3>Not in this round</h3><ul>{later}</ul></div></div></section>
|
||
<footer>Built from screenshots of the live conversation page (phone + desktop, 2026-11-03) and a code audit of <code>Conversation.tsx</code> and the thread's widgets. Source: <code>docs/mockups/conversation-motion/build.py</code> · sibling of <code>docs/mockups/home-motion.html</code>.</footer>
|
||
</main>
|
||
{tmpl}
|
||
<script>
|
||
(() => {{
|
||
const q = new URLSearchParams(location.search);
|
||
const freeze = q.get("t");
|
||
const mount = (el) => {{
|
||
const t = document.getElementById("t-" + el.dataset.k);
|
||
if (!t) return;
|
||
const root = el.shadowRoot || el.attachShadow({{ mode: "open" }});
|
||
root.replaceChildren(t.content.cloneNode(true));
|
||
if (freeze != null) {{
|
||
const s = document.createElement("style");
|
||
s.textContent = `*{{animation-play-state:paused!important;animation-delay:-${{parseFloat(freeze)}}s!important}}`;
|
||
root.appendChild(s);
|
||
}}
|
||
}};
|
||
const all = () => document.querySelectorAll(".mock[data-k]");
|
||
all().forEach(mount);
|
||
document.querySelectorAll("[data-replay]").forEach((b) => b.addEventListener("click", () => {{
|
||
document.getElementById(b.dataset.replay).querySelectorAll(".mock[data-k]").forEach(mount);
|
||
}}));
|
||
const btns = document.querySelectorAll(".speed button");
|
||
btns.forEach((b) => b.addEventListener("click", () => {{
|
||
document.documentElement.style.setProperty("--spd", b.dataset.speed);
|
||
btns.forEach((x) => x.setAttribute("aria-pressed", String(x === b)));
|
||
all().forEach(mount);
|
||
}}));
|
||
if (matchMedia("(prefers-reduced-motion: reduce)").matches) document.documentElement.style.setProperty("--spd", "0.5");
|
||
}})();
|
||
</script>
|
||
"""
|
||
|
||
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
# output
|
||
# ════════════════════════════════════════════════════════════════════════════
|
||
def write_snippets(out: pathlib.Path) -> pathlib.Path:
|
||
d = out / "form"
|
||
d.mkdir(parents=True, exist_ok=True)
|
||
for k, v in MOCKS.items():
|
||
(d / f"{k}.html").write_text(v["html"])
|
||
return d
|
||
|
||
|
||
def write_preview(out: pathlib.Path) -> None:
|
||
"""Every mockup in its own iframe, like the form shows them; ?t=<s> freezes a frame."""
|
||
data = json.dumps({k: v["html"] for k, v in MOCKS.items()})
|
||
dims = json.dumps({k: [v["w"], v["h"], v["title"]] for k, v in MOCKS.items()})
|
||
only = ""
|
||
page_ = (
|
||
"<!doctype html><meta charset=utf-8><title>preview</title><style>body{background:#1a1a1a;color:#ddd;font:12px system-ui;"
|
||
"display:flex;flex-wrap:wrap;gap:14px;padding:14px;margin:0}iframe{border:0;display:block}figure{margin:0}figcaption{margin-top:4px}</style>"
|
||
f"<script>const M={data},D={dims};const q=new URLSearchParams(location.search),only=q.get('k'),ts=(q.get('t')||'').split(',').filter(Boolean);"
|
||
"const add=(k,t)=>{const f=document.createElement('figure'),i=document.createElement('iframe');i.width=D[k][0]+2;i.height=D[k][1]+2;"
|
||
"let h=M[k];if(t!=null)h+=`<style>*{animation-play-state:paused!important;animation-delay:-${parseFloat(t)}s!important}</style>`;"
|
||
"i.srcdoc=h;f.append(i);const c=document.createElement('figcaption');c.textContent=k+(t!=null?' @'+t+'s':'')+' — '+D[k][2];f.append(c);document.body.append(f)};"
|
||
"addEventListener('DOMContentLoaded',()=>{for(const k in M){if(only&&!only.split(',').includes(k))continue;if(!ts.length)add(k);else for(const t of ts)add(k,t)}})</script>"
|
||
)
|
||
(out / "preview.html").write_text(page_ + only)
|
||
|
||
|
||
if __name__ == "__main__":
|
||
ap = argparse.ArgumentParser()
|
||
ap.add_argument("--out", default=str(HERE / "out"))
|
||
ap.add_argument("--url", default="https://claude.ai/artifact/PENDING", help="the published review page (for the form's links)")
|
||
ap.add_argument("--fallback", default="http://conv-motion.ai-agent.test.gabvdl.xyz", help="the Tailscale-only copy")
|
||
a = ap.parse_args()
|
||
out = pathlib.Path(a.out)
|
||
out.mkdir(parents=True, exist_ok=True)
|
||
form_dir = write_snippets(out)
|
||
write_preview(out)
|
||
qs = manifest(form_dir, a.url)
|
||
qs += [
|
||
{"key": "pace", "type": "radio", "page": "Wrap-up", "label": "Pace of the moves",
|
||
"help": "Room 240 ms, enter 380–520 ms, folds 300 ms — the home page's timings.",
|
||
"options": [{"value": "as-shown", "label": "As shown (recommended)"}, {"value": "snappier", "label": "Snappier — about 30 % faster"},
|
||
{"value": "slower", "label": "Slower — about 30 % slower"}], "default": "as-shown"},
|
||
{"key": "next_step", "type": "radio", "page": "Wrap-up", "label": "Next step",
|
||
"options": [{"value": "implement", "label": "Implement what I picked, then deploy (recommended)"},
|
||
{"value": "another-round", "label": "Another mockup round first (say what in Anything else)"}], "default": "implement"},
|
||
]
|
||
intro = (
|
||
"### Animated mockups of every motion on the conversation page\n\n"
|
||
f"**Open them first:** [the animated mockups]({a.url}) — every motion looping, ½× / ¼× and the spec under each · "
|
||
f"[Tailscale fallback]({a.fallback}) (http).\n\n"
|
||
"You asked to animate what doesn't move yet on a conversation page, starting with the messages flow and the widgets. "
|
||
"Today the page animates numbers, typed text and a 4 px fade-up on each new row; almost everything else changes in one frame — "
|
||
"rows landing, every fold, every widget's state, your sent message's hand-off, the floating gizmos. "
|
||
"The proposals follow the home page's rules: make room, then enter; pills pop; text types; only what lands live moves; "
|
||
"the one **Animations** switch turns it all off.\n\n"
|
||
"**Pick one** where there's a choice (*Keep today's* shows what happens now). **Untick** anything you don't want in the tick-box lists."
|
||
)
|
||
(form_dir / "manifest.json").write_text(json.dumps({"title": "Conversation page motion — your picks", "intro": intro, "questions": qs}, indent=1, ensure_ascii=False))
|
||
sheet = page(a.fallback)
|
||
(HERE.parent / "conversation-motion.html").write_text(sheet)
|
||
# the same sheet as a standalone document (the artifact's skeleton adds these itself)
|
||
head = '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"></head><body>'
|
||
site = out / "site"
|
||
site.mkdir(exist_ok=True)
|
||
(site / "index.html").write_text(head + sheet + "</body></html>")
|
||
total = sum(len(v["html"]) for v in MOCKS.values())
|
||
from kit import UNSET
|
||
for n, k in UNSET:
|
||
print(f" ! {n}: '{k}' missing from the first frame")
|
||
print(f"{len(MOCKS)} mockups ({total // 1024} KB of snippets) → {out}; page → {HERE.parent / 'conversation-motion.html'}")
|