Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(walkthroughs): interactive walkthrough player and index

nirholasdb3d780379c5
diff --git a/pages/walkthrough.html b/pages/walkthrough.html
new file mode 100644
index 000000000..444daac8f
--- /dev/null
+++ b/pages/walkthrough.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html lang="en" class="wt-html">
+ <head>
+ <script>
+ /* three.ws theme boot, no-flash; runtime in /theme-switcher.js */ (function () {
+ try {
+ var m = localStorage.getItem('twx_theme');
+ var l =
+ m === 'auto'
+ ? window.matchMedia &&
+ window.matchMedia('(prefers-color-scheme: light)').matches
+ : m === 'light';
+ document.documentElement.setAttribute('data-theme', l ? 'light' : 'dark');
+ } catch (e) {
+ document.documentElement.setAttribute('data-theme', 'dark');
+ }
+ })();
+ </script>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Walkthrough · three.ws</title>
+ <meta
+ name="description"
+ content="An interactive walkthrough of three.ws, built from frames captured out of the live product."
+ />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/walkthrough.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
+ <meta property="og:locale" content="en_US" />
+ <meta property="og:type" content="article" />
+ <meta property="og:title" content="Walkthrough · three.ws" />
+ <meta
+ property="og:description"
+ content="An interactive walkthrough of three.ws, built from frames captured out of the live product."
+ />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta
+ name="twitter:image"
+ content="https://three.ws/api/page-og?s=learn&amp;t=Walkthrough&amp;d=An+interactive+walkthrough+of+three.ws&amp;p=%2Fwalkthroughs"
+ />
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <!-- The player owns everything below: it reads the slug from the URL and
+ renders its loading, error, not-found and ready states into #wt-root. -->
+ <main id="main-content" class="wt-page">
+ <div id="wt-root" data-state="loading"></div>
+ </main>
+
+ <script type="module" src="/src/walkthrough.js"></script>
+ <script src="/brand.js" defer></script>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ <script type="module" src="/i18n.js"></script>
+ </body>
+</html>
diff --git a/pages/walkthroughs.html b/pages/walkthroughs.html
new file mode 100644
index 000000000..04a8850fc
--- /dev/null
+++ b/pages/walkthroughs.html
@@ -0,0 +1,76 @@
+<!doctype html>
+<html lang="en" class="wt-html">
+ <head>
+ <script>
+ /* three.ws theme boot, no-flash; runtime in /theme-switcher.js */ (function () {
+ try {
+ var m = localStorage.getItem('twx_theme');
+ var l =
+ m === 'auto'
+ ? window.matchMedia &&
+ window.matchMedia('(prefers-color-scheme: light)').matches
+ : m === 'light';
+ document.documentElement.setAttribute('data-theme', l ? 'light' : 'dark');
+ } catch (e) {
+ document.documentElement.setAttribute('data-theme', 'dark');
+ }
+ })();
+ </script>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Walkthroughs · three.ws</title>
+ <meta
+ name="description"
+ content="Interactive, click-through walkthroughs of three.ws. Every frame is captured from the live product and every step is pinned to a real element on the page it explains."
+ />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/walkthrough.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <link rel="canonical" href="https://three.ws/walkthroughs" />
+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
+ <meta property="og:locale" content="en_US" />
+ <meta property="og:type" content="website" />
+ <meta property="og:title" content="Walkthroughs · three.ws" />
+ <meta
+ property="og:description"
+ content="Click-through walkthroughs of three.ws, built from frames captured out of the live product."
+ />
+ <meta property="og:url" content="https://three.ws/walkthroughs" />
+ <meta property="og:image:alt" content="Walkthroughs on three.ws" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta
+ name="twitter:image"
+ content="https://three.ws/api/page-og?s=learn&amp;t=Walkthroughs&amp;d=Click-through+walkthroughs+of+three.ws%2C+built+from+frames+captured+out+of+the+live+product&amp;p=%2Fwalkthroughs"
+ />
+ <script type="application/ld+json">
+ {"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","name":"Walkthroughs","description":"Interactive, click-through walkthroughs of three.ws, built from frames captured out of the live product.","url":"https://three.ws/walkthroughs","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://three.ws/"},{"@type":"ListItem","position":2,"name":"Learn","item":"https://three.ws/docs"},{"@type":"ListItem","position":3,"name":"Walkthroughs","item":"https://three.ws/walkthroughs"}]}]}
+ </script>
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main id="main-content" class="wt-page">
+ <div class="wt-idx-hero">
+ <p class="wt-idx-eyebrow">Walkthroughs</p>
+ <h1 class="wt-idx-title">See it before you build it</h1>
+ <p class="wt-idx-sub">
+ Short, click-through tours of the surfaces people reach for first. Step
+ through them at your own pace, or press play and watch. Each one ends on the
+ real page, one click away.
+ </p>
+ </div>
+
+ <div id="wt-index"></div>
+ </main>
+
+ <script type="module" src="/src/walkthroughs-index.js"></script>
+ <script src="/brand.js" defer></script>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ <script type="module" src="/i18n.js"></script>
+ </body>
+</html>
diff --git a/public/walkthroughs/shots/build-your-first-agent-01.jpg b/public/walkthroughs/shots/build-your-first-agent-01.jpg
new file mode 100644
index 000000000..56c506eac
Binary files /dev/null and b/public/walkthroughs/shots/build-your-first-agent-01.jpg differ
diff --git a/public/walkthroughs/shots/embed-a-3d-avatar-03.jpg b/public/walkthroughs/shots/embed-a-3d-avatar-03.jpg
new file mode 100644
index 000000000..6429ad699
Binary files /dev/null and b/public/walkthroughs/shots/embed-a-3d-avatar-03.jpg differ
diff --git a/public/walkthroughs/shots/embed-a-3d-avatar-04.jpg b/public/walkthroughs/shots/embed-a-3d-avatar-04.jpg
new file mode 100644
index 000000000..317dd174f
Binary files /dev/null and b/public/walkthroughs/shots/embed-a-3d-avatar-04.jpg differ
diff --git a/public/walkthroughs/shots/forge-your-first-3d-model-01.jpg b/public/walkthroughs/shots/forge-your-first-3d-model-01.jpg
new file mode 100644
index 000000000..19998d3b4
Binary files /dev/null and b/public/walkthroughs/shots/forge-your-first-3d-model-01.jpg differ
diff --git a/public/walkthroughs/shots/forge-your-first-3d-model-03.jpg b/public/walkthroughs/shots/forge-your-first-3d-model-03.jpg
new file mode 100644
index 000000000..81ad458ee
Binary files /dev/null and b/public/walkthroughs/shots/forge-your-first-3d-model-03.jpg differ
diff --git a/public/walkthroughs/shots/forge-your-first-3d-model-04.jpg b/public/walkthroughs/shots/forge-your-first-3d-model-04.jpg
new file mode 100644
index 000000000..ef4e09c0e
Binary files /dev/null and b/public/walkthroughs/shots/forge-your-first-3d-model-04.jpg differ
diff --git a/public/walkthroughs/shots/forge-your-first-3d-model-05.jpg b/public/walkthroughs/shots/forge-your-first-3d-model-05.jpg
new file mode 100644
index 000000000..de1fab206
Binary files /dev/null and b/public/walkthroughs/shots/forge-your-first-3d-model-05.jpg differ
diff --git a/src/walkthrough-geometry.js b/src/walkthrough-geometry.js
index 69de7a771..85c40b1a2 100644
--- a/src/walkthrough-geometry.js
+++ b/src/walkthrough-geometry.js
@@ -21,20 +21,23 @@ const clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
* gutter into view.
*
* @param {{x:number,y:number,w:number,h:number}} hotspot normalized frame coords
- * @param {{fill?:number,maxScale?:number}} [opts] fill = share of the stage the hotspot should occupy
+ * @param {{fill?:number,maxScale?:number,center?:{x:number,y:number}}} [opts]
+ * fill = share of the stage the hotspot should occupy; center = where on the
+ * stage to park it, which moves up when a bottom sheet covers the lower half.
* @returns {{scale:number,x:number,y:number}} transform, offsets in normalized stage units
*/
export function frameTransform(hotspot, opts = {}) {
const fill = opts.fill ?? 0.58;
const maxScale = opts.maxScale ?? 3.2;
+ const center = opts.center ?? { x: 0.5, y: 0.5 };
const w = Math.max(hotspot.w, 1e-4);
const h = Math.max(hotspot.h, 1e-4);
const scale = clamp(Math.min(fill / w, fill / h), 1, maxScale);
const cx = hotspot.x + hotspot.w / 2;
const cy = hotspot.y + hotspot.h / 2;
// Bounds: the image spans [offset, offset + scale]; it must cover [0, 1].
- const x = clamp(0.5 - scale * cx, 1 - scale, 0);
- const y = clamp(0.5 - scale * cy, 1 - scale, 0);
+ const x = clamp(center.x - scale * cx, 1 - scale, 0);
+ const y = clamp(center.y - scale * cy, 1 - scale, 0);
return { scale, x, y };
}
@@ -83,13 +86,20 @@ export function calloutPlacement(spot, opts = {}) {
/**
* Everything the renderer needs for one step, in one call.
+ *
+ * `sheet` is the narrow-screen mode: the callout is docked along the bottom of
+ * the stage instead of beside the hotspot, so there is no side to choose and
+ * the frame is parked higher to keep the spotlight clear of the sheet.
+ *
* @param {{x:number,y:number,w:number,h:number}} hotspot
- * @param {{fill?:number,maxScale?:number,need?:number,needBlock?:number,motion?:boolean}} [opts]
+ * @param {{fill?:number,maxScale?:number,need?:number,needBlock?:number,motion?:boolean,sheet?:boolean,center?:{x:number,y:number}}} [opts]
*/
export function stepLayout(hotspot, opts = {}) {
+ const center = opts.center ?? (opts.sheet ? { x: 0.5, y: 0.29 } : { x: 0.5, y: 0.5 });
// With motion off the frame is shown whole, so the hotspot keeps its
// captured position instead of being zoomed under the reader.
- const transform = opts.motion === false ? { scale: 1, x: 0, y: 0 } : frameTransform(hotspot, opts);
+ const transform = opts.motion === false ? { scale: 1, x: 0, y: 0 } : frameTransform(hotspot, { ...opts, center });
const spot = projectHotspot(hotspot, transform);
- return { transform, spot, callout: calloutPlacement(spot, opts) };
+ const callout = opts.sheet ? { side: 'sheet', x: 0.5, y: 1 } : calloutPlacement(spot, opts);
+ return { transform, spot, callout };
}
diff --git a/src/walkthrough.css b/src/walkthrough.css
new file mode 100644
index 000000000..32a1692b7
--- /dev/null
+++ b/src/walkthrough.css
@@ -0,0 +1,871 @@
+/* Interactive walkthroughs: the player (/walkthroughs/<slug>) and the index
+ * (/walkthroughs). Every value comes from public/tokens.css; the one local
+ * variable is --wt-accent, which the player sets per walkthrough from the
+ * manifest so each one carries its own colour without forking the palette.
+ */
+
+.wt-page {
+ --wt-accent: var(--accent, #fff);
+ --wt-stage-radius: var(--radius-lg);
+ max-width: 1180px;
+ margin: 0 auto;
+ padding: var(--space-lg) var(--space-md) var(--space-2xl);
+}
+
+/* ── Shared header ─────────────────────────────────────────────────────────── */
+
+.wt-back,
+.wt-idx-back {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-2xs);
+ font-size: var(--text-md);
+ color: var(--ink-dim);
+ text-decoration: none;
+ border-radius: var(--radius-sm);
+ transition: color var(--duration-fast) var(--ease-standard);
+}
+
+.wt-back:hover,
+.wt-idx-back:hover {
+ color: var(--ink-bright);
+}
+
+.wt-back:focus-visible,
+.wt-idx-back:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+}
+
+.wt-head {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-2xs);
+ margin-bottom: var(--space-lg);
+}
+
+.wt-title {
+ font-family: var(--font-display);
+ font-size: var(--text-3xl);
+ font-weight: var(--weight-bold);
+ line-height: var(--leading-tight);
+ color: var(--ink-bright);
+ margin: var(--space-2xs) 0 0;
+}
+
+.wt-outcome {
+ font-size: var(--text-base);
+ color: var(--ink-dim);
+ max-width: 62ch;
+ margin: 0;
+}
+
+.wt-meta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: var(--space-2xs);
+ list-style: none;
+ padding: 0;
+ margin: var(--space-2xs) 0 0;
+}
+
+.wt-chip {
+ font-size: var(--text-2xs);
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ font-weight: var(--weight-semibold);
+ color: var(--ink-dim);
+ background: var(--surface-1);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ padding: 4px 10px;
+}
+
+.wt-chip-level {
+ color: var(--wt-accent);
+ border-color: color-mix(in srgb, var(--wt-accent) 45%, transparent);
+ background: color-mix(in srgb, var(--wt-accent) 12%, transparent);
+}
+
+/* ── Stage ─────────────────────────────────────────────────────────────────── */
+
+.wt-stagewrap {
+ position: relative;
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ align-items: center;
+ gap: var(--space-xs);
+}
+
+.wt-stage {
+ position: relative;
+ aspect-ratio: 16 / 10;
+ margin: 0;
+ overflow: hidden;
+ border-radius: var(--wt-stage-radius);
+ border: 1px solid var(--stroke-strong);
+ background: var(--bg-1);
+ box-shadow: var(--shadow-3);
+ cursor: e-resize;
+ isolation: isolate;
+}
+
+.wt-frame {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ transform-origin: 0 0;
+ will-change: transform;
+ transition: transform var(--duration-slow) var(--ease-emphasized);
+}
+
+/* The spotlight is one element: an enormous spread shadow paints everything
+ * outside it, so there is no second overlay to keep in sync. */
+.wt-spot {
+ position: absolute;
+ border-radius: var(--radius-md);
+ box-shadow:
+ 0 0 0 100vmax rgb(4 4 8 / 0.68),
+ inset 0 0 0 2px var(--wt-accent),
+ 0 0 24px color-mix(in srgb, var(--wt-accent) 55%, transparent);
+ transition:
+ left var(--duration-slow) var(--ease-emphasized),
+ top var(--duration-slow) var(--ease-emphasized),
+ width var(--duration-slow) var(--ease-emphasized),
+ height var(--duration-slow) var(--ease-emphasized);
+ pointer-events: none;
+ z-index: 1;
+}
+
+.wt-callout {
+ position: absolute;
+ z-index: 2;
+ width: clamp(232px, 28%, 344px);
+ padding: var(--space-sm);
+ background: var(--bg-1);
+ border: 1px solid var(--stroke-strong);
+ border-left: 3px solid var(--wt-accent);
+ border-radius: var(--radius-md);
+ box-shadow: var(--shadow-3);
+ cursor: auto;
+ transition:
+ left var(--duration-slow) var(--ease-emphasized),
+ top var(--duration-slow) var(--ease-emphasized);
+}
+
+.wt-callout[data-side='right'] {
+ transform: translate(18px, -50%);
+}
+.wt-callout[data-side='left'] {
+ transform: translate(calc(-100% - 18px), -50%);
+}
+.wt-callout[data-side='bottom'] {
+ transform: translate(-50%, 18px);
+}
+.wt-callout[data-side='top'] {
+ transform: translate(-50%, calc(-100% - 18px));
+}
+.wt-callout[data-side='over'] {
+ transform: translate(-50%, -50%);
+ width: clamp(260px, 46%, 460px);
+}
+
+/* Narrow screens: a callout floating beside a hotspot would be a few words
+ * wide, so it docks along the bottom of the stage instead and the spotlight
+ * alone does the pointing. The player parks the frame higher to match. */
+.wt-callout[data-side='sheet'] {
+ left: 0;
+ top: auto;
+ bottom: 0;
+ width: 100%;
+ max-height: 52%;
+ overflow-y: auto;
+ transform: none;
+ border-radius: 0;
+ border: none;
+ border-top: 3px solid var(--wt-accent);
+ background: color-mix(in srgb, var(--bg-1) 92%, transparent);
+ backdrop-filter: blur(var(--blur-md));
+ box-shadow: none;
+}
+
+.wt-callout-count {
+ margin: 0 0 var(--space-3xs);
+ font-size: var(--text-2xs);
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ font-weight: var(--weight-semibold);
+ color: var(--wt-accent);
+}
+
+.wt-callout-title {
+ margin: 0 0 var(--space-2xs);
+ font-family: var(--font-display);
+ font-size: var(--text-lg);
+ font-weight: var(--weight-semibold);
+ line-height: var(--leading-tight);
+ color: var(--ink-bright);
+}
+
+.wt-callout-body {
+ margin: 0;
+ font-size: var(--text-ui);
+ line-height: var(--leading-normal);
+ color: var(--ink);
+}
+
+.wt-callout-tip {
+ margin: var(--space-2xs) 0 0;
+ padding-left: var(--space-xs);
+ border-left: 2px solid var(--stroke);
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+}
+
+.wt-callout-tip[hidden] {
+ display: none;
+}
+
+.wt-callout-action {
+ display: inline-flex;
+ margin-top: var(--space-xs);
+ font-size: var(--text-md);
+ font-weight: var(--weight-semibold);
+ color: var(--wt-accent);
+ text-decoration: none;
+ border-bottom: 1px solid color-mix(in srgb, var(--wt-accent) 40%, transparent);
+ transition: border-color var(--duration-fast) var(--ease-standard);
+}
+
+.wt-callout-action:hover {
+ border-bottom-color: var(--wt-accent);
+}
+
+.wt-callout-action:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+ border-radius: var(--radius-sm);
+}
+
+.wt-caption {
+ position: absolute;
+ left: var(--space-xs);
+ bottom: var(--space-xs);
+ z-index: 2;
+ font-family: var(--font-mono);
+ font-size: var(--text-2xs);
+ color: var(--ink-faint);
+ background: rgb(4 4 8 / 0.6);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ padding: 3px 9px;
+ pointer-events: none;
+}
+
+/* ── Arrows ────────────────────────────────────────────────────────────────── */
+
+.wt-arrow {
+ display: grid;
+ place-items: center;
+ width: 44px;
+ height: 44px;
+ font-size: var(--text-2xl);
+ line-height: 1;
+ color: var(--ink);
+ background: var(--surface-1);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ cursor: pointer;
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard),
+ transform var(--duration-fast) var(--ease-standard);
+}
+
+.wt-arrow:hover:not(:disabled) {
+ background: var(--surface-2);
+ color: var(--ink-bright);
+ transform: scale(1.06);
+}
+
+.wt-arrow:active:not(:disabled) {
+ transform: scale(0.96);
+}
+
+.wt-arrow:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+}
+
+.wt-arrow:disabled {
+ opacity: 0.32;
+ cursor: not-allowed;
+}
+
+/* ── Control bar ───────────────────────────────────────────────────────────── */
+
+.wt-bar {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ align-items: center;
+ gap: var(--space-sm);
+ margin-top: var(--space-md);
+}
+
+.wt-play {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-2xs);
+ padding: 8px 14px;
+ font-size: var(--text-md);
+ font-weight: var(--weight-semibold);
+ color: var(--ink-bright);
+ background: var(--surface-1);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ cursor: pointer;
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard);
+}
+
+.wt-play:hover {
+ background: var(--surface-2);
+ border-color: var(--stroke-strong);
+}
+
+.wt-play:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+}
+
+.wt-play-icon {
+ width: 0;
+ height: 0;
+ border-style: solid;
+ border-width: 6px 0 6px 10px;
+ border-color: transparent transparent transparent var(--wt-accent);
+}
+
+.wt-play.is-playing .wt-play-icon {
+ width: 10px;
+ height: 12px;
+ border: none;
+ background: linear-gradient(to right, var(--wt-accent) 0 3px, transparent 3px 7px, var(--wt-accent) 7px 10px);
+}
+
+.wt-rail {
+ display: flex;
+ gap: var(--space-3xs);
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ overflow-x: auto;
+ scrollbar-width: thin;
+}
+
+.wt-rail-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-2xs);
+ max-width: 210px;
+ padding: 6px 12px 6px 6px;
+ font-size: var(--text-md);
+ color: var(--ink-dim);
+ background: transparent;
+ border: 1px solid transparent;
+ border-radius: var(--radius-pill);
+ cursor: pointer;
+ white-space: nowrap;
+ transition:
+ background var(--duration-fast) var(--ease-standard),
+ color var(--duration-fast) var(--ease-standard);
+}
+
+.wt-rail-btn:hover {
+ background: var(--surface-1);
+ color: var(--ink-bright);
+}
+
+.wt-rail-btn:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 2px;
+}
+
+.wt-rail-btn[aria-current='step'] {
+ color: var(--ink-bright);
+ background: var(--surface-2);
+ border-color: color-mix(in srgb, var(--wt-accent) 40%, transparent);
+}
+
+.wt-rail-n {
+ display: grid;
+ place-items: center;
+ width: 22px;
+ height: 22px;
+ flex: 0 0 22px;
+ font-size: var(--text-2xs);
+ font-weight: var(--weight-bold);
+ border-radius: var(--radius-pill);
+ background: var(--surface-2);
+ color: var(--ink-dim);
+}
+
+.wt-rail-btn[aria-current='step'] .wt-rail-n {
+ background: var(--wt-accent);
+ color: var(--bg-0);
+}
+
+.wt-rail-t {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.wt-visit {
+ font-size: var(--text-md);
+ font-weight: var(--weight-semibold);
+ color: var(--ink-dim);
+ text-decoration: none;
+ white-space: nowrap;
+ border-radius: var(--radius-sm);
+ transition: color var(--duration-fast) var(--ease-standard);
+}
+
+.wt-visit:hover {
+ color: var(--ink-bright);
+}
+
+.wt-visit:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+}
+
+.wt-progress {
+ height: 3px;
+ margin-top: var(--space-sm);
+ background: var(--surface-1);
+ border-radius: var(--radius-pill);
+ overflow: hidden;
+}
+
+.wt-progress span {
+ display: block;
+ height: 100%;
+ width: 0;
+ background: var(--wt-accent);
+ transition: width var(--duration-base) var(--ease-out);
+}
+
+/* ── Footer ────────────────────────────────────────────────────────────────── */
+
+.wt-foot {
+ display: flex;
+ flex-wrap: wrap;
+ gap: var(--space-lg);
+ justify-content: space-between;
+ margin-top: var(--space-xl);
+ padding-top: var(--space-lg);
+ border-top: 1px solid var(--stroke);
+}
+
+.wt-foot-label {
+ margin: 0 0 var(--space-2xs);
+ font-size: var(--text-2xs);
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--ink-faint);
+}
+
+.wt-foot-cta {
+ display: inline-flex;
+ align-items: center;
+ padding: 10px 18px;
+ font-size: var(--text-ui);
+ font-weight: var(--weight-semibold);
+ color: var(--bg-0);
+ background: var(--wt-accent);
+ border-radius: var(--radius-pill);
+ text-decoration: none;
+ transition: filter var(--duration-fast) var(--ease-standard);
+}
+
+.wt-foot-cta:hover {
+ filter: brightness(1.12);
+}
+
+.wt-foot-cta:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+}
+
+.wt-foot-related ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-3xs);
+}
+
+.wt-foot-related a {
+ font-size: var(--text-ui);
+ color: var(--ink-dim);
+ text-decoration: none;
+ border-radius: var(--radius-sm);
+}
+
+.wt-foot-related a:hover {
+ color: var(--ink-bright);
+}
+
+.wt-foot-related a:focus-visible {
+ outline: 2px solid var(--wt-accent);
+ outline-offset: 3px;
+}
+
+/* ── Loading, error, screen-reader ─────────────────────────────────────────── */
+
+.wt-sr {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+
+.wt-skeleton {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-sm);
+}
+
+.wt-sk-line,
+.wt-sk-stage,
+.wt-sk-bar {
+ background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 37%, var(--surface-1) 63%);
+ background-size: 400% 100%;
+ animation: wt-shimmer 1.4s ease infinite;
+ border-radius: var(--radius-md);
+}
+
+.wt-sk-line-lg {
+ height: 38px;
+ width: min(420px, 70%);
+}
+.wt-sk-line-sm {
+ height: 18px;
+ width: min(560px, 90%);
+}
+.wt-sk-stage {
+ aspect-ratio: 16 / 10;
+ border-radius: var(--radius-lg);
+}
+.wt-sk-bar {
+ height: 40px;
+}
+
+@keyframes wt-shimmer {
+ 0% {
+ background-position: 100% 0;
+ }
+ 100% {
+ background-position: 0 0;
+ }
+}
+
+.wt-msg {
+ max-width: 52ch;
+ margin: var(--space-2xl) auto;
+ text-align: center;
+}
+
+.wt-msg h1 {
+ font-family: var(--font-display);
+ font-size: var(--text-2xl);
+ color: var(--ink-bright);
+ margin: 0 0 var(--space-2xs);
+}
+
+.wt-msg p {
+ color: var(--ink-dim);
+ margin: 0 0 var(--space-md);
+}
+
+.wt-msg-actions {
+ display: flex;
+ gap: var(--space-2xs);
+ justify-content: center;
+ flex-wrap: wrap;
+}
+
+.wt-msg-btn {
+ display: inline-flex;
+ align-items: center;
+ padding: 9px 16px;
+ font-size: var(--text-ui);
+ font-weight: var(--weight-semibold);
+ color: var(--ink-bright);
+ background: var(--surface-2);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ text-decoration: none;
+ cursor: pointer;
+}
+
+.wt-msg-btn:hover {
+ border-color: var(--stroke-strong);
+}
+
+.wt-msg-btn:focus-visible {
+ outline: 2px solid var(--accent);
+ outline-offset: 3px;
+}
+
+/* ── Reduced motion: the frame stops moving under the reader ───────────────── */
+
+.wt-static .wt-frame,
+.wt-static .wt-spot,
+.wt-static .wt-callout {
+ transition: none;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .wt-sk-line,
+ .wt-sk-stage,
+ .wt-sk-bar {
+ animation: none;
+ }
+}
+
+/* ── Index page ────────────────────────────────────────────────────────────── */
+
+.wt-idx-hero {
+ max-width: 68ch;
+ margin-bottom: var(--space-xl);
+}
+
+.wt-idx-eyebrow {
+ font-size: var(--text-2xs);
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--ink-faint);
+ margin: 0 0 var(--space-2xs);
+}
+
+.wt-idx-title {
+ font-family: var(--font-display);
+ font-size: var(--text-3xl);
+ font-weight: var(--weight-bold);
+ line-height: var(--leading-tight);
+ color: var(--ink-bright);
+ margin: 0 0 var(--space-xs);
+}
+
+.wt-idx-sub {
+ font-size: var(--text-base);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+ margin: 0;
+}
+
+.wt-idx-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
+ gap: var(--space-md);
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.wt-card {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ background: var(--surface-1);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-lg);
+ overflow: hidden;
+ transition:
+ transform var(--duration-base) var(--ease-standard),
+ border-color var(--duration-base) var(--ease-standard),
+ box-shadow var(--duration-base) var(--ease-standard);
+}
+
+.wt-card:hover {
+ transform: translateY(-3px);
+ border-color: var(--stroke-strong);
+ box-shadow: var(--shadow-3);
+}
+
+.wt-card:focus-within {
+ border-color: var(--wt-card-accent, var(--accent));
+}
+
+.wt-card-shot {
+ position: relative;
+ aspect-ratio: 16 / 10;
+ overflow: hidden;
+ background: var(--bg-1);
+ border-bottom: 1px solid var(--stroke);
+}
+
+.wt-card-shot img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ transition: transform var(--duration-slow) var(--ease-out);
+}
+
+.wt-card:hover .wt-card-shot img {
+ transform: scale(1.03);
+}
+
+.wt-card-steps {
+ position: absolute;
+ right: var(--space-2xs);
+ bottom: var(--space-2xs);
+ font-size: var(--text-2xs);
+ font-weight: var(--weight-semibold);
+ color: var(--ink-bright);
+ background: rgb(4 4 8 / 0.72);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ padding: 3px 9px;
+}
+
+.wt-card-body {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-2xs);
+ padding: var(--space-sm);
+ flex: 1;
+}
+
+.wt-card-title {
+ margin: 0;
+ font-family: var(--font-display);
+ font-size: var(--text-lg);
+ font-weight: var(--weight-semibold);
+ line-height: var(--leading-tight);
+}
+
+.wt-card-title a {
+ color: var(--ink-bright);
+ text-decoration: none;
+}
+
+/* The whole card is the hit target; the heading link owns the accessible name. */
+.wt-card-title a::after {
+ content: '';
+ position: absolute;
+ inset: 0;
+}
+
+.wt-card-title a:focus-visible {
+ outline: none;
+}
+
+.wt-card:has(a:focus-visible) {
+ outline: 2px solid var(--wt-card-accent, var(--accent));
+ outline-offset: 3px;
+}
+
+.wt-card-outcome {
+ margin: 0;
+ font-size: var(--text-ui);
+ color: var(--ink);
+ line-height: var(--leading-normal);
+}
+
+.wt-card-blurb {
+ margin: 0;
+ font-size: var(--text-md);
+ color: var(--ink-dim);
+ line-height: var(--leading-normal);
+}
+
+.wt-card-meta {
+ display: flex;
+ gap: var(--space-2xs);
+ margin-top: auto;
+ padding-top: var(--space-2xs);
+ list-style: none;
+ padding-left: 0;
+}
+
+.wt-idx-note {
+ margin: var(--space-xl) 0 0;
+ padding: var(--space-sm);
+ font-size: var(--text-md);
+ line-height: var(--leading-normal);
+ color: var(--ink-dim);
+ background: var(--surface-1);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+}
+
+.wt-idx-note strong {
+ color: var(--ink-bright);
+ font-weight: var(--weight-semibold);
+}
+
+.wt-idx-note a {
+ color: var(--ink-bright);
+}
+
+/* ── Narrow screens ────────────────────────────────────────────────────────── */
+
+@media (max-width: 860px) {
+ .wt-page {
+ padding: var(--space-md) var(--space-sm) var(--space-xl);
+ }
+
+ .wt-title {
+ font-size: var(--text-2xl);
+ }
+
+ /* Arrows move under the stage so the frame keeps the full width. */
+ .wt-stagewrap {
+ grid-template-columns: 1fr;
+ }
+
+ .wt-arrow {
+ position: absolute;
+ bottom: calc(-1 * var(--space-2xl));
+ z-index: 3;
+ }
+
+ .wt-arrow-prev {
+ left: 0;
+ }
+ .wt-arrow-next {
+ right: 0;
+ }
+
+ .wt-bar {
+ grid-template-columns: 1fr;
+ justify-items: stretch;
+ gap: var(--space-2xs);
+ margin-top: calc(var(--space-2xl) + var(--space-xs));
+ }
+
+ .wt-play,
+ .wt-visit {
+ justify-self: start;
+ }
+
+ .wt-stage {
+ cursor: auto;
+ }
+
+ .wt-caption {
+ display: none;
+ }
+}
diff --git a/src/walkthrough.js b/src/walkthrough.js
index cfde2a7ae..7a2f24008 100644
--- a/src/walkthrough.js
+++ b/src/walkthrough.js
@@ -23,6 +23,7 @@ const state = {
playing: false,
timer: null,
motion: true,
+ sheet: false,
};
const el = {};
@@ -91,7 +92,7 @@ function shellHtml(w) {
<span class="wt-play-label">Play</span>
</button>
<ol class="wt-rail" id="wt-rail"></ol>
- <a class="wt-visit" id="wt-visit" href="${esc(w.cta.href)}">${esc(w.cta.label)} <span aria-hidden="true">↗</span></a>
+ <a class="wt-visit" id="wt-visit" href="${esc(w.cta.href)}"><span id="wt-visit-label">${esc(w.cta.label)}</span> <span aria-hidden="true">↗</span></a>
</div>
<div class="wt-progress" id="wt-progress" aria-hidden="true"><span id="wt-progress-fill"></span></div>
@@ -131,6 +132,7 @@ function cacheNodes(root) {
'wt-prev',
'wt-next',
'wt-visit',
+ 'wt-visit-label',
'wt-live',
'wt-progress-fill',
];
@@ -150,7 +152,7 @@ function applyStep(i, opts = {}) {
const w = state.walkthrough;
state.index = Math.max(0, Math.min(w.steps.length - 1, i));
const step = w.steps[state.index];
- const layout = stepLayout(step.hotspot, { motion: state.motion });
+ const layout = stepLayout(step.hotspot, { motion: state.motion, sheet: state.sheet });
el['wt-frame'].src = step.shot;
el['wt-frame'].alt = `${step.pageTitle || w.title}: ${step.title}`;
@@ -165,8 +167,15 @@ function applyStep(i, opts = {}) {
const c = el['wt-callout'];
c.dataset.side = layout.callout.side;
- c.style.left = `${(layout.callout.x * 100).toFixed(4)}%`;
- c.style.top = `${(layout.callout.y * 100).toFixed(4)}%`;
+ if (layout.callout.side === 'sheet') {
+ // The sheet is placed entirely in CSS; inline coordinates would win
+ // against it and drag the card off the bottom of the stage.
+ c.style.removeProperty('left');
+ c.style.removeProperty('top');
+ } else {
+ c.style.left = `${(layout.callout.x * 100).toFixed(4)}%`;
+ c.style.top = `${(layout.callout.y * 100).toFixed(4)}%`;
+ }
el['wt-count'].textContent = `Step ${state.index + 1} of ${w.steps.length}`;
el['wt-steptitle'].textContent = step.title;
@@ -180,7 +189,7 @@ function applyStep(i, opts = {}) {
el['wt-caption'].textContent = `Captured from ${step.path}`;
el['wt-visit'].href = step.path;
- el['wt-visit'].firstChild.textContent = `Open ${step.path} `;
+ el['wt-visit-label'].textContent = `Open ${step.path}`;
el['wt-prev'].disabled = state.index === 0;
el['wt-next'].disabled = state.index === w.steps.length - 1;
@@ -301,15 +310,17 @@ function bind(root) {
});
}
- const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
- const syncMotion = () => {
- state.motion = !mq.matches;
+ const motionMq = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const sheetMq = window.matchMedia('(max-width: 860px)');
+ const sync = (rerender) => {
+ state.motion = !motionMq.matches;
+ state.sheet = sheetMq.matches;
root.classList.toggle('wt-static', !state.motion);
- if (state.walkthrough) applyStep(state.index, { silent: true });
+ if (rerender && state.walkthrough) applyStep(state.index, { silent: true });
};
- mq.addEventListener('change', syncMotion);
- state.motion = !mq.matches;
- root.classList.toggle('wt-static', !state.motion);
+ motionMq.addEventListener('change', () => sync(true));
+ sheetMq.addEventListener('change', () => sync(true));
+ sync(false);
}
function renderError(root, heading, detail, retry) {
diff --git a/src/walkthroughs-index.js b/src/walkthroughs-index.js
new file mode 100644
index 000000000..6c0019ffc
--- /dev/null
+++ b/src/walkthroughs-index.js
@@ -0,0 +1,85 @@
+// /walkthroughs: the index of interactive walkthroughs.
+//
+// Reads the same generated manifest the player reads, so a walkthrough that
+// captured cleanly appears here and one that did not cannot. Cards carry the
+// real first frame of each walkthrough as their cover, which means the index
+// is also the fastest visual check that the media is current.
+
+const MANIFEST_URL = '/walkthroughs/manifest.json';
+
+function esc(s) {
+ return String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
+}
+
+function cardHtml(w) {
+ const cover = w.cover || (w.steps[0] && w.steps[0].shot);
+ return `
+ <li class="wt-card" style="--wt-card-accent:${esc(w.accent)}">
+ <div class="wt-card-shot">
+ ${cover ? `<img src="${esc(cover)}" alt="" loading="lazy" decoding="async" width="1440" height="900" />` : ''}
+ <span class="wt-card-steps">${w.steps.length} steps</span>
+ </div>
+ <div class="wt-card-body">
+ <h2 class="wt-card-title"><a href="/walkthroughs/${esc(w.slug)}">${esc(w.title)}</a></h2>
+ <p class="wt-card-outcome">${esc(w.outcome)}</p>
+ <p class="wt-card-blurb">${esc(w.blurb)}</p>
+ <ul class="wt-card-meta">
+ <li class="wt-chip wt-chip-level" style="--wt-accent:${esc(w.accent)}">${esc(w.level)}</li>
+ <li class="wt-chip">${w.minutes} min</li>
+ </ul>
+ </div>
+ </li>`;
+}
+
+function renderMessage(root, heading, detail, retry) {
+ root.innerHTML = `
+ <div class="wt-msg">
+ <h1>${esc(heading)}</h1>
+ <p>${esc(detail)}</p>
+ <div class="wt-msg-actions">
+ <a class="wt-msg-btn" href="/tutorials">Read the tutorials</a>
+ ${retry ? '<button type="button" class="wt-msg-btn wt-msg-btn-ghost" id="wt-idx-retry">Try again</button>' : ''}
+ </div>
+ </div>`;
+ const btn = root.querySelector('#wt-idx-retry');
+ if (btn) btn.addEventListener('click', boot);
+}
+
+async function boot() {
+ const root = document.getElementById('wt-index');
+ if (!root) return;
+
+ root.innerHTML = `
+ <ul class="wt-idx-grid" aria-hidden="true">
+ ${'<li class="wt-card"><div class="wt-card-shot wt-sk-stage"></div><div class="wt-card-body"><div class="wt-sk-line wt-sk-line-lg"></div><div class="wt-sk-line wt-sk-line-sm"></div></div></li>'.repeat(4)}
+ </ul>
+ <p class="wt-sr" role="status" aria-live="polite">Loading walkthroughs</p>`;
+
+ let manifest;
+ try {
+ const res = await fetch(MANIFEST_URL, { cache: 'no-cache' });
+ if (!res.ok) throw new Error(`manifest ${res.status}`);
+ manifest = await res.json();
+ } catch (err) {
+ renderMessage(root, 'Could not load the walkthroughs', `The walkthrough index did not load (${err.message}). The written tutorials cover the same ground.`, true);
+ return;
+ }
+
+ const list = manifest.walkthroughs || [];
+ if (!list.length) {
+ renderMessage(root, 'No walkthroughs published yet', 'Nothing has been captured into the walkthrough library. The written tutorials cover the same ground in the meantime.', false);
+ return;
+ }
+
+ const captured = manifest.generatedAt ? new Date(manifest.generatedAt) : null;
+ root.innerHTML = `
+ <ul class="wt-idx-grid">${list.map(cardHtml).join('')}</ul>
+ <p class="wt-idx-note">
+ <strong>These frames are the real product.</strong>
+ Every picture here was captured by a browser driving <a href="https://three.ws">three.ws</a> itself, and each step is pinned to a live element rather than a hand-drawn box, so a walkthrough breaks loudly when the interface moves instead of quietly going out of date.
+ ${captured ? `Last captured ${esc(captured.toISOString().slice(0, 10))}.` : ''}
+ </p>`;
+}
+
+if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
+else boot();