Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(onboarding): add animated setup graphics (#5207)

Aidan Holloway-Bidwell534dddeeb257
diff --git a/apps/web/src/features/setup/Module.tsx b/apps/web/src/features/setup/Module.tsx
new file mode 100644
index 0000000000..6c96f1f2e8
--- /dev/null
+++ b/apps/web/src/features/setup/Module.tsx
@@ -0,0 +1,515 @@
+import { useReactiveColorString } from '@theme/signals/themeReactive';
+import {
+ createEffect,
+ createUniqueId,
+ For,
+ onCleanup,
+ onMount,
+} from 'solid-js';
+import './SetupGraphic.css';
+
+/**
+ * The dashed orbit rings — behind the body. They stay put during the click
+ * burst while their dashes spin and they scale.
+ */
+export function ModuleRings(props: { phaseMs?: number }) {
+ const phaseMs = props.phaseMs ?? 0;
+ // WebKit pixel-snaps moving dashed SVG strokes at this scale, making the
+ // otherwise smooth orbit look like it jumps. Keep the static construction
+ // marks in Safari rather than shipping visibly broken motion there.
+ const animateDashes =
+ typeof navigator === 'undefined' ||
+ !/Safari/.test(navigator.userAgent) ||
+ /Chrome|Chromium|Android/.test(navigator.userAgent);
+ return (
+ <>
+ <g class="ring-motion ring-small-motion">
+ <path
+ class="ring-small"
+ d="M367.2,58.7c0,19.4-16.8,41.9-37.5,50.2-20.7,8.3-37.5-.8-37.5-20.2s16.8-41.9,37.5-50.2c20.7-8.3,37.5.8,37.5,20.2Z"
+ >
+ {animateDashes && (
+ <animate
+ attributeName="stroke-dashoffset"
+ begin={`${phaseMs}ms`}
+ dur={`${AMBIENT_MOTION.ringDash.durationMs}ms`}
+ from="0"
+ repeatCount="indefinite"
+ to={`-${AMBIENT_MOTION.ringDash.distance}`}
+ />
+ )}
+ </path>
+ </g>
+ <g class="ring-motion ring-large-motion">
+ <path
+ class="ring-large"
+ d="M409.5,71.5c0,30.9-26.7,66.6-59.6,79.8-32.9,13.2-59.6-1.2-59.6-32.2s26.7-66.6,59.6-79.8c32.9-13.2,59.6,1.2,59.6,32.2Z"
+ >
+ {animateDashes && (
+ <animate
+ attributeName="stroke-dashoffset"
+ begin={`${phaseMs}ms`}
+ dur={`${AMBIENT_MOTION.ringDash.durationMs}ms`}
+ from="0"
+ repeatCount="indefinite"
+ to={`-${AMBIENT_MOTION.ringDash.distance}`}
+ />
+ )}
+ </path>
+ </g>
+ </>
+ );
+}
+
+/**
+ * The small vent arcs — part of the body mass. They thrust with the body
+ * and flash accent during the click burst.
+ */
+export function ModuleVents() {
+ return (
+ <>
+ <path class="vent" d="M326.9,143.4c1.9-7.8,5.1-15.7,9.3-23.2" />
+ <path class="vent" d="M331.6,149.1c1.9-7.8,5.1-15.7,9.3-23.2" />
+ <path class="vent" d="M337,155c1.9-7.8,5.1-15.7,9.3-23.2" />
+ </>
+ );
+}
+
+/**
+ * The module's "body": the tile silhouette and the face ellipse the logo sits
+ * on — the piece that thrusts forward (+D) during the click burst.
+ */
+export function ModuleBody() {
+ return (
+ <>
+ <path
+ class="panel"
+ d="M396.2,227.8c8.7,1.1,18.7-.2,29.4-4.5,31.5-12.6,57.4-45.9,59.7-75.9h0s.3-5.7.3-5.7l-.3-5.5-.9-5.2-3.8-13.3-2.1-4.8-2.7-4.3-3.3-3.8-42.1-39.9-3.8-3.3-4.3-2.7-4.7-2.1-5.1-1.5-8.3-1.9-5.1-.8-5.4-.2-5.6.4-5.8,1-5.9,1.5-6,2.1-6,2.7-5.9,3.2-5.8,3.7-5.6,4.1-5.4,4.6-5.1,4.9-4.8,5.3-4.4,5.5-4,5.8-3.6,5.9-3.1,6-2.6,6.1-2,6.1-1.4,6-.9,5.9-.3,5.7.3,5.5.9,5.2,3.8,13.3,2.1,4.8,2.7,4.3,3.3,3.8,42.1,39.9,3.8,3.3,4.3,2.7,4.7,2.1,5.1,1.5,8.3,1.9,5.1.8"
+ />
+ <path
+ class="hairline"
+ d="M478.6,147.8c0,26.5-22.9,57.2-51.1,68.5-28.2,11.3-51.1-1.1-51.1-27.6s22.9-57.2,51.1-68.5,51.1,1.1,51.1,27.6Z"
+ />
+ </>
+ );
+}
+
+/**
+ * The full isometric tile (back + body), minus its logo.
+ */
+export function ModuleTile() {
+ return (
+ <>
+ <ModuleRings />
+ <ModuleBody />
+ <ModuleVents />
+ </>
+ );
+}
+
+const LOGO_FACE_PERSPECTIVE = {
+ heightScale: 0.8101,
+ shearDegrees: 21.79,
+ rotationDegrees: 21.79,
+} as const;
+
+const LOGO_FACE_PLACEMENT = {
+ // The 24×24 logo's fixed scale and origin on the module face.
+ scale: 3,
+ translateX: 394.09,
+ translateY: 150.228,
+} as const;
+
+const toSvgMatrixNumber = (value: number) => Number(value.toFixed(3));
+
+/**
+ * Places a flat 24×24 brand logo onto a module's face, matching the isometric
+ * perspective. Illustrator applies vertical scale → shear → rotation; SVG's
+ * Y-down coordinate system requires the design angles to be negated here.
+ */
+export const LOGO_FACE_TRANSFORM = (() => {
+ const rotation = (-LOGO_FACE_PERSPECTIVE.rotationDegrees * Math.PI) / 180;
+ const shear = Math.tan((-LOGO_FACE_PERSPECTIVE.shearDegrees * Math.PI) / 180);
+ const cosine = Math.cos(rotation);
+ const sine = Math.sin(rotation);
+ const { heightScale } = LOGO_FACE_PERSPECTIVE;
+ const { scale, translateX, translateY } = LOGO_FACE_PLACEMENT;
+
+ // scale → skewX → rotate, written as SVG's matrix(a b c d e f).
+ const xAxisX = scale * cosine;
+ const xAxisY = scale * sine;
+ const yAxisX = scale * heightScale * (cosine * shear - sine);
+ const yAxisY = scale * heightScale * (sine * shear + cosine);
+
+ return `matrix(${toSvgMatrixNumber(xAxisX)} ${toSvgMatrixNumber(xAxisY)} ${toSvgMatrixNumber(yAxisX)} ${toSvgMatrixNumber(yAxisY)} ${translateX} ${translateY})`;
+})();
+
+/**
+ * A brand mark to sit on a module face: one or more path `d` strings, filled
+ * with `currentColor`, positioned by `transform` (defaults to the flat-logo
+ * face transform via {@link LOGO_FACE_TRANSFORM}).
+ */
+export type ModuleLogo = { paths: string[]; transform?: string };
+
+/**
+ * A module's activity state, reflected in its logo:
+ * - `idle` — logo in ink.
+ * - `downloading` — logo pulses between ink and accent (pairs with the
+ * connector's travelling pulse).
+ * - `linked` — logo held solid accent.
+ */
+export type ModuleState = 'idle' | 'downloading' | 'linked';
+
+const AMBIENT_MOTION = {
+ bob: {
+ distancePx: 4,
+ durationMs: 4500,
+ },
+ ringBreathe: {
+ minScale: 0.97,
+ maxScale: 1.03,
+ },
+ ringDash: {
+ // One full dash period (dash 6 + gap 6), so travel loops seamlessly.
+ distance: 12,
+ durationMs: 3000,
+ },
+} as const;
+
+const BOB_KEYFRAMES: Keyframe[] = [
+ {
+ transform: `translateY(${AMBIENT_MOTION.bob.distancePx}px)`,
+ easing: 'ease-in-out',
+ },
+ {
+ transform: `translateY(${-AMBIENT_MOTION.bob.distancePx}px)`,
+ offset: 0.5,
+ easing: 'ease-in-out',
+ },
+ { transform: `translateY(${AMBIENT_MOTION.bob.distancePx}px)` },
+];
+const RING_BREATHE_KEYFRAMES: Keyframe[] = [
+ {
+ transform: `scale(${AMBIENT_MOTION.ringBreathe.minScale})`,
+ easing: 'ease-in-out',
+ },
+ {
+ transform: `scale(${AMBIENT_MOTION.ringBreathe.maxScale})`,
+ offset: 0.5,
+ easing: 'ease-in-out',
+ },
+ { transform: `scale(${AMBIENT_MOTION.ringBreathe.minScale})` },
+];
+// The module's long axis in local coords: the "depth" axis. The face is at the
+// +D (down-right) end and the rings at the −D (up-left) end. On click the body
+// thrusts +D while the rings stay put; the jet trail streaks −D behind it.
+const POS_D = { x: 0.7256, y: 0.6881 };
+const THRUST = 24;
+const THRUST_X = (POS_D.x * THRUST).toFixed(1);
+const THRUST_Y = (POS_D.y * THRUST).toFixed(1);
+
+/**
+ * Click burst timing. Asymmetric on purpose: a quick ramp to the peak, a brief
+ * hold there, then a slow settle back. The keyframe offsets carve the ~2.1s
+ * duration into roughly ramp / hold / settle; RAMP and SETTLE ease each phase.
+ */
+const ACCELERATION = {
+ durationMs: 2100,
+ peakIn: 0.17, // ramped to peak by here (~360ms)
+ peakOut: 0.4, // held at peak until here (~480ms), then settles (~1.26s)
+ largeRingScale: 1.2,
+ smallRingScale: 0.8,
+ dashTravel: 144,
+ jetTrail: {
+ length: 230,
+ halfWidth: 15,
+ startScaleY: 2.4,
+ peakOpacity: 0.9,
+ },
+} as const;
+const RAMP = 'cubic-bezier(0.1, 0.75, 0.3, 1)'; // fast punch
+const SETTLE = 'cubic-bezier(0.35, 0, 0.3, 1)'; // slow ease back
+
+// The body thrusts forward (+D), holds, then eases back.
+const ACCEL_BODY: Keyframe[] = [
+ { transform: 'translate(0,0)', easing: RAMP },
+ {
+ transform: `translate(${THRUST_X}px,${THRUST_Y}px)`,
+ offset: ACCELERATION.peakIn,
+ },
+ {
+ transform: `translate(${THRUST_X}px,${THRUST_Y}px)`,
+ offset: ACCELERATION.peakOut,
+ easing: SETTLE,
+ },
+ { transform: 'translate(0,0)' },
+];
+// Rings stay put but change size — large grows, small shrinks — hold, settle.
+// (No geometric rotation: the ellipses are in perspective; their dashes spin,
+// via ACCEL_*_DASH.) Composited onto the ambient breathe, so start/end neutral.
+const ACCEL_LARGE_RING: Keyframe[] = [
+ { transform: 'scale(1)', easing: RAMP },
+ {
+ transform: `scale(${ACCELERATION.largeRingScale})`,
+ offset: ACCELERATION.peakIn,
+ },
+ {
+ transform: `scale(${ACCELERATION.largeRingScale})`,
+ offset: ACCELERATION.peakOut,
+ easing: SETTLE,
+ },
+ { transform: 'scale(1)' },
+];
+const ACCEL_SMALL_RING: Keyframe[] = [
+ { transform: 'scale(1)', easing: RAMP },
+ {
+ transform: `scale(${ACCELERATION.smallRingScale})`,
+ offset: ACCELERATION.peakIn,
+ },
+ {
+ transform: `scale(${ACCELERATION.smallRingScale})`,
+ offset: ACCELERATION.peakOut,
+ easing: SETTLE,
+ },
+ { transform: 'scale(1)' },
+];
+// The dashes spin fast around each ring, opposite directions, throughout the
+// burst. Sweeping a whole number of dash periods (12 = dash 6 + gap 6) lands
+// neutral, so composited onto the ambient dash travel it leaves no seam.
+const ACCEL_LARGE_DASH: Keyframe[] = [
+ { strokeDashoffset: '0' },
+ { strokeDashoffset: `-${ACCELERATION.dashTravel}` },
+];
+const ACCEL_SMALL_DASH: Keyframe[] = [
+ { strokeDashoffset: '0' },
+ { strokeDashoffset: `${ACCELERATION.dashTravel}` },
+];
+// The "jet trail": a rect laid along the −D axis via JET_TRAIL_TRANSFORM (local
+// +x → −D), so its length runs backward from the module and its local y is the
+// (perpendicular) width. Positioned so the opaque gradient end sits at the
+// module and fades to transparent up-left.
+const JET_TRAIL_TRANSFORM = 'translate(420 162) rotate(223.5)';
+
+// Jet trail: starts wide and faint, focuses to a thin, bright streak at the peak
+// (scaleY narrows it about its centerline), holds, then fades out. scaleY is
+// on an inner group whose transform-origin is its center.
+const ACCEL_JET_TRAIL: Keyframe[] = [
+ {
+ transform: `scaleY(${ACCELERATION.jetTrail.startScaleY})`,
+ opacity: 0,
+ easing: RAMP,
+ },
+ {
+ transform: 'scaleY(1)',
+ opacity: ACCELERATION.jetTrail.peakOpacity,
+ offset: ACCELERATION.peakIn,
+ },
+ {
+ transform: 'scaleY(1)',
+ opacity: ACCELERATION.jetTrail.peakOpacity,
+ offset: ACCELERATION.peakOut,
+ easing: SETTLE,
+ },
+ { transform: 'scaleY(1)', opacity: 0 },
+];
+
+const prefersReducedMotion = () =>
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+/**
+ * A single hovering module: the isometric tile with a brand logo on its face,
+ * bobbing gently while its orbit rings breathe and their dashes travel.
+ *
+ * Renders as an embeddable `<g>` (drop it into any SVG whose root carries the
+ * `setup-graphic` class for styling). Ambient motion is self-driven with WAAPI
+ * so it survives a parent's DOM re-attach without restarting — a CSS animation
+ * would visibly pop. Pass `phaseMs` (a negative offset) so several modules
+ * don't move in unison.
+ *
+ * Clicking the module plays an "acceleration" burst: the body thrusts forward
+ * (+D), the vents flash to accent, the large ring grows and its dashes spin
+ * one way while the small ring shrinks and its dashes spin the other, and an
+ * jet trail focuses in behind it — a quick ramp, a brief hold, then a slow
+ * settle back.
+ *
+ * `state` reflects activity in the logo's color (see {@link ModuleState}); it
+ * updates reactively, so it can be toggled at runtime.
+ */
+export function Module(props: {
+ logo: ModuleLogo;
+ /** Transform positioning the module (e.g. translate/scale). */
+ place?: string;
+ /** Phase offset in ms (negative) so modules bob out of sync. */
+ phaseMs?: number;
+ /** Whether to run the ambient bob/ring motion (default true). */
+ animate?: boolean;
+ /** Activity state reflected in the logo color (default 'idle'). */
+ state?: ModuleState;
+ class?: string;
+}) {
+ const accentColor = useReactiveColorString('a0');
+ const inkColor = useReactiveColorString('c0');
+ let root: SVGGElement | undefined;
+ let logoGroup: SVGGElement | undefined;
+ let ventsGroup: SVGGElement | undefined;
+ const jetTrailGradientId = createUniqueId();
+ const animations: Animation[] = [];
+ let clickAnimations: Animation[] = [];
+ onCleanup(() => {
+ for (const animation of animations) animation.cancel();
+ for (const animation of clickAnimations) animation.cancel();
+ });
+
+ // Drive color from `state`, reactively (toggle-able at runtime). The logo
+ // and vents are `currentColor`, so a `color` on their group recolors them.
+ // Both the linked hold and the downloading pulse use a live `var(--color-
+ // accent)` (inline for linked, a CSS animation for downloading) rather than
+ // a probed concrete color: the themed accent is applied after mount, so a
+ // value baked at effect time would be the pre-theme fallback (green).
+ createEffect(() => {
+ const state = props.state ?? 'idle';
+ if (!logoGroup || !root) return;
+ logoGroup.classList.remove('logo-downloading');
+ logoGroup.style.color = '';
+ if (ventsGroup) ventsGroup.style.color = '';
+ if (state === 'linked') {
+ logoGroup.style.color = 'var(--color-accent)';
+ if (ventsGroup) ventsGroup.style.color = 'var(--color-accent)';
+ } else if (state === 'downloading' && !prefersReducedMotion()) {
+ logoGroup.classList.add('logo-downloading');
+ }
+ });
+
+ onMount(() => {
+ if (!root || props.animate === false || prefersReducedMotion()) return;
+ const delay = props.phaseMs ?? 0;
+ animations.push(
+ root.animate(BOB_KEYFRAMES, {
+ duration: AMBIENT_MOTION.bob.durationMs,
+ iterations: Number.POSITIVE_INFINITY,
+ delay,
+ })
+ );
+ for (const ring of root.querySelectorAll<SVGGElement>('.ring-motion')) {
+ animations.push(
+ ring.animate(RING_BREATHE_KEYFRAMES, {
+ duration: AMBIENT_MOTION.bob.durationMs,
+ iterations: Number.POSITIVE_INFINITY,
+ delay,
+ })
+ );
+ }
+ });
+
+ // The click "acceleration" burst. Ring scale + dash composite onto the
+ // ambient animations (composite: 'add') and start/end neutral, so no restart
+ // pop; the body and jet trail have no ambient motion, so they just replace.
+ const accelerate = () => {
+ if (!root || prefersReducedMotion()) return;
+ for (const animation of clickAnimations) animation.cancel();
+ clickAnimations = [];
+ const accent = accentColor();
+ const dur = { duration: ACCELERATION.durationMs } as const;
+ const add = {
+ duration: ACCELERATION.durationMs,
+ composite: 'add' as const,
+ };
+ // Dashes spin fast then wind down (ease-out) over the whole burst.
+ const spin = { ...add, easing: 'ease-out' };
+
+ const body = root.querySelector<SVGElement>('.module-body');
+ const large = root.querySelector<SVGGElement>('.ring-large-motion');
+ const small = root.querySelector<SVGGElement>('.ring-small-motion');
+ const jetTrail = root.querySelector<SVGElement>('.module-jet-trail-scale');
+ if (body) clickAnimations.push(body.animate(ACCEL_BODY, dur));
+ if (large) {
+ clickAnimations.push(large.animate(ACCEL_LARGE_RING, add));
+ clickAnimations.push(large.animate(ACCEL_LARGE_DASH, spin));
+ }
+ if (small) {
+ clickAnimations.push(small.animate(ACCEL_SMALL_RING, add));
+ clickAnimations.push(small.animate(ACCEL_SMALL_DASH, spin));
+ }
+ if (jetTrail) clickAnimations.push(jetTrail.animate(ACCEL_JET_TRAIL, dur));
+ for (const vent of root.querySelectorAll<SVGElement>(
+ '.module-vents path'
+ )) {
+ // Flash from the state-specific resting stroke so linked-module vents
+ // don't jump from accent back to ink.
+ const resting = props.state === 'linked' ? accentColor() : inkColor();
+ clickAnimations.push(
+ vent.animate(
+ [
+ { stroke: resting, opacity: 0.4, easing: RAMP },
+ { stroke: accent, opacity: 1, offset: ACCELERATION.peakIn },
+ {
+ stroke: accent,
+ opacity: 1,
+ offset: ACCELERATION.peakOut,
+ easing: SETTLE,
+ },
+ { stroke: resting, opacity: 0.4 },
+ ],
+ dur
+ )
+ );
+ }
+ };
+
+ return (
+ <g
+ ref={root}
+ class={`module-bob ${props.class ?? ''}`}
+ onClick={(event) => {
+ // Don't also trigger a parent's click (e.g. the setup scene's slide).
+ event.stopPropagation();
+ accelerate();
+ }}
+ >
+ <g class="module" transform={props.place}>
+ <defs>
+ <linearGradient
+ id={jetTrailGradientId}
+ gradientUnits="userSpaceOnUse"
+ x1="0"
+ y1="0"
+ x2={ACCELERATION.jetTrail.length}
+ y2="0"
+ >
+ <stop offset="0%" class="module-jet-trail-hot" />
+ <stop offset="100%" class="module-jet-trail-cold" />
+ </linearGradient>
+ </defs>
+ {/* Accent jet trail behind the module — hidden until the click burst. The
+ inner group's width (scaleY) and opacity are what animate. */}
+ <g class="module-jet-trail" transform={JET_TRAIL_TRANSFORM}>
+ <g class="module-jet-trail-scale">
+ <rect
+ x="0"
+ y={-ACCELERATION.jetTrail.halfWidth}
+ width={ACCELERATION.jetTrail.length}
+ height={ACCELERATION.jetTrail.halfWidth * 2}
+ fill={`url(#${jetTrailGradientId})`}
+ />
+ </g>
+ </g>
+ {/* Rings stay put behind; the body mass — card, face, logo, and the
+ vents on top of it — thrusts forward on click. */}
+ <ModuleRings phaseMs={props.phaseMs} />
+ <g class="module-body">
+ <ModuleBody />
+ <g
+ ref={logoGroup}
+ class="module-logo"
+ transform={props.logo.transform ?? LOGO_FACE_TRANSFORM}
+ >
+ <For each={props.logo.paths}>{(d) => <path d={d} />}</For>
+ </g>
+ <g ref={ventsGroup} class="module-vents">
+ <ModuleVents />
+ </g>
+ </g>
+ </g>
+ </g>
+ );
+}
diff --git a/apps/web/src/features/setup/SetupGraphic.css b/apps/web/src/features/setup/SetupGraphic.css
new file mode 100644
index 0000000000..37e65c38d1
--- /dev/null
+++ b/apps/web/src/features/setup/SetupGraphic.css
@@ -0,0 +1,218 @@
+/*
+ * Styles for the /setup empty-state isometric scene (SetupGraphic.tsx).
+ */
+.setup-graphic {
+ --setup-silhouette: oklch(from var(--color-surface) calc(l + 0.035) c h);
+ /* Don't clip the scene's motion (module bob, click bursts, halos) or the
+ handoff shrink to the viewBox. */
+ overflow: visible;
+}
+
+.setup-graphic :is(.arc, .vent, .edge, .card-mid, .ring-small, .guide, .ring-large, .card-back, .card-front) {
+ stroke-linecap: round;
+}
+
+.setup-graphic
+ :is(.arc, .vent, .edge, .card-mid, .ring-small, .guide, .ring-large, .card-back, .card-front, .hairline, .panel, .knob) {
+ stroke: currentcolor;
+ stroke-width: 2px;
+}
+
+.setup-graphic :is(.arc, .vent, .edge, .ring-small, .guide, .ring-large, .hairline) {
+ fill: none;
+}
+
+.setup-graphic :is(.arc, .vent, .ring-small, .ring-large, .hairline, .panel, .knob) {
+ stroke-miterlimit: 10;
+}
+
+.setup-graphic :is(.vent, .ring-small, .guide, .dot) {
+ opacity: 0.4;
+}
+
+.setup-graphic :is(.edge, .card-mid, .guide, .card-back, .card-front) {
+ stroke-linejoin: round;
+}
+
+/* Card silhouettes. */
+.setup-graphic :is(.card-mid, .card-back, .card-front, .panel, .knob) {
+ fill: var(--setup-silhouette);
+ transition: fill 700ms ease;
+}
+
+.setup-graphic :is(.ring-small, .ring-large) {
+ stroke-dasharray: 6;
+}
+
+/* Left-face shading on all three blocks.
+ Always black (not currentColor) so the faces darken like shadow in both
+ themes; dark surfaces need a stronger shadow to register at all. */
+.setup-graphic .shade {
+ fill: #000;
+ opacity: 0.1;
+ transition: opacity 700ms ease;
+}
+
+html[data-theme-light='false'] .setup-graphic .shade {
+ opacity: 0.3;
+}
+
+/* The "powered up" finale — a composite-level final state (the `poweredUp`
+ prop toggles .powered on the root), independent of any module's `linked`
+ state. The hovering modules fade out and the three cards fill in: their
+ linework (currentColor, so a color change on .blocks carries the strokes and
+ currentColor fills) and silhouette fills turn accent, and the left-face
+ shading fades away — leaving a solid accent Macro mark. Plain transitions,
+ not keyframe animations, so a Suspense re-attach renders the end state
+ rather than replaying it. (The white LED sparks are hidden here too, but the
+ real guarantee is JS: SetupGraphic cancels the LED WAAPI animations when
+ powering up, since a running animation would otherwise beat this CSS.) */
+.setup-graphic .blocks {
+ transition: color 700ms ease;
+}
+.setup-graphic :is(.modules, .connectors) {
+ transition: opacity 700ms ease;
+}
+/* The modules fade out, and their tethers go with them. */
+.setup-graphic.powered :is(.modules, .connectors) {
+ opacity: 0;
+ pointer-events: none;
+}
+.setup-graphic.powered .blocks {
+ color: var(--color-accent);
+}
+/* Scoped to .blocks: `.panel`/`.knob` are also used by the module bodies, and
+ those should only fade out — never fill accent. */
+.setup-graphic.powered
+ .blocks
+ :is(.card-mid, .card-back, .card-front, .panel, .knob) {
+ fill: var(--color-accent);
+}
+.setup-graphic.powered .led-spark {
+ opacity: 0;
+}
+.setup-graphic.powered .shade,
+/* out-specificity the dark-theme .shade opacity rule above */
+html[data-theme-light='false'] .setup-graphic.powered .shade {
+ opacity: 0;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .setup-graphic .blocks,
+ .setup-graphic .modules,
+ .setup-graphic :is(.card-mid, .card-back, .card-front, .panel, .knob),
+ .setup-graphic .shade {
+ transition: none;
+ }
+}
+
+/* Geometry-only reference for the brand handoff (see `.logo-ref` in
+ SetupGraphic.tsx): never painted, never hit-tested, but still laid out so
+ `getBoundingClientRect()` returns the logo's true position. `opacity: 0`
+ rather than `display: none`/`visibility: hidden` — those would zero out or
+ drop the measurable geometry. */
+.setup-graphic .logo-ref {
+ opacity: 0;
+ pointer-events: none;
+}
+
+/* LED halo: a soft filled accent disc behind each inset that breathes
+ (expands and contracts) once lit. Hidden (opacity 0) at rest; the
+ illuminate pass drives its scale + opacity via WAAPI. transform-box/-origin
+ make the scale grow about its own center. */
+.setup-graphic .led-halo {
+ fill: var(--color-accent);
+ opacity: 0;
+ transform-box: fill-box;
+ transform-origin: center;
+}
+
+/* LED spark: a small fully-white specular dot in the inset's upper-left,
+ suggesting the bulb's light source. Faded in with the illuminate pass. */
+.setup-graphic .led-spark {
+ fill: #fff;
+ opacity: 0;
+}
+
+/* Dashed connector tethers from modules to block features. Authored in
+ viewBox space (unscaled), so a 1.3 stroke matches the scaled block linework;
+ kept subtle like the scene's other construction lines. */
+.setup-graphic .connector {
+ fill: none;
+ stroke: currentcolor;
+ stroke-width: 1.3;
+ stroke-dasharray: 6;
+ stroke-linecap: round;
+ opacity: 0.55;
+}
+
+/* "Downloading" pulse: a clean accent segment travelling along a connector
+ (the dash + stroke-dashoffset are set by DownloadPulse), with just a hint of
+ glow so it stays crisp. */
+.setup-graphic .download-pulse {
+ fill: none;
+ stroke: var(--color-accent);
+ stroke-width: 2.5;
+ stroke-linecap: round;
+ pointer-events: none;
+ filter: drop-shadow(0 0 1px var(--color-accent));
+}
+
+/* "Downloading" logo pulse: the module's currentColor logo eases between ink
+ and accent. Unlike the module's other motion (WAAPI, to survive a Suspense
+ re-attach), this is CSS so it pulses to a *live* var(--color-accent): the
+ brand accent is applied after mount, and a WAAPI keyframe would bake the
+ pre-theme fallback color instead. A re-attach at worst restarts the pulse
+ from ink — a negligible blip for a slow color fade. Toggled by the
+ `logo-downloading` class (set in Module for the downloading state). */
+@keyframes setup-logo-download {
+ 0%,
+ 100% {
+ color: var(--color-ink);
+ }
+ 50% {
+ color: var(--color-accent);
+ }
+}
+.setup-graphic .logo-downloading {
+ animation: setup-logo-download 1600ms ease-in-out infinite;
+}
+@media (prefers-reduced-motion: reduce) {
+ .setup-graphic .logo-downloading {
+ animation: none;
+ }
+}
+
+/* Ambient module motion — the bob and orbit rings' breathe are driven with
+ WAAPI (see SetupGraphic.tsx), while dash travel uses native SVG animation.
+ This avoids Safari's jitter when WAAPI animates a dashed SVG stroke. When a
+ query above it re-suspends, the page's Suspense boundary re-attaches this
+ subtree; that restarts CSS animations (a visible pop) but leaves the
+ WAAPI animations running. The wrapper owns scale while the nested path owns dash
+ travel: separating those properties avoids Safari re-rasterizing a dashed
+ path as its transform changes. */
+.setup-graphic .module .ring-motion {
+ transform-box: fill-box;
+ transform-origin: center;
+}
+
+/* Accent "acceleration" jet trail behind the module, revealed on click (driven by
+ WAAPI). Non-interactive; gradient goes opaque accent at the module to
+ transparent up-left along the −D axis. The inner group carries the animated
+ opacity and the width scale (scaleY about its own center). */
+.setup-graphic .module-jet-trail {
+ pointer-events: none;
+}
+.setup-graphic .module-jet-trail-scale {
+ opacity: 0;
+ transform-box: fill-box;
+ transform-origin: center;
+}
+.setup-graphic .module-jet-trail-hot {
+ stop-color: var(--color-accent);
+ stop-opacity: 0.85;
+}
+.setup-graphic .module-jet-trail-cold {
+ stop-color: var(--color-accent);
+ stop-opacity: 0;
+}
diff --git a/apps/web/src/features/setup/SetupGraphic.tsx b/apps/web/src/features/setup/SetupGraphic.tsx
new file mode 100644
index 0000000000..f23ae88447
--- /dev/null
+++ b/apps/web/src/features/setup/SetupGraphic.tsx
@@ -0,0 +1,969 @@
+import { useReactiveColorString } from '@theme/signals/themeReactive';
+import { createEffect, For, on, onCleanup, onMount, Show } from 'solid-js';
+import { Module, type ModuleLogo, type ModuleState } from './Module';
+import { MODULE_LOGOS } from './moduleLogos';
+import './SetupGraphic.css';
+
+type Point = { x: number; y: number };
+type ConnectorLayer = 'front' | 'mid' | 'back';
+type ConnectorAxis = 'frontFace' | 'sideFace';
+
+const point = (x: number, y: number): Point => ({ x, y });
+const toSvgNumber = (value: number) => Number(value.toFixed(1));
+
+const SCENE = {
+ viewBox: '-10 -28 930 700',
+ blocks: {
+ center: point(444, 457),
+ scale: 0.667,
+ inverseScale: 1.49925,
+ },
+ module: {
+ scale: 0.667,
+ // The point on the module body where each tether originates. Slots may
+ // opt into a different local point when their face needs a slight nudge.
+ defaultConnectorAnchor: point(397.5, 140),
+ },
+} as const;
+
+const MOTION = {
+ downloadPulse: {
+ segmentLength: 70,
+ millisecondsPerUnit: 3,
+ },
+ leds: {
+ staggerMs: 110,
+ onsetMs: 300,
+ haloFlashMs: 450,
+ breatheMs: 2600,
+ halo: {
+ startScale: 0.7,
+ peakScale: 2.4,
+ restingScale: 0.85,
+ peakOpacity: 0.6,
+ restingOpacity: 0.28,
+ breatheScale: 1.2,
+ breatheOpacity: 0.14,
+ },
+ },
+ cardSlide: {
+ delayMs: 800,
+ durationMs: 2600,
+ outOffset: 0.2,
+ holdOffset: 0.4,
+ distance: point(34.8, 33.1),
+ },
+ modulePhaseMs: 1100,
+} as const;
+
+const connectorAxisSlopes: Record<ConnectorAxis, number> = {
+ // The two non-vertical axes in the isometric artwork. Keeping these shared
+ // means a tether's lower arm stays aligned to its card face as its module
+ // moves; only the slot's placement needs updating.
+ frontFace: -0.4,
+ sideFace: 0.948,
+};
+
+const moduleTransform = (position: Point, moduleAnchor: Point) =>
+ `translate(${position.x} ${position.y}) scale(${SCENE.module.scale}) translate(${-moduleAnchor.x} ${-moduleAnchor.y})`;
+
+const transformModulePoint = (
+ position: Point,
+ moduleAnchor: Point,
+ localPoint: Point
+): Point => ({
+ x: position.x + SCENE.module.scale * (localPoint.x - moduleAnchor.x),
+ y: position.y + SCENE.module.scale * (localPoint.y - moduleAnchor.y),
+});
+
+const connectorPath = (start: Point, target: Point, axis: ConnectorAxis) => {
+ const elbow = point(
+ start.x,
+ target.y - connectorAxisSlopes[axis] * (target.x - start.x)
+ );
+ return `M${toSvgNumber(start.x)} ${toSvgNumber(start.y)} L${toSvgNumber(elbow.x)} ${toSvgNumber(elbow.y)} L${toSvgNumber(target.x)} ${toSvgNumber(target.y)}`;
+};
+
+/**
+ * A "downloading" pulse: an accent glow segment that travels along a connector
+ * from the module to the card, on repeat. Built from a short dash swept with
+ * stroke-dashoffset (WAAPI, so a Suspense re-attach can't restart it). Rendered
+ * in the same layer as its connector, so it's occluded by the cards the same
+ * way. The connector `d` runs module→card, so the pulse flows that direction.
+ */
+function DownloadPulse(props: { d: string }) {
+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ return null;
+ }
+
+ let path: SVGPathElement | undefined;
+ let animation: Animation | undefined;
+ onCleanup(() => animation?.cancel());
+ onMount(() => {
+ if (!path) return;
+ const total = path.getTotalLength();
+ const { segmentLength, millisecondsPerUnit } = MOTION.downloadPulse;
+ // One bright dash, gap = full path (so only one is on the wire at a time);
+ // sweeping the whole period runs it start→end and loops seamlessly.
+ path.setAttribute('stroke-dasharray', `${segmentLength} ${total}`);
+ animation = path.animate(
+ [
+ { strokeDashoffset: '0' },
+ { strokeDashoffset: `${-(segmentLength + total)}` },
+ ],
+ {
+ duration: Math.round((segmentLength + total) * millisecondsPerUnit),
+ iterations: Number.POSITIVE_INFINITY,
+ easing: 'linear',
+ }
+ );
+ });
+ return <path ref={path} class="download-pulse" d={props.d} />;
+}
+
+/**
+ * The fixed module positions around the blocks. Each slot is pure geometry —
+ * where the module sits (`position`, mapped from its local `moduleAnchor`) and
+ * the dashed tether to a block feature (`connector`) — independent of which
+ * logo lands on it.
+ *
+ * A connector's `layer` sets its draw order: `front` over all cards; `back`
+ * behind all cards; `mid` between the back and middle cards. Coordinates are
+ * absolute viewBox units (modules/connectors are siblings of the scaled
+ * blocks), so the `mid` group counters the blocks transform to stay so.
+ */
+type Slot = {
+ // Move a module by changing only this position; its tether follows.
+ position: Point;
+ moduleAnchor: Point;
+ connector: {
+ target: Point;
+ axis: ConnectorAxis;
+ layer: ConnectorLayer;
+ source?: Point;
+ };
+};
+
+const createSlot = (slot: Slot) => {
+ const connectorAnchor =
+ slot.connector.source ?? SCENE.module.defaultConnectorAnchor;
+ const connectorStart = transformModulePoint(
+ slot.position,
+ slot.moduleAnchor,
+ connectorAnchor
+ );
+
+ return {
+ place: moduleTransform(slot.position, slot.moduleAnchor),
+ connector: {
+ d: connectorPath(
+ connectorStart,
+ slot.connector.target,
+ slot.connector.axis
+ ),
+ layer: slot.connector.layer,
+ },
+ };
+};
+
+const SLOTS = {
+ // Tethers to the pill cutout on the front card.
+ frontPill: createSlot({
+ position: point(90, 275),
+ moduleAnchor: point(447.5, 48.3),
+ connector: {
+ target: point(228.7, 495.4),
+ axis: 'frontFace',
+ layer: 'front',
+ },
+ }),
+ // Tethers to the back side of the middle card.
+ midBack: createSlot({
+ position: point(270, 190),
+ moduleAnchor: point(447.5, 168.3),
+ connector: {
+ target: point(374.6, 442.3),
+ axis: 'sideFace',
+ layer: 'back',
+ source: point(397.5, 146.3),
+ },
+ }),
+ // Tethers to the small circular port on the middle card.
+ midPort: createSlot({
+ position: point(410, 145),
+ moduleAnchor: point(447.5, -98.3),
+ connector: {
+ target: point(429.5, 556.8),
+ axis: 'frontFace',
+ layer: 'front',
+ },
+ }),
+ // Tethers to the far side of the middle card.
+ midFar: createSlot({
+ position: point(670, 210),
+ moduleAnchor: point(507.5, 128.3),
+ connector: {
+ target: point(489.8, 465.7),
+ axis: 'frontFace',
+ layer: 'mid',
+ source: point(397.5, 134.3),
+ },
+ }),
+ // Tethers to the far side of the back card.
+ backFar: createSlot({
+ position: point(855, 290),
+ moduleAnchor: point(507.5, 248.3),
+ connector: {
+ target: point(694.8, 465.7),
+ axis: 'frontFace',
+ layer: 'back',
+ source: point(397.5, 139.6),
+ },
+ }),
+} satisfies Record<
+ string,
+ { place: string; connector: { d: string; layer: ConnectorLayer } }
+>;
+
+type SlotName = keyof typeof SLOTS;
+
+/** One module to render: which {@link SLOTS slot} it fills, its logo, whether
+ * to draw its connector (default true), and its activity `state` (default
+ * 'idle'). `downloading` runs the connector pulse; `linked` hides the
+ * connector. */
+export type ModuleConfig = {
+ slot: SlotName;
+ logo: ModuleLogo;
+ connector?: boolean;
+ state?: ModuleState;
+};
+
+/** Default: every slot filled with its conventional brand logo, connectors on.
+ * Slots are geometry-named, so the logo for each is spelled out here. */
+const DEFAULT_MODULES: ModuleConfig[] = [
+ { slot: 'frontPill', logo: MODULE_LOGOS.Linear },
+ { slot: 'midBack', logo: MODULE_LOGOS.Google },
+ { slot: 'midPort', logo: MODULE_LOGOS.GitHub },
+ { slot: 'midFar', logo: MODULE_LOGOS.Notion },
+ { slot: 'backFar', logo: MODULE_LOGOS.Slack },
+];
+
+/**
+ * Undoes the `.blocks` transform, so a connector placed among the blocks'
+ * children (to sit at a specific card in the draw order) still renders at its
+ * absolute viewBox coordinates.
+ */
+const INVERSE_BLOCKS_TRANSFORM = `translate(${SCENE.blocks.center.x} ${SCENE.blocks.center.y}) scale(${SCENE.blocks.inverseScale}) translate(${-SCENE.blocks.center.x} ${-SCENE.blocks.center.y})`;
+
+const BLOCKS_TRANSFORM = `translate(${SCENE.blocks.center.x} ${SCENE.blocks.center.y}) scale(${SCENE.blocks.scale}) translate(${-SCENE.blocks.center.x} ${-SCENE.blocks.center.y})`;
+
+/**
+ * The isometric empty-state scene for `/setup`: the Macro logo re-imagined as
+ * three technical isometric blocks (`front_card`, `middle_card`, `back_card`),
+ * with hovering modules around it. Inlined (rather than imported as an asset)
+ * so animation can target the named groups.
+ *
+ * Pass `modules` to choose which {@link SLOTS slots} appear and which logo each
+ * carries (and whether to draw each tether); omit it for all five slots with
+ * their brand logos. Each connector follows its module.
+ *
+ * The back card's front section (`animating_card`) slides out and back once on
+ * mount; clicking the graphic replays it. When it settles, the inset LED
+ * indicators illuminate bottom-to-top and hold a faint pulsing glow with a
+ * breathing halo; a fresh slide darkens them until it settles again.
+ */
+export function SetupGraphic(props: {
+ class?: string;
+ modules?: ModuleConfig[];
+ /** The composite-level "powered up" finale: the modules fade out and the
+ * three cards fill in accent with their shading gone. Independent of any
+ * module's `linked` state. */
+ poweredUp?: boolean;
+}) {
+ const accentColor = useReactiveColorString('a0');
+ const inkColor = useReactiveColorString('c0');
+ const modules = () => props.modules ?? DEFAULT_MODULES;
+ // Connectors follow their modules: one per shown module whose connector
+ // isn't disabled and isn't in the `linked` state (which hides it), carrying
+ // the slot's tether geometry + draw layer, plus whether its pulse is running.
+ const connectorsIn = (layer: ConnectorLayer) =>
+ modules()
+ .filter(
+ (m) =>
+ m.connector !== false &&
+ m.state !== 'linked' &&
+ SLOTS[m.slot].connector.layer === layer
+ )
+ .map((m) => ({
+ ...SLOTS[m.slot].connector,
+ downloading: m.state === 'downloading',
+ }));
+
+ let svg: SVGSVGElement | undefined;
+ let animatingCard: SVGGElement | undefined;
+ let slideAnimation: Animation | undefined;
+ let slideDelay: ReturnType<typeof setTimeout> | undefined;
+ // The LEDs, ordered bottom-to-top (illumination order): each carries its
+ // inset dot, halo ring, and specular spark. Plus the WAAPI animations
+ // currently driving them.
+ type Led = {
+ inset: SVGElement;
+ halo: SVGElement | null;
+ spark: SVGElement | null;
+ };
+ let leds: Led[] = [];
+ let ledAnimations: Animation[] = [];
+ onCleanup(() => {
+ clearTimeout(slideDelay);
+ for (const animation of ledAnimations) animation.cancel();
+ });
+
+ const reducedMotion = () =>
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+ const darkenLeds = () => {
+ for (const animation of ledAnimations) animation.cancel();
+ ledAnimations = [];
+ };
+
+ // Light the LEDs bottom-to-top: each ramps from its resting ink dot to a
+ // glowing accent dot with a white specular spark (staggered onset) while
+ // its halo flashes big, then settles into an endless faint pulse with a
+ // breathing halo. Driven with WAAPI so a Suspense re-attach can't replay
+ // the onset.
+ const illuminateLeds = () => {
+ darkenLeds();
+ const accent = accentColor();
+ const ink = inkColor();
+ const lit = `drop-shadow(0 0 1.5px ${accent})`;
+ const bright = `drop-shadow(0 0 4px ${accent})`;
+ const motion = !reducedMotion();
+
+ leds.forEach(({ inset, halo, spark }, index) => {
+ const delay = index * MOTION.leds.staggerMs;
+ const onset = inset.animate(
+ [
+ { fill: ink, opacity: 0.4, filter: 'drop-shadow(0 0 0 transparent)' },
+ { fill: accent, opacity: 1, filter: lit },
+ ],
+ {
+ duration: MOTION.leds.onsetMs,
+ delay,
+ easing: 'ease-out',
+ fill: 'both',
+ }
+ );
+ ledAnimations.push(onset);
+ // Spark fades in over the same onset window and holds.
+ if (spark) {
+ ledAnimations.push(
+ spark.animate([{ opacity: 0 }, { opacity: 0.9 }], {
+ duration: MOTION.leds.onsetMs,
+ delay,
+ easing: 'ease-out',
+ fill: 'both',
+ })
+ );
+ }
+ // Halo flashes big as the LED comes on, then settles to the breathe
+ // baseline; the endless breathe picks up from there. (Motion only —
+ // reduced-motion leaves the halo hidden.)
+ if (halo && motion) {
+ const flash = halo.animate(
+ [
+ { transform: `scale(${MOTION.leds.halo.startScale})`, opacity: 0 },
+ {
+ transform: `scale(${MOTION.leds.halo.peakScale})`,
+ opacity: MOTION.leds.halo.peakOpacity,
+ offset: 0.45,
+ },
+ {
+ transform: `scale(${MOTION.leds.halo.restingScale})`,
+ opacity: MOTION.leds.halo.restingOpacity,
+ },
+ ],
+ {
+ duration: MOTION.leds.haloFlashMs,
+ delay,
+ easing: 'ease-out',
+ fill: 'both',
+ }
+ );
+ ledAnimations.push(flash);
+ flash.finished
+ .then(() => {
+ // Breathe: expand and contract, synced with the glow pulse.
+ const breathe = halo.animate(
+ [
+ {
+ transform: `scale(${MOTION.leds.halo.restingScale})`,
+ opacity: MOTION.leds.halo.restingOpacity,
+ },
+ {
+ transform: `scale(${MOTION.leds.halo.breatheScale})`,
+ opacity: MOTION.leds.halo.breatheOpacity,
+ },
+ {
+ transform: `scale(${MOTION.leds.halo.restingScale})`,
+ opacity: MOTION.leds.halo.restingOpacity,
+ },
+ ],
+ {
+ duration: MOTION.leds.breatheMs,
+ iterations: Number.POSITIVE_INFINITY,
+ easing: 'ease-in-out',
+ }
+ );
+ ledAnimations.push(breathe);
+ })
+ .catch(() => {
+ // finished rejects when darkenLeds() cancels the flash.
+ });
+ }
+ onset.finished
+ .then(() => {
+ if (!motion) return;
+ const pulse = inset.animate(
+ [
+ { filter: lit, opacity: 1 },
+ { filter: bright, opacity: 0.9 },
+ { filter: lit, opacity: 1 },
+ ],
+ {
+ duration: MOTION.leds.breatheMs,
+ iterations: Number.POSITIVE_INFINITY,
+ }
+ );
+ ledAnimations.push(pulse);
+ })
+ .catch(() => {
+ // finished rejects when darkenLeds() cancels a pending onset.
+ });
+ });
+ };
+
+ // Slide the back card's front section out and back once along its pipes —
+ // the isometric depth axis, unit vector (0.7245, 0.6892) from the pipe
+ // paths (e.g. "M740.7,486.2 l-51.3,-48.8"), in user units so it scales
+ // with the scene. Driven imperatively (WAAPI) rather than by a CSS
+ // animation: the page's Suspense boundary re-attaches this subtree when a
+ // query above it re-suspends (e.g. failing queries retrying), and
+ // re-inserted elements cancel and replay CSS animations, while WAAPI
+ // animations survive.
+ const playSlide = () => {
+ if (props.poweredUp) return; // no card slide in the static powered finale
+ if (!animatingCard || slideAnimation?.playState === 'running') return;
+ darkenLeds();
+ slideAnimation = animatingCard.animate(
+ [
+ {
+ transform: 'translate(0, 0)',
+ easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
+ },
+ {
+ transform: `translate(${MOTION.cardSlide.distance.x}px, ${MOTION.cardSlide.distance.y}px)`,
+ offset: MOTION.cardSlide.outOffset,
+ easing: 'linear',
+ },
+ {
+ transform: `translate(${MOTION.cardSlide.distance.x}px, ${MOTION.cardSlide.distance.y}px)`,
+ offset: MOTION.cardSlide.holdOffset,
+ easing: 'cubic-bezier(0.3, 0, 0.2, 1)',
+ },
+ { transform: 'translate(0, 0)' },
+ ],
+ { duration: MOTION.cardSlide.durationMs }
+ );
+ slideAnimation.finished.then(illuminateLeds).catch(() => {
+ // finished rejects if a fresh slide cancels this one; that slide
+ // owns the next illuminate.
+ });
+ };
+
+ onMount(() => {
+ const groups = svg ? [...svg.querySelectorAll<SVGGElement>('.led')] : [];
+ leds = groups
+ .flatMap((group) => {
+ const inset = group.querySelector<SVGElement>('.led-inset');
+ if (!inset) return [];
+ const halo = group.querySelector<SVGGraphicsElement>('.led-halo');
+ const spark = group.querySelector<SVGGraphicsElement>('.led-spark');
+ // Fit the halo/spark to the inset's geometry (getBBox is transform-
+ // independent, so this is correct even mid-slide).
+ const box = (inset as SVGGraphicsElement).getBBox();
+ const cx = box.x + box.width / 2;
+ const cy = box.y + box.height / 2;
+ if (halo) {
+ // Nudge the halo center down-and-right off the inset center, so the
+ // glow sits slightly below/ahead of the bulb rather than dead on.
+ halo.setAttribute('cx', `${cx + box.width * 0.22}`);
+ halo.setAttribute('cy', `${cy + box.height * 0.32}`);
+ halo.setAttribute('r', `${Math.max(box.width, box.height) * 0.9}`);
+ }
+ if (spark) {
+ // Upper-left of the ellipse — the implied light source.
+ spark.setAttribute('cx', `${box.x + box.width * 0.3}`);
+ spark.setAttribute('cy', `${box.y + box.height * 0.28}`);
+ spark.setAttribute('r', `${box.width * 0.13}`);
+ }
+ return [{ inset, halo, spark, cy }];
+ })
+ // Illuminate bottom-to-top by screen height (larger y = lower = first),
+ // so the front card's LED joins the back card's sweep by position.
+ .sort((a, b) => b.cy - a.cy)
+ .map(({ inset, halo, spark }) => ({ inset, halo, spark }));
+ // Powered from the start: skip the slide + LED sweep — the finale is a
+ // static state (cards filled, modules faded, LEDs dark), driven by CSS.
+ if (props.poweredUp) return;
+ if (reducedMotion()) {
+ // No slide, no pulse — just show the LEDs already lit.
+ illuminateLeds();
+ return;
+ }
+ slideDelay = setTimeout(playSlide, MOTION.cardSlide.delayMs);
+ });
+
+ // Powering up/down after mount. On: cancel any pending slide and kill the
+ // LED animations, so the white sparks (and halos) return to their hidden
+ // CSS resting state under `.powered` — a running WAAPI animation would
+ // otherwise keep them lit over the CSS. Off: relight the LEDs. Deferred, so
+ // the initial state is left to onMount above.
+ createEffect(
+ on(
+ () => props.poweredUp,
+ (powered) => {
+ if (powered) {
+ clearTimeout(slideDelay);
+ darkenLeds();
+ } else if (leds.length && !reducedMotion()) {
+ illuminateLeds();
+ }
+ },
+ { defer: true }
+ )
+ );
+
+ return (
+ <svg
+ ref={svg}
+ // Framed tightly to the actual content (modules + blocks + connectors),
+ // not the original artboard: the top module's rings sit above the old
+ // y=0 and were clipped, and the artboard left ~140 units of dead space
+ // below the blocks. The padding absorbs the modules' bob/breathe. `meet`
+ // then always shows the whole scene, and the tighter frame keeps the
+ // modules near the top edge and the blocks near the bottom.
+ viewBox={SCENE.viewBox}
+ fill="currentColor"
+ class={`setup-graphic text-ink cursor-pointer ${props.poweredUp ? 'powered ' : ''}${props.class ?? ''}`}
+ onClick={playSlide}
+ aria-hidden="true"
+ >
+ <g class="scene">
+ {/* Tethers that sit behind every card. */}
+ <g class="connectors">
+ <For each={connectorsIn('back')}>
+ {(connector) => (
+ <>
+ <path class="connector" d={connector.d} />
+ <Show when={connector.downloading}>
+ <DownloadPulse d={connector.d} />
+ </Show>
+ </>
+ )}
+ </For>
+ </g>
+ {/* The block assembly, shrunk to 2/3 about its center so the modules
+ can orbit farther out around it. */}
+ <g class="blocks" transform={BLOCKS_TRANSFORM}>
+ <g id="back_card">
+ <g id="stable_card">
+ <path
+ class="card-back"
+ d="M743.3,606l-60.4,24.1-6.7-3.6-173.4-164.4v-239.6l2.4-6.8,4.4-2.2,53.7-21.5,6.7,3.6,173.4,164.4v245.9Z"
+ />
+ <path class="guide" d="M513.1,217l166.3,157.7" />
+ <path class="guide" d="M676.2,619v-73.3" />
+ <path
+ class="arc"
+ d="M634.9,458.9c2.7-13,12.4-15.3,23.9-4.3l17.3,16.4"
+ />
+ <path
+ class="vent"
+ d="M673.9,540.3l-15-14.2c-13.6-12.9-24.7-39.4-24.7-59.1s0-1.9,0-2.8"
+ />
+ <path
+ class="vent"
+ d="M535.4,221.2c1.8-3.6,5.5-6.8,11-9,12.4-5,29-2.8,37.1,4.8h0s33.1,31.5,33.1,31.5c2.5,2.4,3.9,5,4.2,7.7"
+ />
+ <path
+ class="arc"
+ d="M620.1,261.5c-1.6,3.9-5.5,7.5-11.4,9.8-12.4,5-29,2.8-37-4.8l-33.2-31.5h0c-3.8-3.6-5-7.7-4-11.6"
+ />
+ <path
+ class="vent"
+ d="M536.9,225.2c2.1-2.6,5.3-5,9.5-6.7,12.4-5,29-2.8,37.1,4.8l33.2,31.5"
+ />
+ <path class="guide" d="M676.2,465.7v-78.7l6.7-9,53.7-21.5" />
+ <path
+ class="card-back"
+ d="M783.3,526.6l-73-69.2-34,13.6-17.3-16.4c-8.7,4.5-12.2,8.2-12.2,8.2-3.5,14.1,4.8,22.6,4.8,22.6l89.2,84.6"
+ />
+ <path
+ class="knob"
+ d="M743.3,572c-4.1-2.6-6.6-7.2-6.6-13.4,0-13.2,11.4-28.5,25.5-34.1,14.1-5.6,25.5.5,25.5,13.7s-11.4,28.5-25.5,34.1-14.2,2.6-18.8-.3"
+ />
+ <path class="guide" d="M678.9,541.1l22.1-8.8" />
+ <path
+ class="card-back"
+ d="M740.7,486.2l-51.3-48.8c-3-2.7-4.8-6.8-4.8-12.1,0-13.2,11.4-28.5,25.5-34.1,9.3-3.7,17.4-2.3,21.8,2.9l51.5,48.8"
+ />
+ <path
+ class="knob"
+ d="M743.3,488.3c-4.1-2.6-6.6-7.2-6.6-13.4,0-13.2,11.4-28.5,25.5-34.1,14.1-5.6,25.5.5,25.5,13.7s-11.4,28.5-25.5,34.1-14.2,2.6-18.8-.3"
+ />
+ <path
+ class="card-back"
+ d="M740.7,653.7l-51.3-48.8c-3-2.7-4.8-6.8-4.8-12.1,0-13.2,11.4-28.5,25.5-34.1,9.3-3.7,17.4-2.3,21.8,2.9l51.5,48.8"
+ />
+ <path
+ class="knob"
+ d="M743.3,655.8c-4.1-2.6-6.6-7.2-6.6-13.4,0-13.2,11.4-28.5,25.5-34.1,14.1-5.6,25.5.5,25.5,13.7s-11.4,28.5-25.5,34.1-14.2,2.6-18.8-.3"
+ />
+ <line class="vent" x1="513.3" y1="394" x2="513.3" y2="457.6" />
+ <line class="vent" x1="518.2" y1="397.5" x2="518.2" y2="462.2" />
+ <line class="vent" x1="523.4" y1="402.6" x2="523.4" y2="467.2" />
+ <path class="guide" d="M563.9,222.1l-21.2,8.5" />
+ <path class="guide" d="M609.1,262.9l-21.2,8.5" />
+ <g class="dot">
+ <path d="M565.5,229c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M573,231.8c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M574.1,237.1c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M581.6,239.9c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M582.7,245.3c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M590.2,248.1c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M591.3,253.4c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M598.8,256.2c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M599.9,261.6c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M559.1,231.5c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M566.6,234.3c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M567.7,239.7c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M575.2,242.5c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M576.3,247.8c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M583.8,250.6c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M584.9,256c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M592.4,258.8c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M593.5,264.1c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M552.7,234.1c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M560.2,236.9c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M561.3,242.2c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M568.8,245c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M569.9,250.4c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M577.4,253.2c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M578.5,258.5c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M586,261.3c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M587.1,266.7c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M553.8,239.4c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M562.4,247.6c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M571,255.7c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ <path d="M579.6,263.9c-.8.3-2,.2-2.5-.3s-.3-1.2.5-1.5,2-.2,2.5.3.3,1.2-.5,1.5Z" />
+ </g>
+ <path
+ class="guide"
+ d="M507.1,261.5l67.4,63.9v-18.2h.8s91.5,86.7,91.5,86.7v58.6"
+ />
+ {/* Stable half of the back card's left-face shading. The
+ Illustrator export had one polygon spanning the whole
+ assembly; it's split along the sliding piece's outline so
+ the moving half (in animating_card) travels with the
+ slide. */}
+ <path
+ class="shade"
+ d="M502.8,222.6 L685.5,396 L685.5,480 L702.2,495.9 C715.8,508.8 726.9,535.3 726.9,557 L706.7,537.8 L704.9,539.7 L692.6,548.8 L685.7,551.5 L685.7,635.5 L502.8,462.1 Z"
+ />
+ </g>
+ <g id="animating_card" ref={animatingCard}>
+ <path
+ class="panel"
+ d="M837.9,514.7l2.1-6.2v-56.6l-87.4-82.9-6.7-3.6-53.7,21.5-6.7,9v84.1l16.7,15.9c13.6,12.9,24.7,39.4,24.7,59.1s0,1.9,0,2-.2-.1-.2-.1l-20.2-19.2-.7.9-1.1,1-12.3,9.1-6.9,2.7v84.1l87.4,82.9,6.7,3.6,53.7-21.5,4.4-2.2,2.4-6.8v-57l-1.3-2.7h0s1.3-3.8,1.3-3.8v-112.4l-2.1-.8Z"
+ />
+ <path class="guide" d="M830.7,637.5l7-2.8,1-3" />
+ <path class="guide" d="M838.6,512.7l-2.4,6.8-6.2,2.6" />
+ <path class="edge" d="M793.5,705.9v-47l-1.6-7.4" />
+ <path class="guide" d="M816.8,681.3l7.9,7.5" />
+ <path
+ class="edge"
+ d="M814.6,477.9l2.3,4.5,1.9,4.3,1.7,4.4,1.5,4.5,1.3,4.5,1.1,4.4,1.2,6.5.5,4.2.3,5.8v134.3s-.2,3.9-.2,3.9l-.4,3.5-.7,3.2-1.1,3.8-1.7,4-1.3,2.3-1.5,2.2-2.6,3-4.1,3.3-4.6,2.3-5,1.3-4,.3-5.7-.6"
+ />
+ <path class="guide" d="M830.1,449.5l-50.4,20.2-84.6-80.2" />
+ <path
+ class="guide"
+ d="M828.2,475.4v43.8l-1.7,4.7,1.7,2.3v112.4l-1.7-1,1.7,7.6v47l-31.3,12.5"
+ />
+ <path
+ class="edge"
+ d="M791.9,651.5l1.6-5v-106.6l-1.7-2.1,1.7-4.8v-46.7l34.6-13.8"
+ />
+ <path
+ class="guide"
+ d="M789.4,538.8l-5.6,2.2-10.5-1.4-41.3-9.4v57.6c-.1,0,41,66.8,41,66.8l11.1,1.4,5.3-2.1"
+ />
+ <path
+ class="vent"
+ d="M726.9,556.8c0,19.7-11,25.2-24.7,12.3l-13.6-14.6"
+ />
+ <line class="vent" x1="693.6" y1="430.6" x2="693.6" y2="474.6" />
+ <line class="vent" x1="698.5" y1="434.9" x2="698.5" y2="479.2" />
+ {/* Three inset LED indicators (top → bottom in source order).
+ Each is a ring (arc/vent arcs) around an inset dot
+ (dot.led-inset); the illuminate pass lights the dot, fades
+ in the white specular spark, and pulses the halo ring. The
+ halo/spark circles are positioned onto the inset at mount
+ (getBBox), so their placeholder geometry here is unused. */}
+ <g class="led">
+ <circle class="led-halo" />
+ <path
+ class="arc"
+ d="M812.7,572.7c-2-.5-3.2-2-3.2-4.4,0-3.8,3.3-8.2,7.3-9.8s4.8-.7,6.1.6"
+ />
+ <path
+ class="vent"
+ d="M824.2,562.4c0,3.8-3.3,8.2-7.3,9.8s-1,.4-1.5.5"
+ />
+ <path
+ class="dot led-inset"
+ d="M819.2,562c0,2-1.8,4.4-3.9,5.3s-3.9,0-3.9-2.1,1.8-4.4,3.9-5.3,3.9,0,3.9,2.1Z"
+ />
+ <circle class="led-spark" />
+ </g>
+ <g class="led">
+ <circle class="led-halo" />
+ <path
+ class="arc"
+ d="M812.7,597.7c-2-.5-3.2-2-3.2-4.4,0-3.8,3.3-8.2,7.3-9.8s4.8-.7,6.1.6"
+ />
+ <path
+ class="vent"
+ d="M824.2,587.4c0,3.8-3.3,8.2-7.3,9.8s-1,.4-1.5.5"
+ />
+ <path
+ class="dot led-inset"
+ d="M819.2,587c0,2-1.8,4.4-3.9,5.3s-3.9,0-3.9-2.1,1.8-4.4,3.9-5.3,3.9,0,3.9,2.1Z"
+ />
+ <circle class="led-spark" />
+ </g>
+ <g class="led">
+ <circle class="led-halo" />
+ <path
+ class="arc"
+ d="M812.7,622.7c-2-.5-3.2-2-3.2-4.4,0-3.8,3.3-8.2,7.3-9.8s4.8-.7,6.1.6"
+ />
+ <path
+ class="vent"
+ d="M824.2,612.4c0,3.8-3.3,8.2-7.3,9.8s-1,.4-1.5.5"
+ />
+ <path
+ class="dot led-inset"
+ d="M819.2,612c0,2-1.8,4.4-3.9,5.3s-3.9,0-3.9-2.1,1.8-4.4,3.9-5.3,3.9,0,3.9,2.1Z"
+ />
+ <circle class="led-spark" />
+ </g>
+ {/* Moving half of the back card's left-face shading — lives in
+ this group so it slides with the piece. */}
+ <path
+ class="shade"
+ d="M685.5,396 L773,479.2 L773,718.3 L685.7,635.5 L685.7,551.5 L692.6,548.8 L704.9,539.7 L706.7,537.8 L726.9,557 C726.9,535.3 715.8,508.8 702.2,495.9 L685.5,480 Z"
+ />
+ </g>
+ </g>
+ {/* Tethers behind the middle card but in front of the back card.
+ Counter-transformed so their absolute coords survive being
+ nested in the scaled blocks group. */}
+ <g class="connectors" transform={INVERSE_BLOCKS_TRANSFORM}>
+ <For each={connectorsIn('mid')}>
+ {(connector) => (
+ <>
+ <path class="connector" d={connector.d} />
+ <Show when={connector.downloading}>
+ <DownloadPulse d={connector.d} />
+ </Show>
+ </>
+ )}
+ </For>
+ </g>
+ <g id="middle_card">
+ <path
+ class="card-mid"
+ d="M204.8,268.2l-14.7,5.9-2.4,6.8v180.9h0s110.7,105,110.7,105l3.1,1.7v1.3l43.4,41.2,2.9,1.6v1.3c0,0,110,104.2,110,104.2l6.7,3.6,53.7-21.5,4.4-2.2,2.4-6.8v-239.6l-214.8-203.6-6.7-3.6-15.1,6-14.1-13.4-2.4-2.1-3.6-2.5-2.4-1.3-2.4-1-3.7-1-2.6-.3h-2.2s-2.5.4-2.5.4l-2.4.7-3.2,1.6-2.8,2.3-1.4,1.6-2.6-.2-2.6.2-3.5.9-2.3,1.1-1.8,1.1-2,1.7-1.4,1.6-2.6-.2-3.6.4-2.4.7-3.2,1.6-2.8,2.3-1.7,2-1.3,1.9-1.8,3.5-1.5,5.3-.5,3-.2,2.7v3.3c-.1,0-.1,0-.1,0Z"
+ />
+ <path class="edge" d="M347.6,494.2l-1.5-3.9-44-41.7-.7,3.8v112.6" />
+ <path class="guide" d="M347.6,608.6v-112" />
+ <path class="guide" d="M510,693l-28.1,11.2" />
+ <path class="guide" d="M500.7,680.8l9.3,8.8" />
+ <path
+ class="edge"
+ d="M477.9,685.3l2.5.2,5.2-.6,3.8-1.1,1.1-.5,3.5-1.9,1-.7,3.1-2.5,3.4-4.1,2.6-4.7,1.1-2.8.7-2.4,1.1-4.7.4-3.5.2-3.9v-134.3s-.3-5.8-.3-5.8l-.5-4.2-.8-4.3-1-4.4-1.2-4.5-1.4-4.5-1.6-4.5-3.3-7.6"
+ />
+ <path
+ class="edge"
+ d="M272.3,256.8l-14.1-13.4-3.6-3-2.4-1.6-3.6-1.9-3.7-1.2-2.2-.4"
+ />
+ <path
+ class="edge"
+ d="M256.2,263.3l-14.1-13.4-2.4-2.1-1.9-1.4-2.9-1.8-2.4-1.2-3.7-1.2-2.2-.4"
+ />
+ <path class="guide" d="M239.8,330.2l-48.5-46" />
+ <path class="edge" d="M288.4,250.4l-38.6,15.4-6.7,9v58.6" />
+ <path class="guide" d="M253.4,269.2l211.2,200.2,51.1-20.4" />
+ <path
+ class="hairline"
+ d="M242.7,275.9l-14.7-12.9-2.3-1.6-1,.5-.7,4.3v1.5s0,16.9,0,16.9c0,1.9-1.5,3.6-4.3,4.7-4.5,1.8-10.4,1-13.3-1.7s-1.5-2-1.5-3v-16.3"
+ />
+ <path
+ class="hairline"
+ d="M224.3,282.7c2.8.7,6.2.6,9-.5s4.3-2.8,4.3-4.7v-6.1"
+ />
+ <path class="guide" d="M512.6,476.4v210.8" />
+ <path class="edge" d="M477.9,705.8v-219.6l34.6-13.8" />
+ <g class="dot">
+ <path d="M325.5,566.8c0,2.2-1.2,2.8-2.7,1.4s-2.7-4.3-2.7-6.5,1.2-2.8,2.7-1.4,2.7,4.3,2.7,6.5Z" />
+ <path d="M331.3,587.1c0,2.2-1.2,2.8-2.7,1.4s-2.7-4.3-2.7-6.5,1.2-2.8,2.7-1.4,2.7,4.3,2.7,6.5Z" />
+ <path d="M319.6,576.1c0,2.2-1.2,2.8-2.7,1.4s-2.7-4.3-2.7-6.5,1.2-2.8,2.7-1.4,2.7,4.3,2.7,6.5Z" />
+ </g>
+ <path
+ class="guide"
+ d="M436.5,618.3l12.5,11.8v68l-92.8-88h0s-.5-121.5-.5-121.5l-61.3-58.1v121h0s-92.4-87.6-92.4-87.6"
+ />
+ <path
+ class="vent"
+ d="M427.9,624.2c-1.4-.3-3-1.3-4.7-2.9-5.9-5.6-10.7-17.1-10.7-25.6s.2-3,.5-4.1"
+ />
+ <path
+ class="arc"
+ d="M414.4,588.7c1.9-2.3,5.2-1.9,8.9,1.6,5.9,5.6,10.7,17.1,10.7,25.6,0,4.3-1.2,7-3.1,8"
+ />
+ <polygon
+ class="shade"
+ points="187.7 280.9 187.7 461.9 457.9 718 457.9 477.7 243.1 274.8 242.7 332.9 187.7 280.9"
+ />
+ </g>
+ <g id="front_card">
+ <path
+ class="card-front"
+ d="M167.8,699.5l8.4-1.1h3.9c0,.1,6.9,1.2,6.9,1.2l3.1.8,7.2,2.9,6.8-2.7,4.4-2.2,2.4-6.8v-239.6l-95.9-90.9-6.7-3.6-53.7,21.5-4.4,2.2-2.4,6.8v116.4l1.6,1.9-1.6,4.7v116.5l46.2,43.8,3.4,1.9v1.4l46.3,43.9,6.7,3.6,4.5-1.8,3.1-1.7.8-6.2,1.9-7,1.7-3.8"
+ />
+ <path
+ class="edge"
+ d="M162.4,701.7l1.5-3.5,4.1-6.1,2.4-3.3,4.9-4.1,1.8-1.5,6.7-2.7,6.7.3,6.3,4,.4.5,2.9,4.5,1.9,5.5.8,5.5"
+ />
+ <path class="card-front" d="M162.3,701.7l5.4-2.2" />
+ <path class="guide" d="M153.7,468.6l-3.4,1.3-93.5-88.7" />
+ <path class="guide" d="M156.1,410.4l42.5,40.3,4.4,10.4v69.6" />
+ <path class="guide" d="M52.7,510.1l43.4,41.2,1.3,3.6v114.1" />
+ <path
+ class="edge"
+ d="M163.9,698.2l2.1-1,1.8-1.1,2-1.7,1.4-1.6,1.6-2.3,1.3-2.3,1.3-3.5"
+ />
+ <path
+ class="edge"
+ d="M171.1,692.7l2.6.2,3.6-.4,2.4-.7,3.2-1.6,2.8-2.3,1.7-2,1.3-1.9,1.7-3.4"
+ />
+ <path class="guide" d="M154.2,413.7v11.7" />
+ <path
+ class="guide"
+ d="M115.4,424.1l9.5-3.8.8-.3,15.3-6.1.8-.3,9.3-3.7"
+ />
+ <path class="edge" d="M160.8,552v-74l-4.4-10.4-37.8-35.8-6.6-6.3" />
+ <path class="guide" d="M199.9,536.3l-35.3,14.1" />
+ <path class="guide" d="M191.2,523.9l8.7,8.3" />
+ <path
+ class="hairline"
+ d="M133,427.2c1.2-3.5,4.3-6.9,8-8.4s5.5-.8,7,.7l.6.6,18.5,17.5s22,20.6,24.2,57.8v37.7c0,2.1-1.7,3.9-4.8,5.1s-8,1.3-11.3,0"
+ />
+ <path
+ class="hairline"
+ d="M118.5,431.6c1.6-2.6,4-4.8,6.8-5.9s5.5-.8,7,.7h0s19.7,18.7,19.7,18.7c0,0,19.2,18.7,23,56.8v37.4h0c0,2-1.7,4-4.7,5.2-3,1.2-6.5,1.3-9.5.5"
+ />
+ <path
+ class="vent"
+ d="M129.6,559.3c-.6-.5-1.3-1-1.9-1.6-8-7.6-14.6-23.2-14.6-34.9h0v-48l.3-3.9.3-1.7.5-1.5.8-1.5"
+ />
+ <path
+ class="hairline"
+ d="M135.8,553.7c0,11.6-6.5,14.9-14.6,7.3-8-7.6-14.6-23.2-14.6-34.9v-50.7c0-11.7,6.6-14.9,14.7-7.3s14.5,23.3,14.5,34.9v50.7h0Z"
+ />
+ <line class="vent" x1="56.8" y1="454.9" x2="56.8" y2="498.9" />
+ <line class="vent" x1="61.7" y1="459.2" x2="61.7" y2="503.6" />
+ {/* The front card's single LED — same treatment as the back
+ card's three (ring arcs, inset dot, halo, spark). */}
+ <g class="led">
+ <circle class="led-halo" />
+ <path
+ class="arc"
+ d="M175.6,574.4c-1.8-1-2.9-2.8-2.9-5.4,0-5.1,4.4-11,9.9-13.2s5.2-1,7,0"
+ />
+ <path
+ class="vent"
+ d="M191.5,557.6c.6,1,1,2.2,1,3.6,0,5.1-4.4,11-9.9,13.2s-3.3.9-4.6.8"
+ />
+ <path
+ class="dot led-inset"
+ d="M184.8,560.4c0,2.6-2.2,5.6-5,6.7s-5-.1-5-2.7,2.2-5.6,5-6.7,5,.1,5,2.7Z"
+ />
+ <circle class="led-spark" />
+ </g>
+ <g class="dot">
+ <path d="M72.7,624.6c0,2.2-1.2,2.8-2.7,1.4s-2.7-4.3-2.7-6.5,1.2-2.8,2.7-1.4,2.7,4.3,2.7,6.5Z" />
+ <path d="M78.5,644.9c0,2.2-1.2,2.8-2.7,1.4s-2.7-4.3-2.7-6.5,1.2-2.8,2.7-1.4,2.7,4.3,2.7,6.5Z" />
+ <path d="M66.9,633.8c0,2.2-1.2,2.8-2.7,1.4s-2.7-4.3-2.7-6.5,1.2-2.8,2.7-1.4,2.7,4.3,2.7,6.5Z" />
+ </g>
+ <polyline
+ class="shade"
+ points="47.8 388.1 47.8 627.6 143.7 718.5 143.7 480.4"
+ />
+ </g>
+ {/* Invisible geometry reference: the Macro logo at the exact spot
+ the designer superimposed it over these blocks (authored in the
+ source artwork with no transform, so its coords are in the same
+ space as the card paths above — hence its place here, inside
+ `.blocks`). Never painted; it exists so a brand handoff can
+ measure where the real logo belongs via
+ `getBoundingClientRect()` and let the browser resolve the
+ viewBox + transform math, instead of hardcoding pixel offsets
+ that would drift with the scene's size. */}
+ <g class="logo-ref" aria-hidden="true">
+ <path d="M47.8,389.1v224.9c.2,6.4,2.9,12.5,7.4,17l90.7,87.4,66.2-26.5v-234.7l-98.2-94.5-66.1,26.5Z" />
+ <path d="M182.7,216.7v191.3l45,43.3v43.4l232.9,224.6,66.2-26.5v-234.8S248.8,190.2,248.8,190.2l-66.1,26.5Z" />
+ <path d="M497.3,216.7v191.3l45,43.4-.4,43,233.4,225,66.1-26.5v-224.2c0-6.6-2.7-13-7.4-17.6l-270.5-260.8-66.2,26.5Z" />
+ </g>
+ </g>
+ {/* Tethers to front features draw over the cards. */}
+ <g class="connectors">
+ <For each={connectorsIn('front')}>
+ {(connector) => (
+ <>
+ <path class="connector" d={connector.d} />
+ <Show when={connector.downloading}>
+ <DownloadPulse d={connector.d} />
+ </Show>
+ </>
+ )}
+ </For>
+ </g>
+ {/* Modules: the configured slots, phase-offset so they don't bob in
+ unison. */}
+ <g class="modules">
+ <For each={modules()}>
+ {(module, index) => (
+ <Module
+ place={SLOTS[module.slot].place}
+ logo={module.logo}
+ state={module.state}
+ phaseMs={-index() * MOTION.modulePhaseMs}
+ />
+ )}
+ </For>
+ </g>
+ </g>
+ </svg>
+ );
+}
diff --git a/apps/web/src/features/setup/flow/BrandHandoff.tsx b/apps/web/src/features/setup/flow/BrandHandoff.tsx
new file mode 100644
index 0000000000..304f12fe02
--- /dev/null
+++ b/apps/web/src/features/setup/flow/BrandHandoff.tsx
@@ -0,0 +1,219 @@
+import LogoIcon from '@icon/macro-logo.svg';
+import { onCleanup, onMount } from 'solid-js';
+import { Portal } from 'solid-js/web';
+
+/** A viewport rect (getBoundingClientRect-style). */
+export type HandoffRect = {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+};
+
+/** The exact rendered loading scene captured just before it leaves the page. */
+export type BrandHandoffSource = {
+ /** Viewport bounds of the powered loading SVG. */
+ scene: HandoffRect;
+ /** Square Macro-logo box inside {@link scene}, in scene-relative pixels. */
+ logo: HandoffRect;
+ /** Serialized powered loading SVG, used by the transient overlay. */
+ snapshot: string;
+};
+
+/**
+ * `macro-logo.svg` is a *square* 24×24 viewBox, but its mark only occupies
+ * y 4→20 — the full width, two thirds of the height. So rendering it in a
+ * square box of side S paints the mark at width S, height S·2/3, inset S/6
+ * from the box's top. Sizing the box to the mark's rect (the obvious thing)
+ * therefore draws the mark a third too small.
+ */
+const LOGO_VIEWBOX = 24;
+const LOGO_MARK_TOP = 4;
+
+/**
+ * The square box to render {@link LogoIcon} in so its *mark* lands exactly on
+ * `mark`. Anchored on width, which the mark spans edge to edge.
+ */
+export function logoBoxForMark(mark: HandoffRect): HandoffRect {
+ const side = mark.width;
+ return {
+ x: mark.x,
+ y: mark.y - side * (LOGO_MARK_TOP / LOGO_VIEWBOX),
+ width: side,
+ height: side,
+ };
+}
+
+/** The travel from the loading scene to the summary header's logo slot. */
+const MOVE_MS = 780;
+/** The graphic → logo dissolve deliberately waits until the latter half of
+ * the travel, when the scene is already compact and near its header slot.
+ * The logo leads slightly so the pair never dips dark mid-crossfade. */
+const GRAPHIC_FADE_START = 0.58;
+const GRAPHIC_FADE_END = 0.92;
+const LOGO_FADE_START = 0.52;
+const LOGO_FADE_END = 0.84;
+/** Give the newly-rendered summary logo up to roughly one second to mount. */
+const TARGET_RETRY_LIMIT = 60;
+
+/**
+ * Building → summary brand handoff: the powered-up loading scene shrinks to
+ * the summary header's logo slot, dissolving into the real Macro logo *as* it
+ * travels — the movement covers the fact that the isometric mark and the flat
+ * logo aren't quite the same geometry.
+ *
+ * The overlay is the scene's own frame (a clone of the powered graphic filling
+ * it, with the logo laid over the mark inside it), so scaling the frame moves
+ * graphic and logo in lockstep and the two marks stay aligned for the whole
+ * crossfade. The transform is solved so the *logo* lands on the target: both
+ * it and the header slot are square boxes rendering the same square viewBox,
+ * so matching them centre-to-centre with a uniform scale necessarily matches
+ * the marks inside.
+ *
+ * Rendered through a Portal to `document.body` so `position: fixed` resolves
+ * against the viewport regardless of any transformed ancestor in the flow
+ * (the flow's own card mount animation ends on a non-`none` `transform`,
+ * which — per spec — establishes a containing block for `fixed` descendants;
+ * without the Portal this silently breaks the positioning).
+ *
+ * The building step's `Stepper.Step` is marked `noTransition` so it's torn
+ * down the instant we advance: a fading exit would leave the original graphic
+ * visible right where this clone appears, i.e. two overlapping copies.
+ *
+ * `onDone` fires when the move lands, so the flow can reveal the real summary
+ * logo (pixel-identical to where this settled) in the same tick this is
+ * dropped.
+ */
+export function BrandHandoff(props: {
+ /** The loading scene's `.setup-graphic` rect, in viewport coords. */
+ scene: HandoffRect;
+ /** The logo's square box *relative to `scene`* — where the flat logo sits
+ * over the isometric mark (see {@link logoBoxForMark}). */
+ logo: HandoffRect;
+ /** outerHTML of the powered `.setup-graphic`, cloned to fill the frame. */
+ snapshot: string;
+ /** Selector for the destination logo (rendered on the summary step). */
+ targetSelector: string;
+ onDone: () => void;
+}) {
+ let frame: HTMLDivElement | undefined;
+ let graphicEl: HTMLDivElement | undefined;
+ let logoEl: HTMLDivElement | undefined;
+ let raf1 = 0;
+ let raf2 = 0;
+ let targetRetries = 0;
+ const anims: Animation[] = [];
+ onCleanup(() => {
+ cancelAnimationFrame(raf1);
+ cancelAnimationFrame(raf2);
+ for (const anim of anims) anim.cancel();
+ });
+
+ onMount(() => {
+ const run = () => {
+ const target = document.querySelector(props.targetSelector);
+ if (!target || !frame) {
+ targetRetries += 1;
+ if (targetRetries >= TARGET_RETRY_LIMIT) {
+ props.onDone();
+ return;
+ }
+ raf1 = requestAnimationFrame(run);
+ return;
+ }
+ const to = target.getBoundingClientRect();
+ // `transform-origin` is the frame's top-left, so a point (lx, ly) local
+ // to the frame lands at (scene.x + lx·scale + dx, …). Solve for the
+ // logo's local box to land on the target.
+ const scale = to.width / props.logo.width;
+ const dx = to.x - props.scene.x - props.logo.x * scale;
+ const dy = to.y - props.scene.y - props.logo.y * scale;
+
+ const timing = {
+ duration: MOVE_MS,
+ easing: 'cubic-bezier(0.6, 0, 0.2, 1)',
+ fill: 'forwards' as const,
+ };
+ const move = frame.animate(
+ [
+ { transform: 'translate(0px, 0px) scale(1)' },
+ { transform: `translate(${dx}px, ${dy}px) scale(${scale})` },
+ ],
+ timing
+ );
+ anims.push(move);
+ // Dissolve during the travel. Linear so the two halves cross evenly
+ // (the move's own easing already carries the motion's character).
+ if (graphicEl) {
+ anims.push(
+ graphicEl.animate(
+ [
+ { opacity: 1, offset: 0 },
+ { opacity: 1, offset: GRAPHIC_FADE_START },
+ { opacity: 0, offset: GRAPHIC_FADE_END },
+ { opacity: 0, offset: 1 },
+ ],
+ { duration: MOVE_MS, easing: 'linear', fill: 'forwards' }
+ )
+ );
+ }
+ if (logoEl) {
+ anims.push(
+ logoEl.animate(
+ [
+ { opacity: 0, offset: 0 },
+ { opacity: 0, offset: LOGO_FADE_START },
+ { opacity: 1, offset: LOGO_FADE_END },
+ { opacity: 1, offset: 1 },
+ ],
+ { duration: MOVE_MS, easing: 'linear', fill: 'forwards' }
+ )
+ );
+ }
+ move.finished.then(props.onDone).catch(() => {});
+ };
+ // Two rAFs: the summary step's DOM has just swapped in; this lets layout
+ // settle before measuring its logo slot, without a guessed timeout.
+ raf1 = requestAnimationFrame(() => {
+ raf2 = requestAnimationFrame(run);
+ });
+ });
+
+ return (
+ <Portal>
+ <div
+ ref={frame}
+ aria-hidden="true"
+ class="pointer-events-none fixed z-[60]"
+ style={{
+ left: `${props.scene.x}px`,
+ top: `${props.scene.y}px`,
+ width: `${props.scene.width}px`,
+ height: `${props.scene.height}px`,
+ 'transform-origin': 'top left',
+ }}
+ >
+ {/* The powered scene, filling the frame exactly as it did in place. */}
+ <div
+ ref={graphicEl}
+ class="absolute inset-0 [&_svg]:size-full [&_svg]:overflow-visible"
+ innerHTML={props.snapshot}
+ />
+ {/* The flat logo, laid over the scene's mark inside the same frame. */}
+ <div
+ ref={logoEl}
+ class="absolute text-accent"
+ style={{
+ left: `${props.logo.x}px`,
+ top: `${props.logo.y}px`,
+ width: `${props.logo.width}px`,
+ height: `${props.logo.height}px`,
+ opacity: 0,
+ }}
+ >
+ <LogoIcon class="size-full" />
+ </div>
+ </div>
+ </Portal>
+ );
+}
diff --git a/apps/web/src/features/setup/flow/BuildingStep.tsx b/apps/web/src/features/setup/flow/BuildingStep.tsx
index 52aa521609..9ca9680702 100644
--- a/apps/web/src/features/setup/flow/BuildingStep.tsx
+++ b/apps/web/src/features/setup/flow/BuildingStep.tsx
@@ -1,66 +1,237 @@
-import { LoadingSpinner } from '@core/component/LoadingSpinner';
-import { createSignal, onCleanup, onMount, Show } from 'solid-js';
-
-/** The breather before the summary: brand animation + cycling phrases for
- * ~22s, then auto-advance. Pure theater — nothing waits on real work. */
-
-const BUILDING_PHRASES = [
- 'Building your unified workspace…',
- 'Processing your inbox…',
- 'Linking people, docs, and threads…',
- 'Distilling months of context…',
- 'Bringing in your tasks and docs…',
- 'Waking up your Macro…',
+import { createSignal, onCleanup, onMount } from 'solid-js';
+import { createStore } from 'solid-js/store';
+import type { ModuleLogo } from '../Module';
+import { MODULE_LOGOS } from '../moduleLogos';
+import { type ModuleConfig, SetupGraphic } from '../SetupGraphic';
+import { type BrandHandoffSource, logoBoxForMark } from './BrandHandoff';
+
+/** Which tools the user connected during the flow — decides which modules
+ * appear in the loading scene. */
+export type ConnectedTools = {
+ google: boolean;
+ linear: boolean;
+ notion: boolean;
+ slack: boolean;
+ github: boolean;
+};
+
+/** The theatrical hold scales with how many accounts connected: a quick 5s
+ * when there's nothing to show, up to the full 15s once more than two are
+ * connected. The rest of the timeline compresses to fit. */
+const MIN_HOLD_MS = 5_000;
+const MAX_HOLD_MS = 15_000;
+
+/** A scripted, purely-theatrical fill for the progress bar: bursts of varying
+ * speed with a couple of stalls between them (including a long one near the
+ * end before the finish). `fill` eases the bar to `to`% over that many ms; a
+ * `pause` just holds. Offsets accumulate and land ~100% just before the hold
+ * ends. */
+type BarSegment = { to: number; fill: number } | { pause: number };
+const BAR_TIMELINE: BarSegment[] = [
+ { to: 22, fill: 900 }, // initial climb
+ { pause: 1600 },
+ { to: 40, fill: 650 }, // quick surge
+ { pause: 2800 }, // stall
+ { to: 68, fill: 1100 },
+ { pause: 1900 },
+ { to: 86, fill: 550 }, // quick surge
+ { pause: 3000 }, // long stall right before the finish
+ { to: 100, fill: 1600 }, // final climb
+];
+/** A short beat before the first burst — also lets the 0% paint before the
+ * first width change so its transition triggers (no mount-frame jump). */
+const BAR_START_DELAY_MS = 200;
+/** Easing per burst: fast off the mark, easing into each hold. */
+const BAR_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';
+
+/** Slots the connected accounts fill, in populate order. */
+const SLOT_ORDER = [
+ 'frontPill',
+ 'midBack',
+ 'backFar',
+ 'midFar',
+ 'midPort',
+] as const;
+
+/** Tools in the order they're assigned to {@link SLOT_ORDER}, each with its
+ * module logo. Filtered to the ones the user connected. */
+const TOOL_LOGOS: { key: keyof ConnectedTools; logo: ModuleLogo }[] = [
+ { key: 'google', logo: MODULE_LOGOS.Google },
+ { key: 'linear', logo: MODULE_LOGOS.Linear },
+ { key: 'notion', logo: MODULE_LOGOS.Notion },
+ { key: 'slack', logo: MODULE_LOGOS.Slack },
+ { key: 'github', logo: MODULE_LOGOS.GitHub },
];
-const BUILDING_HOLD_MS = 22_000;
-const PHRASE_MS = BUILDING_HOLD_MS / BUILDING_PHRASES.length;
+/** A beat of all-idle before the first module starts downloading. */
+const MODULE_IDLE_LEAD_MS = 700;
+/** After the last module links, a short buffer before powering up. */
+const POST_LINK_BUFFER_MS = 300;
+/** Hold on the fully powered graphic before handing off. The graphic → logo
+ * dissolve runs during the handoff's travel (see BrandHandoff), so the
+ * motion covers the geometry mismatch between the isometric mark and the
+ * flat logo. */
+const POWERED_HOLD_MS = 700;
+/** Total time reserved after the last module links: buffer + hold. `onDone`
+ * fires once this has played out. */
+const POWERED_TAIL_MS = POST_LINK_BUFFER_MS + POWERED_HOLD_MS;
-export function BuildingStep(props: { onDone: () => void }) {
- const [phraseIndex, setPhraseIndex] = createSignal(0);
+export function BuildingStep(props: {
+ connected: ConnectedTools;
+ onDone: (source: BrandHandoffSource | null) => void;
+}) {
+ // Bar fill % and the transition duration for the current burst — set
+ // together per segment so each burst eases over its own `fill` time.
+ const [progress, setProgress] = createSignal(0);
+ const [burstMs, setBurstMs] = createSignal(0);
+
+ // The scene's modules: one per connected account, filling SLOT_ORDER. A
+ // store (not a fresh array per change) so toggling a module's state updates
+ // it in place — the For in SetupGraphic keeps each Module mounted, so its
+ // ambient motion doesn't restart. Empty when nothing was connected: the
+ // three cards still render on their own.
+ const [modules, setModules] = createStore<ModuleConfig[]>(
+ TOOL_LOGOS.filter((tool) => props.connected[tool.key]).map((tool, i) => ({
+ slot: SLOT_ORDER[i],
+ logo: tool.logo,
+ state: 'idle',
+ }))
+ );
+ const [poweredUp, setPoweredUp] = createSignal(false);
+
+ // This holds the rendered SVG, not the outer scene wrapper: its viewport
+ // rect and serialized markup are exactly what the portal overlay needs to
+ // continue the scene without a visual jump.
+ let sceneEl: HTMLDivElement | undefined;
onMount(() => {
- const interval = setInterval(() => {
- setPhraseIndex((index) =>
- Math.min(index + 1, BUILDING_PHRASES.length - 1)
+ // The hold scales 5s → 15s with the connected count (maxing out past two
+ // accounts); the whole theatrical timeline compresses by `scale` to fit.
+ const n = modules.length;
+ const holdMs =
+ MIN_HOLD_MS + (MAX_HOLD_MS - MIN_HOLD_MS) * (Math.min(n, 3) / 3);
+ const scale = holdMs / MAX_HOLD_MS;
+
+ // Cycle each module idle → downloading → linked, evenly spaced across the
+ // hold and reserving a tail for the powered-up finale. Each module
+ // downloads for its whole slice, then flips to linked as the next begins.
+ const moduleTimers: ReturnType<typeof setTimeout>[] = [];
+ const idleLead = MODULE_IDLE_LEAD_MS * scale;
+ const tail = POWERED_TAIL_MS * scale;
+ if (n > 0) {
+ const window = holdMs - idleLead - tail;
+ const slice = window / n;
+ for (let i = 0; i < n; i++) {
+ moduleTimers.push(
+ setTimeout(
+ () => setModules(i, 'state', 'downloading'),
+ idleLead + i * slice
+ )
+ );
+ moduleTimers.push(
+ setTimeout(
+ () => setModules(i, 'state', 'linked'),
+ idleLead + (i + 1) * slice
+ )
+ );
+ }
+ }
+ // Power up once everything's linked (or, with nothing connected, just
+ // before the end). Modules are cleared in the same tick: SetupGraphic
+ // fades `.modules` out over 700ms on `.powered`, and since they're
+ // already `linked` (steady accent) by now, that lingering fade reads as
+ // a stray offset logo hanging next to the cards as they fill in.
+ // Clearing the array unmounts them outright — no separate exit
+ // transition is wired up for the `<For>` — so power-up is a clean cut
+ // straight to the cards.
+ const powerAt = holdMs - tail + (n > 0 ? POST_LINK_BUFFER_MS * scale : 0);
+ const powerTimer = setTimeout(() => {
+ setModules([]);
+ setPoweredUp(true);
+ }, powerAt);
+
+ // Capture the powered SVG after a beat, then let the parent mount a
+ // portal overlay which moves this exact scene while dissolving it into the
+ // flat Macro logo. Capturing rather than re-rendering avoids a one-frame
+ // reset of the SVG's CSS/WAAPI state at the handoff boundary.
+ const handoffAt = powerAt + POWERED_HOLD_MS * scale;
+ const handoffTimer = setTimeout(() => {
+ const graphic = sceneEl?.querySelector<SVGSVGElement>('.setup-graphic');
+ const scene = graphic?.getBoundingClientRect();
+ const mark = graphic?.querySelector('.logo-ref')?.getBoundingClientRect();
+ if (!graphic || !scene || !mark) {
+ props.onDone(null);
+ return;
+ }
+ props.onDone({
+ scene: {
+ x: scene.x,
+ y: scene.y,
+ width: scene.width,
+ height: scene.height,
+ },
+ // This is relative to the SVG's box because the portal frame starts
+ // at that same box. `logoBoxForMark` accounts for the SVG icon's
+ // vertical viewBox padding, so the *painted* logo aligns to the mark.
+ logo: logoBoxForMark({
+ x: mark.x - scene.x,
+ y: mark.y - scene.y,
+ width: mark.width,
+ height: mark.height,
+ }),
+ snapshot: graphic.outerHTML,
+ });
+ }, handoffAt);
+
+ // Progress bar: the same scripted bursts/stalls, compressed by `scale`.
+ const timers: ReturnType<typeof setTimeout>[] = [];
+ let offset = BAR_START_DELAY_MS * scale;
+ for (const segment of BAR_TIMELINE) {
+ if ('pause' in segment) {
+ offset += segment.pause * scale;
+ continue;
+ }
+ const { to, fill } = segment;
+ const dur = fill * scale;
+ timers.push(
+ setTimeout(() => {
+ setBurstMs(dur);
+ setProgress(to);
+ }, offset)
);
- }, PHRASE_MS);
- const done = setTimeout(props.onDone, BUILDING_HOLD_MS);
+ offset += dur;
+ }
+
onCleanup(() => {
- clearInterval(interval);
- clearTimeout(done);
+ for (const timer of timers) clearTimeout(timer);
+ for (const timer of moduleTimers) clearTimeout(timer);
+ clearTimeout(powerTimer);
+ clearTimeout(handoffTimer);
});
});
- const progress = () => ((phraseIndex() + 1) / BUILDING_PHRASES.length) * 100;
-
return (
<div class="flex flex-col items-center gap-8 py-16">
- <style>{
- /*css*/ `
- @keyframes obf-phrase-in {
- from { opacity: 0; transform: translateY(6px); }
- to { opacity: 1; transform: translateY(0); }
- }
- .obf-phrase { animation: obf-phrase-in 400ms ease-out both; }
- `
- }</style>
-
- <LoadingSpinner class="size-28 p-0" />
-
- {/* Keyed so each phrase re-enters with the fade-up animation. */}
- <Show when={BUILDING_PHRASES[phraseIndex()]} keyed>
- {(phrase) => (
- <p class="obf-phrase min-h-6 text-center text-base text-ink">
- {phrase}
- </p>
- )}
- </Show>
+ {/* The isometric scene: three cards always present, with connected
+ accounts cycling in before resolving into the powered Macro mark.
+ Its exact final SVG is captured and carried by the parent handoff. */}
+ <div ref={sceneEl} class="relative h-[28rem] w-full">
+ <div class="absolute inset-0">
+ <SetupGraphic
+ class="size-full"
+ modules={modules}
+ poweredUp={poweredUp()}
+ />
+ </div>
+ </div>
<div class="h-1 w-48 overflow-hidden rounded-full bg-ink/10">
<div
- class="h-full rounded-full bg-accent transition-all duration-1000 ease-linear"
- style={{ width: `${progress()}%` }}
+ class="h-full rounded-full bg-accent"
+ style={{
+ width: `${progress()}%`,
+ transition: `width ${burstMs()}ms ${BAR_EASING}`,
+ }}
/>
</div>
</div>
diff --git a/apps/web/src/features/setup/flow/OnboardingFlow.tsx b/apps/web/src/features/setup/flow/OnboardingFlow.tsx
index 40fe0af65b..7213a1a6ed 100644
--- a/apps/web/src/features/setup/flow/OnboardingFlow.tsx
+++ b/apps/web/src/features/setup/flow/OnboardingFlow.tsx
@@ -23,7 +23,10 @@ import {
Show,
Suspense,
} from 'solid-js';
-import { BuildingStep } from './BuildingStep';
+import type { ModuleLogo, ModuleState } from '../Module';
+import { MODULE_LOGOS } from '../moduleLogos';
+import { BrandHandoff, type BrandHandoffSource } from './BrandHandoff';
+import { BuildingStep, type ConnectedTools } from './BuildingStep';
import { ConnectorStep } from './ConnectorStep';
import { createFlowFinish } from './createFlowFinish';
import { EmailStep } from './EmailStep';
@@ -34,6 +37,7 @@ import {
resolveOnboardingStepIndex,
} from './onboardingConnectorConfig';
import { PlanStep } from './PlanStep';
+import { connectorLogo, StepModule } from './StepModule';
import { SummaryStep } from './SummaryStep';
import {
FLOW_NEXT_STORAGE_KEY,
@@ -50,6 +54,13 @@ import { TeamStep } from './TeamStep';
* step marks onboarding complete.
*/
+/** The left-of-title hero module for a connection step (desktop only). Its
+ * `linked` state is resolved from the flow's live queries by key: `email`
+ * from the email links, `connector` from the named MCP server's auth. */
+type StepModuleDef =
+ | { kind: 'email'; logo: ModuleLogo }
+ | { kind: 'connector'; serverName: string; logo: ModuleLogo };
+
interface StepDef {
key: string;
/** Header title; omitted for chromeless steps (the building screen). */
@@ -59,6 +70,13 @@ interface StepDef {
wide?: boolean;
/** Excluded from the progress dots (transitions, not stops). */
noDot?: boolean;
+ /** Skip the Stepper's enter/exit fade+scale for this step. The building
+ * step needs this: the brand-handoff overlay it mounts is measured
+ * against its own logo's exact rect, and a fading exit would leave the
+ * original visible (transitioning) at the same time as the overlay. */
+ noTransition?: boolean;
+ /** Hero module shown left of the title on connection steps. */
+ module?: StepModuleDef;
render: (controls: StepControls) => JSX.Element;
}
@@ -121,7 +139,9 @@ const CONNECTOR_COPY: Record<string, ConnectorStepCopy> = {
};
function buildSteps(
- connectorNames: readonly OnboardingConnectorServerName[]
+ connectorNames: readonly OnboardingConnectorServerName[],
+ connectedTools: () => ConnectedTools,
+ onBuildingDone: (source: BrandHandoffSource | null) => void
): StepDef[] {
const connectorSteps: StepDef[] = connectorNames.flatMap((name) => {
const server = FEATURED_MCP_SERVERS.find(
@@ -129,11 +149,15 @@ function buildSteps(
);
const copy = CONNECTOR_COPY[name];
if (!server || !copy) return [];
+ const logo = connectorLogo(name);
return [
{
key: `connect-${name.toLowerCase()}`,
title: `Connect ${name}`,
subtitle: copy.subtitle,
+ ...(logo && {
+ module: { kind: 'connector', serverName: name, logo },
+ }),
render: (controls: StepControls) => (
<ConnectorStep
server={server}
@@ -153,6 +177,7 @@ function buildSteps(
title: 'Connect your Google accounts',
subtitle:
'Macro builds one unified memory across everything you do. Connecting multiple email accounts brings your email, docs, and calendar together, so nothing lives in a silo.',
+ module: { kind: 'email', logo: MODULE_LOGOS.Google },
render: (controls) => (
<EmailStep onContinue={controls.next} onSkip={controls.skip} />
),
@@ -168,10 +193,17 @@ function buildSteps(
),
},
{
- // Pure theater while gathers land; auto-advances into the summary.
+ // Pure theater while gathers land; auto-advances into the summary via
+ // the brand handoff (not a plain step advance).
key: 'building',
noDot: true,
- render: (controls) => <BuildingStep onDone={controls.next} />,
+ // Room for the isometric scene.
+ wide: true,
+ // See StepDef.noTransition.
+ noTransition: true,
+ render: () => (
+ <BuildingStep connected={connectedTools()} onDone={onBuildingDone} />
+ ),
},
{
key: 'summary',
@@ -240,11 +272,56 @@ function FlowContent() {
const serversQuery = useMcpServersQuery({ neverSuspend: true });
const analytics = useAnalytics();
+ // Live connection state, derived from the flow's queries (no standing
+ // bookkeeping): whether an MCP server authenticated, and which tools the
+ // user connected. Drives the hero-module states and the build phrases.
+ const serverAuthed = (name: string) =>
+ (serversQuery.data ?? []).some(
+ (server) => server.server_name === name && server.authenticated
+ );
+ const connectedTools = (): ConnectedTools => ({
+ google: (linksQuery.data?.links.length ?? 0) > 0,
+ linear: serverAuthed('Linear'),
+ notion: serverAuthed('Notion'),
+ slack: serverAuthed('Slack'),
+ github: serverAuthed('GitHub'),
+ });
+
+ // The building → summary brand handoff. BuildingStep provides the exact
+ // powered SVG plus its logo geometry; the overlay carries that scene into
+ // the summary header while dissolving it into the flat Macro logo.
+ const [handoff, setHandoff] = createSignal<BrandHandoffSource | null>(null);
+ // Summary reveal gates: the logo slot + rest of the content appear once the
+ // handoff lands. Default shown, for a summary reached without a handoff
+ // (e.g. a restored step).
+ const [logoShown, setLogoShown] = createSignal(true);
+ const [contentShown, setContentShown] = createSignal(true);
+ const summaryContentHidden = () =>
+ currentStep().key === 'summary' && !contentShown();
+ // Hiding must be instant, revealing eased. The header/body wrappers are
+ // shared across steps, so a symmetric transition would animate 1 → 0 as we
+ // enter the summary — the content visibly flashing in and fading out behind
+ // the travelling logo.
+ const contentFadeMs = () => (summaryContentHidden() ? 0 : 300);
+ const startBrandHandoff = (source: BrandHandoffSource | null) => {
+ if (!source) {
+ advance('completed');
+ return;
+ }
+ setHandoff(source);
+ // Hide the summary's own content so only the settling logo shows.
+ setLogoShown(false);
+ setContentShown(false);
+ advance('completed');
+ };
+
const connectorConfig = useFeatureFlag(ONBOARDING_CONNECTORS_FEATURE_FLAG);
const steps = createMemo(() => {
const config = connectorConfig();
return buildSteps(
- resolveOnboardingConnectorNames(config.enabled, config.payload)
+ resolveOnboardingConnectorNames(config.enabled, config.payload),
+ connectedTools,
+ startBrandHandoff
);
});
@@ -259,6 +336,17 @@ function FlowContent() {
const currentStepKey = createMemo(() => currentStep().key);
const userId = () => userInfoQuery.data?.userId;
+ // The current step's hero-module state: the email module lights once any
+ // inbox is linked, a connector's once its server authenticates.
+ const heroState = (): ModuleState => {
+ const mod = currentStep().module;
+ if (!mod) return 'idle';
+ if (mod.kind === 'email') {
+ return (linksQuery.data?.links.length ?? 0) > 0 ? 'linked' : 'idle';
+ }
+ return serverAuthed(mod.serverName) ? 'linked' : 'idle';
+ };
+
// Resume where a full-page OAuth round-trip left off — only for the user
// who saved the step: sessionStorage is per-tab, and a different account
// logging in on the same tab must not inherit the previous user's step.
@@ -408,53 +496,110 @@ function FlowContent() {
<div class="flex flex-col gap-8">
<Show when={currentStep().title}>
<div class="flex flex-col gap-1.5">
- <h1 class="text-2xl font-semibold tracking-tight text-ink">
- {currentStep().title}
- </h1>
- <Show when={currentStep().subtitle}>
- <p class="max-w-md text-sm leading-relaxed text-ink-muted">
- {currentStep().subtitle}
- </p>
+ {/* Hero module above the title — desktop only. Nudged left by
+ the module's built-in viewBox padding (reserved for the
+ click-burst trail) so its at-rest artwork left-aligns with
+ the title text. */}
+ <Show when={currentStep().module}>
+ {(mod) => (
+ <StepModule
+ logo={mod().logo}
+ state={heroState()}
+ class="mb-1 hidden size-32 -ml-8 sm:block"
+ />
+ )}
</Show>
+ {/* Landing slot for the loading-graphic → logo handoff. Kept
+ hidden while the overlay is mid-flight; the overlay lands
+ exactly here, then this static logo takes over. */}
+ <Show when={currentStep().key === 'summary'}>
+ <LogoIcon
+ id="summary-brand-logo"
+ class="mb-1 size-16 text-accent"
+ style={{ opacity: logoShown() ? 1 : 0 }}
+ />
+ </Show>
+ <div
+ class="flex flex-col gap-1.5 transition-opacity"
+ style={{
+ opacity: summaryContentHidden() ? 0 : 1,
+ 'transition-duration': `${contentFadeMs()}ms`,
+ }}
+ >
+ <h1 class="text-2xl font-semibold tracking-tight text-ink">
+ {currentStep().title}
+ </h1>
+ <Show when={currentStep().subtitle}>
+ <p class="max-w-md text-sm leading-relaxed text-ink-muted">
+ {currentStep().subtitle}
+ </p>
+ </Show>
+ </div>
</div>
</Show>
- <Stepper step={stepIndex()} transition={Stepper.transitions.scale}>
- <For each={steps()}>
- {(step) => (
- <Stepper.Step>
- {/* Per-step boundary: a first-load query suspending
- inside the Stepper's Transition would drop the
- entering node entirely. */}
- <Suspense fallback={<StepFallback />}>
- {step.render(controls)}
- </Suspense>
- </Stepper.Step>
- )}
- </For>
- </Stepper>
-
- <Show when={!currentStep().noDot}>
- <div class="flex gap-1.5">
- <Index each={steps().filter((step) => !step.noDot)}>
+ <div
+ class="flex flex-col gap-8 transition-opacity"
+ style={{
+ opacity: summaryContentHidden() ? 0 : 1,
+ 'transition-duration': `${contentFadeMs()}ms`,
+ }}
+ >
+ <Stepper
+ step={stepIndex()}
+ transition={Stepper.transitions.scale}
+ >
+ <For each={steps()}>
{(step) => (
- <div
- class={cn(
- 'size-1.5 rounded-full transition-colors',
- stepIndex() === steps().indexOf(step())
- ? 'bg-accent'
- : stepIndex() > steps().indexOf(step())
- ? 'bg-ink/40'
- : 'bg-ink/15'
- )}
- />
+ <Stepper.Step noTransition={step.noTransition}>
+ <Suspense fallback={<StepFallback />}>
+ {step.render(controls)}
+ </Suspense>
+ </Stepper.Step>
)}
- </Index>
- </div>
- </Show>
+ </For>
+ </Stepper>
+
+ <Show when={!currentStep().noDot}>
+ <div class="flex gap-1.5">
+ <Index each={steps().filter((step) => !step.noDot)}>
+ {(step) => (
+ <div
+ class={cn(
+ 'size-1.5 rounded-full transition-colors',
+ stepIndex() === steps().indexOf(step())
+ ? 'bg-accent'
+ : stepIndex() > steps().indexOf(step())
+ ? 'bg-ink/40'
+ : 'bg-ink/15'
+ )}
+ />
+ )}
+ </Index>
+ </div>
+ </Show>
+ </div>
</div>
</div>
</div>
+
+ {/* Brand handoff overlay — rendered outside the animated card (a
+ transformed ancestor would break its fixed positioning). */}
+ <Show when={handoff()}>
+ {(active) => (
+ <BrandHandoff
+ scene={active().scene}
+ logo={active().logo}
+ snapshot={active().snapshot}
+ targetSelector="#summary-brand-logo"
+ onDone={() => {
+ setLogoShown(true);
+ setContentShown(true);
+ setHandoff(null);
+ }}
+ />
+ )}
+ </Show>
</div>
);
}
diff --git a/apps/web/src/features/setup/flow/StepModule.tsx b/apps/web/src/features/setup/flow/StepModule.tsx
new file mode 100644
index 0000000000..31b4905024
--- /dev/null
+++ b/apps/web/src/features/setup/flow/StepModule.tsx
@@ -0,0 +1,43 @@
+import { Module, type ModuleLogo, type ModuleState } from '../Module';
+import { MODULE_LOGOS } from '../moduleLogos';
+import '../SetupGraphic.css';
+
+/**
+ * Frames a single {@link Module} with room for its click-burst (the body
+ * thrust down-right and the jet trail streaking up-left).
+ */
+const MODULE_VIEWBOX = '210 -40 310 310';
+
+/**
+ * A single hovering module as a connection step's hero: the isometric tile
+ * carrying a brand logo, dropped into a bare SVG host (the root just needs the
+ * `setup-graphic` class for styling and `currentColor` for the ink linework).
+ *
+ * `state` reflects the connection: `idle` before, `linked` (logo held accent)
+ * once connected. Clicking the module plays its acceleration burst.
+ */
+export function StepModule(props: {
+ logo: ModuleLogo;
+ state?: ModuleState;
+ class?: string;
+}) {
+ return (
+ <svg
+ viewBox={MODULE_VIEWBOX}
+ fill="currentColor"
+ class={`setup-graphic text-ink ${props.class ?? ''}`}
+ aria-hidden="true"
+ >
+ <Module logo={props.logo} state={props.state} />
+ </svg>
+ );
+}
+
+/**
+ * The module logo for a featured connector, keyed by its `server_name`
+ * (`Linear` / `Notion` / `Slack` / `GitHub`). Returns undefined for a name
+ * without a brand mark.
+ */
+export function connectorLogo(serverName: string): ModuleLogo | undefined {
+ return (MODULE_LOGOS as Record<string, ModuleLogo>)[serverName];
+}
diff --git a/apps/web/src/features/setup/flow/SummaryStep.tsx b/apps/web/src/features/setup/flow/SummaryStep.tsx
index 9d0a7b81e3..454ed29382 100644
--- a/apps/web/src/features/setup/flow/SummaryStep.tsx
+++ b/apps/web/src/features/setup/flow/SummaryStep.tsx
@@ -110,7 +110,7 @@ export function SummaryStep(props: { onContinue: () => void }) {
</For>
<Show when={!anythingToShow()}>
- <p class="py-4 text-center text-sm text-ink-extra-muted">
+ <p class="py-4 text-sm text-ink-extra-muted">
Nothing queued — you can always ask Macro AI to bring things in later.
</p>
</Show>
diff --git a/apps/web/src/features/setup/moduleLogos.ts b/apps/web/src/features/setup/moduleLogos.ts
new file mode 100644
index 0000000000..6a6a22002d
--- /dev/null
+++ b/apps/web/src/features/setup/moduleLogos.ts
@@ -0,0 +1,42 @@
+import type { ModuleLogo } from './Module';
+
+/**
+ * Brand marks for the connectable tools, ready to drop onto a module face via
+ * {@link Module}. Each is one or more path `d` strings filled with
+ * `currentColor` and placed with the flat-logo face transform.
+ *
+ * Shared by the setup scene and the connection-step modules so the paths live
+ * in one place.
+ */
+export const MODULE_LOGOS = {
+ Linear: {
+ paths: [
+ 'M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z',
+ ],
+ },
+ // Four closed segments; filled with currentColor they read as a solid
+ // monochrome G like the other logos.
+ Google: {
+ paths: [
+ 'm12.361 10.57v3.9663h4.6219c-0.4078 0.80304-1.004 1.4955-1.7375 2.0182l3.1612 2.5282c2.0047-1.8044 3.1501-4.3737 3.1519-7.0704v-0.72113c0-0.39827-0.32296-0.72113-0.72138-0.72113z',
+ 'm6.4089 12.012a5.5531 5.5512 0 0 1 0.33738-1.8936l-3.1977-2.5572a9.505 9.5024 0 0 0 0 8.9014l3.1977-2.5572a5.5531 5.5512 0 0 1-0.33738-1.8936z',
+ 'm12 6.4232a5.5538 5.5519 0 0 1 3.2881 1.0786l2.9289-2.7325a9.5329 9.5294 0 0 0-14.668 2.7918l3.1977 2.5572a5.595 5.5932 0 0 1 5.2532-3.6952z',
+ 'm18.399 19.077-3.1528-2.5214a5.5868 5.585 0 0 1-8.5006-2.6502l-3.1977 2.5572a9.5539 9.5504 0 0 0 14.851 2.6144z',
+ ],
+ },
+ GitHub: {
+ paths: [
+ 'M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12',
+ ],
+ },
+ Notion: {
+ paths: [
+ 'M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z',
+ ],
+ },
+ Slack: {
+ paths: [
+ 'M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z',
+ ],
+ },
+} satisfies Record<string, ModuleLogo>;