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.

docs+nav: expand README with feature sections, add home-v2 prototype, more nav QA scripts

nirholas37010ed50226
diff --git a/README.md b/README.md
index 0824b5630..498ba5159 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,14 @@ https://github.com/user-attachments/assets/d52515d1-cb04-4dd6-98bd-fef233312dc4
- [Memory](#memory)
- [Web Component & Embedding](#web-component--embedding)
- [Widget System](#widget-system)
+- [Embed Editor](#embed-editor)
+- [Launchpad](#launchpad)
+- [The Club](#the-club)
+- [Walk & Multiplayer](#walk--multiplayer)
+- [x402 Payments](#x402-payments)
+- [A2A — Agent-to-Agent Protocol](#a2a--agent-to-agent-protocol)
+- [Talk Mode & Lip-Sync](#talk-mode--lip-sync)
+- [Solana Mobile (Seeker)](#solana-mobile-seeker)
- [API Reference](#api-reference)
- [Authentication & OAuth 2.1](#authentication--oauth-21)
- [MCP Server](#mcp-server)
@@ -960,6 +968,334 @@ Widgets are stored as JSON config in Postgres, pointing at an avatar in R2.
---
+## Embed Editor
+
+The **Embed Editor** at `/embed-editor` is a WYSIWYG configurator for the `<agent-3d>` element. Pick an avatar from a modal grid with lazy-loaded 3D thumbnails, choose an animation from the dock, frame the camera with face-camera mode, set a background (transparent, glow, solid), and copy a ready-to-paste snippet.
+
+| Feature | Description |
+|---|---|
+| **Avatar picker** | Modal with lazy 3D thumbnails — no full page rerender on selection |
+| **Animation dock** | All clips visible at once; click to preview live on the model |
+| **Kiosk default** | Chrome-free preview surface — what you see is what gets embedded |
+| **Face-camera** | One-click camera framing aligned to the avatar's face |
+| **Lock toggle** | Freezes the wrap and avatar motion so you can author screenshots / video |
+| **Device frame** | Preview the embed inside phone / tablet / desktop chrome |
+| **Backdrop glow** | Optional radial glow behind the avatar (opt-in, off by default) |
+| **Snippet UX** | One-click copy of `<agent-3d>` HTML or the iframe URL — versioned CDN reference |
+
+The editor produces video-ready output for marketing assets and a copy-paste snippet for production use. Built as a single Vite-compiled bundle, no separate framework runtime.
+
+---
+
+## Pose Studio
+
+`/pose-studio` is a 3D pose-reference tool inspired by setpose.com. It builds a Three.js scene with an articulated mannequin, orbit camera, ground + grid, and a control panel that lets you pick presets, drag joints to pose them, fine-tune with sliders, swap body type, add floor props, change lighting and FOV, and export a PNG screenshot.
+
+| Module | Path | Role |
+|---|---|---|
+| Mannequin | [src/pose-mannequin.js](src/pose-mannequin.js) | Articulated rig with named joints + IK |
+| Preset library | [src/pose-presets.js](src/pose-presets.js) | Standing, sitting, action, idle, expressive |
+| Studio shell | [src/pose-studio.js](src/pose-studio.js) | Scene, controls, export, props, lighting |
+
+Poses author cleanly into the avatar runtime via the `play_clip` tool — the agent can adopt any saved pose on demand. Exported PNGs are useful as marketing renders or as reference frames for downstream image/video pipelines.
+
+---
+
+## Launchpad
+
+The **Launchpad** at `/launchpad` is a hosted-page builder for token launches, agent debuts, and drop campaigns. Each published page lives at a public URL like `/p/<slug>` with full Open Graph metadata for sharing.
+
+| Surface | Path | Purpose |
+|---|---|---|
+| Studio | `/launchpad` | Authoring UI — pick a template, configure copy, avatar, mint targets |
+| Public page | `/p/[slug]` | Hosted landing page rendered server-side with OG card |
+| Publish API | `POST /api/launchpad/...` | Versioned publish + revert for the page bundle |
+
+Launchpad templates are JSON-configured and can embed any combination of `<agent-3d>` widget, x402 paid endpoint, or pump.fun launch button. Pages are stored in Postgres and served as static HTML with hydration for interactive elements.
+
+---
+
+## The Club
+
+`/club` is a multiplayer 3D venue — a pole-club scene with rigged dancers, audio tracks, spotlights, mirror-ball cube cam, and on-chain tips.
+
+**Stack:**
+- Venue GLB + HDRI lit by four spotlights; bloom + chromatic aberration on the high tier
+- Audio tracks streamed from R2 with synchronized playback across clients
+- Camera state machine — DJ booth, overhead, dance-floor, follow-cam — sequenced per track
+- Performance profile detector picks `high` / `medium` / `low` from `navigator.deviceMemory`, `hardwareConcurrency`, `pointer: coarse`, and the UA string
+- Frame-budget watchdog auto-downgrades the profile if sustained slow frames are detected
+
+**Economics:**
+- Tips API at `/api/club/tips` — viewers tip dancers in USDC via x402 (CDP-settled, Permit2-gasless sibling available)
+- Leaderboard at `/api/club/leaderboard` with windowed top-tipper rankings
+- Hourly payouts cron sweeps the tips ledger into the dancers' treasury wallets
+
+**Detail:** see [docs/club/PERF_NOTES.md](docs/club/PERF_NOTES.md), [docs/club/PLAN.md](docs/club/PLAN.md), and [docs/club/RELEASE_CHECKLIST.md](docs/club/RELEASE_CHECKLIST.md).
+
+---
+
+## Walk & Multiplayer
+
+`/walk` is an authoritative multiplayer walk scene. Players join a shared 3D space, see each other's avatars in real time, and emit gestures over a WebSocket connection.
+
+Vercel doesn't host long-lived WebSockets, so the multiplayer server lives in its own workspace at [`multiplayer/`](multiplayer/) — a [Colyseus](https://colyseus.io) server packaged with a Fly.io `fly.toml` and Dockerfile. The Vite client at `/walk` autodiscovers the server (`ws://localhost:2567` in dev, your deployed host in prod).
+
+```bash
+# Run both servers together
+npm run dev:walk-all # Vite (:3000) + Colyseus (:2567)
+```
+
+**WalkRoom** (`multiplayer/src/rooms/WalkRoom.js`) is the authoritative state container — position, rotation, gesture, presence. Origin allow-listing is enforced at the WS upgrade (`ALLOWED_ORIGINS` env, with `*.vercel.app` and `*.three.ws` always permitted for preview deploys). The same Colyseus server can host additional rooms (DJ-set sync, group dance, drop-events) without redeploying the static site.
+
+---
+
+## x402 Payments
+
+three.ws is a first-class [x402](https://x402.org) host. Agents can both **pay for** and **expose** paid endpoints. Settlement runs on Base, BSC, and Solana; the bazaar at `/x402` is the discovery surface.
+
+### Payment rails
+
+| Chain | Settlement | Permit2 sibling | Status |
+|---|---|---|---|
+| **Base mainnet** | Coinbase CDP facilitator | Gasless via relayer | Live |
+| **Base sepolia** | CDP facilitator | Yes | Live |
+| **BSC** | Direct-scheme (no facilitator) | — | Live |
+| **Solana (devnet)** | x402-solana direct | — | Live |
+
+Every CDP-settled endpoint ships a Permit2 sibling that accepts an EIP-2612 permit instead of an upfront approval — the buyer signs once, and the relayer pays gas. Wire-level checks live in `tests/e2e/` and exercise the buyer/seller flow end-to-end.
+
+### Paid endpoints
+
+| Route | What you get |
+|---|---|
+| `POST /api/x402/mint-to-mesh` | Mint an avatar's mesh as an NFT |
+| `POST /api/x402/mint-to-mesh-batch` | Batch mint up to N meshes |
+| `POST /api/x402/dance-tip` | Tip a club dancer in USDC |
+| `POST /api/x402/model-check` | Run Khronos glTF validation as a paid service |
+| `POST /api/x402/pump-agent-audit` | Audit a pump.fun token's creator history |
+| `POST /api/x402/agent-reputation` | Compute on-chain reputation snapshot |
+| `POST /api/x402/onchain-identity-verify` | Verify ERC-8004 identity for a wallet |
+| `POST /api/x402/symbol-availability` | Check token symbol availability across chains |
+| `POST /api/x402/skill-marketplace` | Paid skill marketplace listing |
+| `POST /api/x402/asset-download` | Pay-per-download for gated R2 assets |
+| `POST /api/x402/did` | DID resolution as a service |
+| `GET /api/x402/my-receipts` | Buyer-side receipts ledger |
+
+### Bazaar, SKUs, and subscriptions
+
+| Surface | Path | Purpose |
+|---|---|---|
+| Bazaar | `/x402` | Browsable marketplace of paid endpoints |
+| Discovery | `/x402-discover` | Search by tag, price, chain |
+| Checkout | `/x402-pay`, `/api/x402-checkout` | Stripe-style one-shot purchase |
+| SKU catalog | `/api/x402-skus` | Server-defined SKUs with per-row pricing |
+| Dashboard | `/dashboard/x402` | Seller + buyer dashboard, receipts, payouts |
+| Subscriptions | `/api/x402/subscriptions` | Recurring x402 charges on cron |
+| Status | `/api/x402-status` | Health and chain reachability checks |
+
+### How to expose a paid endpoint
+
+```js
+import { paidEndpoint } from './_lib/x402-paid-endpoint.js';
+
+export default paidEndpoint({
+ price: '0.10', // USDC
+ chain: 'base', // base | bsc | solana
+ network: 'mainnet',
+ resource: 'https://three.ws/api/your-endpoint',
+ description: 'What the buyer is paying for',
+ handler: async (req, res, { payer }) => {
+ // payer is verified — settle the request
+ res.json({ ok: true, payer });
+ },
+});
+```
+
+The helper handles the 402 challenge, Permit2 sibling, receipt write-back, idempotency-token enforcement, and CSRF/SSRF guards. See [api/_lib/x402-paid-endpoint.js](api/_lib/x402-paid-endpoint.js).
+
+### Wire checks
+
+- Wire-level CORS, CDP, and Permit2 sibling checks: `tests/e2e/`
+- Offer receipts schema + buyer fetch: [api/_lib/x402-buyer-fetch.js](api/_lib/x402-buyer-fetch.js)
+- Error envelope: full 402 body returned in the `PAYMENT-REQUIRED` header
+
+---
+
+## A2A — Agent-to-Agent Protocol
+
+Agents transact with each other directly through an A2A bridge that sits on top of the MCP server and x402 payments.
+
+| Surface | Path | Purpose |
+|---|---|---|
+| A2A client | `sdk/a2a/` | Outbound calls — pay another agent, settle the response |
+| A2A server | `api/a2a/` | Inbound paid tools, exposed via MCP bridge |
+| MCP bridge | `api/mcp.js` | Wraps paid tools as MCP `tools/call` with auto-402 retry |
+| Spending ledger | `api/a2a/spending` | Per-agent spend caps and authorization gates |
+| Receipts store | `api/a2a/receipts` | Signed receipts written on every paid call |
+| DID resolution | `POST /api/x402/did` | Resolve a counterparty DID to wallet + endpoints |
+
+**SIWX (Sign-In with X-chain)** brokers cross-chain identity for paid sessions: an agent on Base proves ownership of a Solana wallet (or vice versa) to unlock chain-specific paid endpoints.
+
+---
+
+## Talk Mode & Lip-Sync
+
+The `talk` interaction mode wires together the LLM runtime, ElevenLabs TTS, and an **audio-driven ARKit-52 lip-sync driver** that maps live audio amplitude + formant analysis onto the 52 standard ARKit blendshapes.
+
+When the agent speaks, the driver runs at ~60fps and drives `mouthClose`, `jawOpen`, `mouthSmileLeft/Right`, and the rest of the ARKit-52 set — the Empathy Layer's emotional morphs continue to blend on top, so the avatar simultaneously emotes and articulates. Unit tests for the ARKit-52 mapping live in `tests/src/arkit-morphs.test.js`.
+
+---
+
+## Solana Mobile (Seeker)
+
+three.ws ships with Mobile Wallet Adapter (MWA) wired into the web app and a release pipeline for the Solana Mobile dApp Store.
+
+- MWA detection prefers seed-vault-backed signing on Seeker / Saga devices, falls back to WalletConnect elsewhere
+- dApp Store listing assets, icons, and staging copy live under `public/seeker/`
+- Release pipeline scripts handle build → sign → submit for the dApp Store update
+- On Seeker hardware, users sign x402 payments and ERC-8004 registrations from the seed vault — no browser extension required
+
+---
+
+## Selfie Reconstruction Pipeline (Phase 1)
+
+Anyone takes 3 selfies (left, center, right) and receives a rigged, animatable 3D avatar in under a minute. The pipeline ships native — no third-party black box.
+
+| Module | Path | Role |
+|---|---|---|
+| Capture UX | [src/selfie-capture.js](src/selfie-capture.js) | Mobile-first 3-shot capture with real-time quality gates (lighting, framing, blur) |
+| Pipeline | [src/selfie-pipeline.js](src/selfie-pipeline.js) | Multi-view fit → FLAME / 3DMM face → base body mesh → rigged GLB |
+| Sandbox route | `/creating` | Isolated reconstruction test bench, decoupled from the main flow |
+| Output | Cloudflare R2 | Meshopt-compressed GLB pinned to IPFS and minted as a draft ERC-8004 token |
+
+Reconstruction inference runs against the same Anthropic-token-billed Vercel function pool as the agent runtime, with optional offload to the **Livepeer Inference Network** (see below) for GPU-heavy steps.
+
+---
+
+## Livepeer Inference Network (Phase 4)
+
+three.ws is wiring the **Livepeer** decentralized GPU network as an alternative inference backend for avatar reconstruction and agent conversations.
+
+- Open protocol: model weights, GPU runtime, signed responses
+- Onchain settlement: pay-per-token with cryptographic receipts, mediated by the same x402 rails described above
+- Node operator client (Docker + GPU drivers) with onchain registration
+- Federation with existing decentralized compute networks where appropriate
+
+The Livepeer dependency landed early so the Phase 1 selfie pipeline can switch its heaviest step (multi-view face fitting) onto external GPU nodes without touching the rest of the system. The goal: ≥50% of production agent traffic served by independent node operators with latency parity to centralized inference.
+
+---
+
+## Voice & Persona Hub (Phase 2)
+
+The avatar isn't just *you* — the agent *acts* like you. The Voice & Persona Hub captures the inputs that turn a body into a personality.
+
+| Surface | Path | Purpose |
+|---|---|---|
+| Persona extraction | [api/persona/extract.js](api/persona/extract.js) | Short onboarding interview → tone, vocabulary, interests profile |
+| Persona preview | [api/persona/preview.js](api/persona/preview.js) | Try the extracted persona against test prompts before saving |
+| Persona keys | `scripts/generate-persona-key.mjs` | Per-agent signing key + persona SSO setup |
+| Voice clone modal | [src/voice/voice-clone-modal.js](src/voice/voice-clone-modal.js) | 3–10s recording → ElevenLabs custom voice bound to the agent |
+| Talk controller | [src/voice/talk-controller.js](src/voice/talk-controller.js) | Push-to-talk and continuous talk modes |
+| ARKit blendshapes | [src/voice/arkit-blendshapes.js](src/voice/arkit-blendshapes.js) | Standard ARKit-52 morph table |
+| Lip-sync driver | [src/voice/lipsync-driver.js](src/voice/lipsync-driver.js) | Web Audio analyser → blendshape weights per frame |
+| Avatar morph target | [src/voice/avatar-morph-target.js](src/voice/avatar-morph-target.js) | Per-rig binding of ARKit blendshapes to the loaded GLB |
+| Avatar snapshot | [src/voice/avatar-snapshot.js](src/voice/avatar-snapshot.js) | Render-time pose capture for thumbnails and OG cards |
+| Persona docs | [docs/persona-hub.md](docs/persona-hub.md) | Full design + onboarding flow |
+
+Memory seed extensions (X, GitHub, Farcaster) feed the agent's memory store at creation time with explicit user consent — see [docs/persona-hub.md](docs/persona-hub.md).
+
+The per-agent fine-tuned system prompt is stored in the manifest, signed, and pinned to IPFS — the persona becomes a verifiable part of the agent's onchain identity.
+
+---
+
+## WASM Vanity Grinder
+
+`/vanity-wallet` is a browser-based vanity-address grinder compiled to WebAssembly. Generate EVM addresses with a prefix (`0xBEEF…`) or pattern in seconds, fully client-side, without leaking the private key to any server.
+
+| Module | Path | Role |
+|---|---|---|
+| WASM grinder | `public/vanity-wallet.html` | Multi-threaded secp256k1 keygen via WebWorkers |
+| Solana variant | `scripts/pump-vanity-grind.mjs` | Server-side grinder for pump.fun mint vanity addresses |
+
+Common use cases on the platform: branded agent wallet addresses (e.g. an agent named `agent.eth` getting an address starting with `0xA6EF…`), or pump.fun token mint vanity (e.g. ending in `pump`).
+
+The Solana grinder backs the platform's pump.fun launches — the inaugural USDC token launches use a vanity mint pre-grind to produce shareable token addresses.
+
+---
+
+## News CMS & Syndication
+
+A local-only news/blog CMS at `/admin/news` produces signed posts that auto-syndicate to multiple destinations.
+
+| Surface | Path | Purpose |
+|---|---|---|
+| CMS | `/admin/news` | Local-only editor — drafts, images, scheduled posts |
+| Public listing | `/news` | Cover-image grid with permalinks |
+| Article | `/news/<slug>` | Server-rendered article with OG card |
+| RSS / Atom | `/api/news/rss` | Standards-compliant feed for HackerNoon auto-import |
+| WebSub hub | `/api/news/websub` | Push notifications to subscribed hubs on publish |
+| Dev.to | syndication adapter | Cross-posts with canonical URL pointing back |
+| Medium | syndication adapter | Same, with format-aware re-render |
+| CMC handoff | syndication adapter | Coinmarketcap article + announcement listing |
+| Newsletter | [api/newsletter-subscribe.js](api/newsletter-subscribe.js) | Resend-backed double-opt-in newsletter |
+
+Each article is a static HTML file in `public/news/` with metadata in Postgres. The CMS supports a cover-image convention for listing thumbnails and OG previews. Articles can be published once and reach HackerNoon, Dev.to, and Medium readers without manual cross-posting.
+
+---
+
+## Security Hardening
+
+The platform has been hardened against the OWASP top-10 plus a set of issues specific to agent payments and cross-chain identity.
+
+| Control | Where |
+|---|---|
+| **SSRF guard** | All outbound `fetch()` from agent runtime + skills goes through an SSRF allow-list filter (`api/_lib/safe-fetch.js`) |
+| **CSRF gates** | State-changing endpoints require an Origin + Sec-Fetch-Site check; bearer-only paths exempt |
+| **Header-origin pinning** | The iframe bridge locks onto the parent's origin from the first authenticated message and ignores later messages from a different origin |
+| **Fail-closed crons** | Cron endpoints fail closed if their auth token is missing — no silent skips |
+| **Idempotency tokens** | x402 paid endpoints require an idempotency key to prevent double-charge on retry |
+| **Embed policy** | Per-agent iframe origin allow-list (`/api/agents/:id/embed-policy`) gates the chromeless embed |
+| **Rate limiting** | Upstash Redis per-user + per-API-key + per-IP buckets at every public endpoint |
+| **JWT key rotation** | `JWT_KID` lets you rotate signing keys without invalidating in-flight sessions |
+| **Bcrypt cost** | Tunable via `PASSWORD_ROUNDS` (default 11) |
+| **Audit signing** | Every agent action is signed with the delegated signer key and chained into a per-agent action log |
+
+---
+
+## Developer SDKs
+
+Three npm-publishable SDKs ship from this repo. They share types and helpers but target different surfaces.
+
+| SDK | Path | What it does |
+|---|---|---|
+| **`@nirholas/agent-kit`** | [sdk/](sdk/) | One-line agent embed for any site — chat panel, voice I/O, ERC-8004 register, Solana attestations |
+| **`@pump-fun/agent-payments-sdk`** | [agent-payments-sdk/](agent-payments-sdk/) | EVM agent payments — wallet, signing, EIP-7710 delegation |
+| **`solana-agent-sdk`** | [solana-agent-sdk/](solana-agent-sdk/) | Solana-native agent ops — Metaplex Core mints, SIWS, attestations, transfer hooks |
+| **Avatar SDK** | [sdk/agent-sdk/](sdk/agent-sdk/) | Avatar load + manipulation helpers — pose, animation, snapshot |
+
+**`@nirholas/agent-kit` quickstart:**
+
+```js
+import { AgentKit, loadAvatar } from '@nirholas/agent-kit';
+import '@nirholas/agent-kit/styles';
+
+const agent = new AgentKit({
+ name: 'My Agent',
+ description: 'Does cool stuff',
+ endpoint: 'https://myapp.com',
+ onMessage: async (text) => `You said: ${text}`,
+});
+agent.mount(document.body);
+
+// Drop a three.ws agent's avatar onto the page
+loadAvatar('a_abc123', document.getElementById('avatar-slot'));
+```
+
+The agent-kit also exposes `attestFeedback`, `attestValidation`, and `listAttestations` for Solana reputation flows. See [sdk/README.md](sdk/README.md).
+
+---
+
## API Reference
The full OpenAPI 3.1 spec is available at `/openapi.json`. The key API surface is organized below.
diff --git a/nav-dropdown-inspect.mjs b/nav-dropdown-inspect.mjs
new file mode 100644
index 000000000..446462e08
--- /dev/null
+++ b/nav-dropdown-inspect.mjs
@@ -0,0 +1,47 @@
+import { chromium } from 'playwright';
+const browser = await chromium.launch();
+const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1 });
+const page = await ctx.newPage();
+await page.goto('http://localhost:3000/marketplace', { waitUntil: 'networkidle' });
+await page.waitForSelector('.home-nav .nav-root', { timeout: 5000 });
+await page.waitForTimeout(800);
+
+// open Build dropdown
+const buildBtn = await page.locator('.home-nav .nav-trigger', { hasText: 'Build' }).first();
+await buildBtn.click();
+await page.waitForTimeout(400);
+
+const menu = await page.locator('.home-nav .nav-trigger[aria-expanded="true"] + .nav-menu').first();
+const visible = await menu.isVisible();
+const box = await menu.boundingBox();
+const cs = await menu.evaluate((el) => {
+ const s = getComputedStyle(el);
+ return {
+ opacity: s.opacity, transform: s.transform, pointerEvents: s.pointerEvents,
+ zIndex: s.zIndex, position: s.position, top: s.top, left: s.left,
+ width: el.offsetWidth, height: el.offsetHeight,
+ childrenCount: el.querySelectorAll('a').length,
+ bg: s.background.slice(0, 80),
+ };
+});
+console.log('Build menu visible:', visible, 'box:', box);
+console.log('Build menu styles:', JSON.stringify(cs, null, 2));
+
+// Direct screenshot of the menu element
+const path = '/tmp/build-dropdown-direct.png';
+await menu.screenshot({ path });
+console.log('Saved:', path);
+
+// Also screenshot a wider area around the menu
+if (box) {
+ await page.screenshot({
+ path: '/tmp/build-dropdown-context.png',
+ clip: {
+ x: Math.max(0, box.x - 40),
+ y: 0,
+ width: Math.min(1440 - Math.max(0, box.x - 40), box.width + 80),
+ height: Math.ceil(box.y + box.height + 40),
+ },
+ });
+}
+await browser.close();
diff --git a/nav-pos-debug.mjs b/nav-pos-debug.mjs
new file mode 100644
index 000000000..10b4a938e
--- /dev/null
+++ b/nav-pos-debug.mjs
@@ -0,0 +1,47 @@
+import { chromium } from 'playwright';
+const browser = await chromium.launch();
+const page = await browser.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1 }).then(c => c.newPage());
+await page.goto('http://localhost:3000/marketplace', { waitUntil: 'networkidle' });
+await page.waitForSelector('.home-nav .nav-root', { timeout: 5000 });
+await page.waitForTimeout(600);
+
+const buildBtn = await page.locator('.home-nav .nav-trigger', { hasText: 'Build' }).first();
+await buildBtn.click();
+await page.waitForTimeout(300);
+
+const data = await page.evaluate(() => {
+ const scroll = { x: window.scrollX, y: window.scrollY, innerH: window.innerHeight };
+ const header = document.querySelector('.site-header');
+ const headerCS = header && getComputedStyle(header);
+ const navContainer = document.getElementById('nav-container');
+ const ncCS = navContainer && getComputedStyle(navContainer);
+ const homeNav = document.querySelector('.home-nav');
+ const hnCS = homeNav && getComputedStyle(homeNav);
+ const rect = (el) => el ? el.getBoundingClientRect() : null;
+ return {
+ scroll,
+ header: rect(header),
+ headerCS: header ? {
+ position: headerCS.position,
+ display: headerCS.display,
+ height: headerCS.height,
+ verticalAlign: headerCS.verticalAlign,
+ lineHeight: headerCS.lineHeight,
+ } : null,
+ navContainer: rect(navContainer),
+ navContainerCS: navContainer ? {
+ display: ncCS.display,
+ verticalAlign: ncCS.verticalAlign,
+ lineHeight: ncCS.lineHeight,
+ } : null,
+ homeNav: rect(homeNav),
+ homeNavCS: homeNav ? {
+ display: hnCS.display,
+ verticalAlign: hnCS.verticalAlign,
+ lineHeight: hnCS.lineHeight,
+ alignItems: hnCS.alignItems,
+ } : null,
+ };
+});
+console.log(JSON.stringify(data, null, 2));
+await browser.close();
diff --git a/nav-screenshot.mjs b/nav-screenshot.mjs
index bd4808737..2bc8461c3 100644
--- a/nav-screenshot.mjs
+++ b/nav-screenshot.mjs
@@ -3,41 +3,53 @@ import { chromium } from 'playwright';
const browser = await chromium.launch();
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
const page = await ctx.newPage();
-
-const errors = [];
-page.on('pageerror', (e) => errors.push('pageerror: ' + e.message));
-page.on('console', (msg) => {
- if (msg.type() === 'error') errors.push('console.error: ' + msg.text());
-});
-
await page.goto('http://localhost:3000/marketplace', { waitUntil: 'networkidle', timeout: 30000 });
-
-// wait for nav to be injected
await page.waitForSelector('.home-nav .nav-root', { timeout: 5000 });
await page.waitForTimeout(800);
-// full header screenshot
+// 1) Full header (clean state)
await page.screenshot({ path: '/tmp/marketplace-nav.png', clip: { x: 0, y: 0, width: 1440, height: 80 } });
-// open the Build dropdown
+// 2) Build dropdown open
const buildBtn = await page.locator('.home-nav .nav-trigger', { hasText: 'Build' }).first();
await buildBtn.click();
-await page.waitForTimeout(300);
-await page.screenshot({ path: '/tmp/marketplace-nav-build-open.png', clip: { x: 0, y: 0, width: 1440, height: 400 } });
-
-// Hover on Marketplace link
-await page.locator('.home-nav a', { hasText: 'Marketplace' }).first().hover();
-await page.waitForTimeout(250);
-await page.screenshot({ path: '/tmp/marketplace-nav-hover.png', clip: { x: 0, y: 0, width: 1440, height: 80 } });
-
-// mobile
+await page.waitForTimeout(400);
+const menu = await page.locator('.home-nav .nav-trigger[aria-expanded="true"] + .nav-menu').first();
+const mb = await menu.boundingBox();
+if (mb) {
+ await page.screenshot({
+ path: '/tmp/marketplace-nav-build-open.png',
+ clip: { x: 0, y: 0, width: 1440, height: Math.ceil(mb.y + mb.height + 16) },
+ });
+}
+await page.mouse.click(10, 600);
+await page.waitForTimeout(200);
+
+// 3) Labs dropdown
+const labsBtn = await page.locator('.home-nav .nav-trigger', { hasText: 'Labs' }).first();
+await labsBtn.click();
+await page.waitForTimeout(400);
+const labsMenu = await page.locator('.home-nav .nav-trigger[aria-expanded="true"] + .nav-menu').first();
+const lb = await labsMenu.boundingBox();
+if (lb) {
+ await page.screenshot({
+ path: '/tmp/marketplace-nav-labs-open.png',
+ clip: { x: 0, y: 0, width: 1440, height: Math.ceil(lb.y + lb.height + 16) },
+ });
+}
+await page.mouse.click(10, 600);
+await page.waitForTimeout(200);
+
+// 4) Mobile closed
await page.setViewportSize({ width: 390, height: 800 });
-await page.waitForTimeout(300);
+await page.waitForTimeout(400);
await page.screenshot({ path: '/tmp/marketplace-nav-mobile.png', clip: { x: 0, y: 0, width: 390, height: 80 } });
+
+// 5) Mobile open
const burger = await page.locator('.home-nav .nav-burger').first();
await burger.click();
-await page.waitForTimeout(300);
-await page.screenshot({ path: '/tmp/marketplace-nav-mobile-open.png', clip: { x: 0, y: 0, width: 390, height: 800 } });
+await page.waitForTimeout(400);
+await page.screenshot({ path: '/tmp/marketplace-nav-mobile-open.png', clip: { x: 0, y: 0, width: 390, height: 700 } });
-console.log('errors:', JSON.stringify(errors, null, 2));
await browser.close();
+console.log('done');
diff --git a/pages/home-v2.html b/pages/home-v2.html
new file mode 100644
index 000000000..339a88717
--- /dev/null
+++ b/pages/home-v2.html
@@ -0,0 +1,1245 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <title>three.ws — Give your AI a body [v2 demo]</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="author" content="nirholas" />
+ <meta
+ name="description"
+ content="Drop any GLB model into three.ws — view it, animate it, embed it anywhere, and give it a verifiable on-chain identity."
+ />
+ <meta name="theme-color" content="#000000" />
+
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:title" content="three.ws — Give Your AI a Body" />
+ <meta
+ property="og:description"
+ content="Drop any GLB model into three.ws — view it, animate it, embed it anywhere, and give it a verifiable on-chain identity."
+ />
+ <meta property="og:url" content="https://three.ws/" />
+ <meta property="og:image" content="https://three.ws/og-image.png" />
+ <meta property="og:image:width" content="1200" />
+ <meta property="og:image:height" content="630" />
+
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:title" content="three.ws — Give Your AI a Body" />
+ <meta
+ name="twitter:description"
+ content="Drop any GLB model into three.ws — view it, animate it, embed it anywhere, and give it a verifiable on-chain identity."
+ />
+ <meta name="twitter:image" content="https://three.ws/og-image.png" />
+
+ <link rel="canonical" href="https://three.ws/" />
+ <script>
+ // Forward legacy /#model=… (and /#agent=, /#onchain=, /#widget=) viewer links to /app,
+ // which is where the Three.js viewer actually mounts. home.html is the marketing page
+ // and ignores these hashes, so without this redirect the user lands on home with no model.
+ (function () {
+ var h = location.hash || '';
+ if (/^#(?:model|agent|onchain|widget|kiosk|preset|brain|deploy|type)=/.test(h)) {
+ location.replace('/app' + h);
+ }
+ })();
+ </script>
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/home.css" />
+ <link rel="stylesheet" href="/home-polish.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <script defer src="/footer-newsletter.js"></script>
+ <script defer src="/home-polish.js"></script>
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/mobile.css" />
+ <script
+ type="module"
+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
+ ></script>
+ <script src="/fluid-particles.js" defer></script>
+ <script type="module" src="/src/home-act2-viewer.js"></script>
+ </head>
+ <body class="home-page">
+ <div class="cursor" id="cursor" aria-hidden="true"></div>
+ <a href="#main-content" class="h-skip-link">Skip to main content</a>
+ <header>
+ <h1>
+ <a href="/marketplace?tab=mine" aria-label="three.ws home"
+ ><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span
+ class="wordmark-dot"
+ aria-hidden="true"
+ ></span
+ >three.ws</a
+ >
+ </h1>
+ <div id="nav-container"></div>
+ </header>
+ <script src="/nav.js"></script>
+
+ <main id="main-content" class="home-parallax">
+ <!-- ── Hero (parallax act) ── -->
+ <section class="h-hero-act">
+ <!-- Depth 8: fluid particles + nebula -->
+ <div class="h-layer" style="--depth: 8" aria-hidden="true">
+ <div class="h-layer-nebula"></div>
+ <canvas id="home-fluid-canvas" class="h-fluid-canvas"></canvas>
+ </div>
+ <!-- Depth 4: perspective grid -->
+ <div class="h-layer" style="--depth: 4" aria-hidden="true">
+ <div class="h-hero-grid"></div>
+ </div>
+ <!-- Depth 3: ghost model drifting in background -->
+ <div class="h-layer" style="--depth: 3" aria-hidden="true">
+ <model-viewer
+ class="h-ghost-model"
+ src="/animations/robotexpressive.glb"
+ auto-rotate
+ auto-rotate-delay="0"
+ rotation-per-second="5deg"
+ interaction-prompt="none"
+ camera-controls="false"
+ disable-zoom
+ shadow-intensity="0"
+ exposure="0.5"
+ environment-image="neutral"
+ camera-orbit="15deg 80deg 4m"
+ field-of-view="45deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ <!-- Depth 2: atmosphere -->
+ <div class="h-layer" style="--depth: 2" aria-hidden="true">
+ <div class="h-hero-mesh"></div>
+ <div class="h-hero-glow-a"></div>
+ <div class="h-hero-glow-b"></div>
+ </div>
+ <!-- Depth 1: main avatar that waves on load and tracks the cursor -->
+ <div class="h-layer" style="--depth: 1">
+ <div class="h-avatar-stage">
+ <div class="h-avatar-wrap">
+ <div class="h-avatar-ring"></div>
+ <div class="h-avatar-glow"></div>
+ <canvas
+ id="hero-avatar"
+ class="h-avatar-viewer"
+ aria-label="three.ws — interactive 3D agent. Click for surprises."
+ ></canvas>
+ </div>
+ </div>
+ </div>
+ <!-- Depth 0.5: vignette closest to camera -->
+ <div class="h-layer" style="--depth: 0.5" aria-hidden="true">
+ <div class="h-vignette"></div>
+ </div>
+
+ <!-- Sticky text pinned to bottom-left — same pattern as features page -->
+ <div class="h-hero-text">
+ <div class="h-eyebrow h-reveal">
+ <span class="h-eyebrow-dot"></span>
+ <span>The 3D layer for onchain AI agents</span>
+ </div>
+ <h2 class="h-title h-reveal">Give your AI<br />a <em>body</em>.</h2>
+ <p class="h-subtitle h-reveal">
+ Born in 3D. Raised on-chain. Yours forever. Your AI has been a chatbox long
+ enough — give it a body, a personality, and a permanent home open to every
+ human, app, and agent that comes looking.
+ </p>
+ <div class="h-cta-row h-reveal">
+ <a href="/create" class="h-btn-primary">
+ <span>Build your agent — free</span>
+ <span class="arrow">→</span>
+ </a>
+ <a href="#pick-animate" class="h-btn-ghost">Try one live ↓</a>
+ </div>
+ <ul class="h-standards h-reveal" aria-label="Supported formats and standards">
+ <li>glTF 2.0</li>
+ <li>GLB</li>
+ <li>Solana</li>
+ <li>Metaplex Core</li>
+ <li>A2A</li>
+ <li>MCP</li>
+ </ul>
+ </div>
+
+ <div class="h-scroll-hint" aria-hidden="true">
+ <span>scroll</span>
+ <span class="h-scroll-line"></span>
+ </div>
+ </section>
+
+ <!-- ── Pillars transition band (between hero and Act 2) ── -->
+ <section class="h-pillars" aria-label="What you get">
+ <div class="h-pillars-inner">
+ <article class="h-pillar h-reveal">
+ <span class="h-pillar-num">01 / Identity</span>
+ <h3>A 3D body for any agent</h3>
+ <p>
+ Drop any GLB into the browser and your AI agent appears as a fully
+ rendered 3D avatar — animated, reactive, and ready to embed anywhere you
+ can drop a script tag.
+ </p>
+ </article>
+ <article class="h-pillar h-reveal">
+ <span class="h-pillar-num">02 / Intelligence</span>
+ <h3>Your stack, your brain</h3>
+ <p>
+ Connect any LLM via MCP or A2A — Claude, GPT, Gemini, or your own.
+ Built-in empathy layer for real-time emotion. No SDK on the consumer
+ side. No vendor lock-in.
+ </p>
+ </article>
+ <article class="h-pillar h-reveal">
+ <span class="h-pillar-num">03 / Ownership</span>
+ <h3>Owned on Solana, portable</h3>
+ <p>
+ Mint your agent as a Metaplex Core asset on Solana — a verifiable,
+ onchain identity discoverable by any A2A or MCP client. Your agent.
+ Your keys.
+ </p>
+ </article>
+ </div>
+ </section>
+
+ <!-- ── Act 2: Pick & Animate ── -->
+ <section class="h-act h-act--animate" data-act="2" id="pick-animate">
+ <div class="h-act-warp h-act-warp--amber" aria-hidden="true"></div>
+ <div class="h-layer" style="--depth: 8" aria-hidden="true">
+ <div class="h-layer-bg h-layer-bg--amber"></div>
+ <canvas
+ class="h-star-canvas"
+ data-role="star-canvas"
+ data-tint="255,190,80"
+ data-count="200"
+ ></canvas>
+ </div>
+ <div class="h-layer" style="--depth: 4" aria-hidden="true">
+ <svg
+ class="h-layer-words"
+ viewBox="0 0 1600 900"
+ preserveAspectRatio="xMidYMid slice"
+ role="presentation"
+ >
+ <g
+ fill="rgba(255,200,80,0.13)"
+ font-family="'Space Grotesk','Inter',sans-serif"
+ font-weight="600"
+ >
+ <text x="80" y="200" font-size="52">Dance</text>
+ <text x="1100" y="160" font-size="44">Wave</text>
+ <text x="200" y="710" font-size="44">Jump</text>
+ <text x="980" y="760" font-size="40">ThumbsUp</text>
+ <text x="560" y="440" font-size="96" fill="rgba(255,255,255,0.05)">
+ Idle
+ </text>
+ <text x="55" y="860" font-size="40">Punch</text>
+ <text x="1260" y="520" font-size="48">Run</text>
+ </g>
+ </svg>
+ </div>
+ <div class="h-layer" style="--depth: 2" aria-hidden="true">
+ <div class="h-layer-orb h-layer-orb--amber"></div>
+ </div>
+ <div class="h-layer" style="--depth: 1">
+ <div class="h-avatar-stage">
+ <div class="h-avatar-wrap">
+ <canvas id="home-act2-canvas" class="h-avatar-viewer"></canvas>
+ </div>
+ </div>
+ </div>
+ <div class="h-layer" style="--depth: 0.5" aria-hidden="true">
+ <div class="h-vignette"></div>
+ </div>
+
+ <div class="h-act-text">
+ <div class="h-act-eyebrow">
+ <span class="h-act-dot"></span>
+ <span>Pick &amp; animate</span>
+ </div>
+ <h2 class="h-act-title">Your agent.<br /><em>Any move.</em></h2>
+ <p class="h-act-lede">
+ Choose an avatar, trigger an animation. This is exactly what lives on your
+ site.
+ </p>
+
+ <div class="h-avatar-picker" role="group" aria-label="Choose avatar">
+ <button
+ class="h-av-opt"
+ data-src="/animations/robotexpressive.glb"
+ aria-pressed="true"
+ >
+ Robot
+ </button>
+ <button
+ class="h-av-opt"
+ data-src="/animations/soldier.glb"
+ aria-pressed="false"
+ >
+ Soldier
+ </button>
+ <button class="h-av-opt" data-src="/avatars/cz.glb" aria-pressed="false">
+ CZ
+ </button>
+ </div>
+
+ <div
+ class="h-anim-chips"
+ role="group"
+ aria-label="Trigger animation"
+ data-role="anim-chips"
+ ></div>
+
+ <div class="h-act-cta">
+ <a href="/app" class="h-btn-primary"
+ ><span>Open full viewer</span><span class="arrow">→</span></a
+ >
+ <a href="/create" class="h-btn-ghost">Create your agent</a>
+ </div>
+ </div>
+ </section>
+
+ <!-- ── Act 3: Deploy on-chain ── -->
+ <section class="h-act h-act--deploy" data-act="3" id="deploy-act">
+ <div class="h-act-warp h-act-warp--mint" aria-hidden="true"></div>
+ <div class="h-layer" style="--depth: 8" aria-hidden="true">
+ <div class="h-layer-bg h-layer-bg--mint"></div>
+ <canvas
+ class="h-star-canvas"
+ data-role="star-canvas"
+ data-tint="110,231,183"
+ data-count="200"
+ ></canvas>
+ </div>
+
+ <div class="h-layer" style="--depth: 2" aria-hidden="true">
+ <div class="h-layer-orb h-layer-orb--mint"></div>
+ </div>
+ <div class="h-layer" style="--depth: 1" aria-hidden="true">
+ <div class="h-avatar-stage h-avatar-stage--trio">
+ <div class="h-avatar-wrap h-avatar-wrap--ghost h-avatar-wrap--trio">
+ <canvas
+ id="act3-avatar-a"
+ class="h-avatar-viewer h-avatar-viewer--tall"
+ ></canvas>
+ </div>
+ <div class="h-avatar-wrap h-avatar-wrap--ghost h-avatar-wrap--trio">
+ <canvas
+ id="act3-avatar-b"
+ class="h-avatar-viewer h-avatar-viewer--tall"
+ ></canvas>
+ </div>
+ <div class="h-avatar-wrap h-avatar-wrap--ghost h-avatar-wrap--trio">
+ <canvas
+ id="act3-avatar-c"
+ class="h-avatar-viewer h-avatar-viewer--tall"
+ ></canvas>
+ </div>
+ </div>
+ </div>
+ <div class="h-layer" style="--depth: 0.5" aria-hidden="true">
+ <div class="h-vignette"></div>
+ </div>
+
+ <div class="h-act-text">
+ <div class="h-act-eyebrow">
+ <span class="h-act-dot h-act-dot--mint"></span>
+ <span>Metaplex native</span>
+ </div>
+ <h2 class="h-act-title h-act-title--mint">
+ One transaction.<br /><em>One identity.</em>
+ </h2>
+ <p class="h-act-lede">
+ Mint onchain on Solana. Get a portable, verifiable agentId discoverable
+ by any A2A or MCP client.
+ </p>
+
+ <form class="h-deploy-form" id="home-deploy-form" action="/deploy" method="get">
+ <div class="h-form-row">
+ <label class="h-form-label" for="agent-name-home">Agent name</label>
+ <input
+ id="agent-name-home"
+ name="name"
+ class="h-form-input"
+ type="text"
+ placeholder="my-agent"
+ autocomplete="off"
+ spellcheck="false"
+ />
+ </div>
+ <div class="h-form-row">
+ <label class="h-form-label" for="network-home">Network</label>
+ <select id="network-home" name="network" class="h-form-select">
+ <option value="mainnet-beta" selected>Solana Mainnet</option>
+ <option value="devnet">Solana Devnet</option>
+ </select>
+ </div>
+ <div class="h-deploy-stats">
+ <div>
+ <span class="h-stat-label">Chain</span
+ ><span class="h-stat-val">Solana</span>
+ </div>
+ <div>
+ <span class="h-stat-label">Standard</span
+ ><span class="h-stat-val">Metaplex Core</span>
+ </div>
+ <div>
+ <span class="h-stat-label">Fee</span
+ ><span class="h-stat-val">~$0.01</span>
+ </div>
+ </div>
+ <button type="submit" class="h-btn-primary h-btn-deploy">
+ <span>Mint your agent</span>
+ <span class="arrow">→</span>
+ </button>
+ </form>
+ </div>
+ </section>
+
+ <!-- ── Bento feature grid ── -->
+ <section class="h-bento-section">
+ <div class="h-bento-header h-reveal">
+ <p class="h-section-label">What you get</p>
+ <h2 class="h-section-title">
+ Everything an agent needs<br />to exist in the world.
+ </h2>
+ </div>
+ <div class="h-bento-grid">
+ <!-- Large card: 3D viewer + inline animation panel -->
+ <div class="h-bento-card h-bento-card--lg h-reveal">
+ <div class="h-bento-visual">
+ <canvas id="bento-cz-canvas" class="h-bento-cz-canvas"></canvas>
+ </div>
+ <div class="h-bento-anim-panel" data-role="bento-anim-panel">
+ <div class="h-bento-anim-header">
+ <span class="h-bento-anim-title">Animations</span>
+ <button
+ type="button"
+ class="h-bento-anim-stop"
+ data-role="bento-anim-stop"
+ title="Stop all"
+ >
+ ⏹
+ </button>
+ </div>
+ <div class="h-bento-anim-grid" data-role="bento-anim-grid"></div>
+ </div>
+ <div class="h-bento-body">
+ <span class="h-bento-tag">Viewer</span>
+ <h3>WebGL rendering, zero install.</h3>
+ <p>
+ Drag any GLB into the browser. Full animations, lighting, and
+ materials — instantly, on any device.
+ </p>
+ <a href="/app" class="h-feature-link">Open viewer →</a>
+ </div>
+ </div>
+ <!-- Small cards -->
+ <div class="h-bento-card h-reveal">
+ <div class="h-bento-body">
+ <span class="h-bento-tag">Embed</span>
+ <h3>One iframe. Any site.</h3>
+ <p>Notion, Ghost, WordPress, Framer. No SDK on the consumer side.</p>
+ <div class="h-bento-code">
+ <span class="tag">&lt;agent-3d</span>
+ <br />&nbsp;&nbsp;<span class="attr">agent-id</span>=<span
+ class="val"
+ >"3DAg…uPL"</span
+ >
+ <br /><span class="tag">&gt;&lt;/agent-3d&gt;</span>
+ </div>
+ </div>
+ </div>
+ <div class="h-bento-card h-reveal">
+ <div class="h-bento-body">
+ <span class="h-bento-tag h-bento-tag--mint">On-chain</span>
+ <h3>Verifiable identity.</h3>
+ <p>
+ Metaplex Core asset on Solana. One transaction, sub-cent fees.
+ Discoverable by any A2A or MCP client.
+ </p>
+ </div>
+ </div>
+ <div class="h-bento-card h-reveal">
+ <div class="h-bento-body">
+ <span class="h-bento-tag h-bento-tag--violet">AI</span>
+ <h3>Six emotions. Real time.</h3>
+ <p>
+ Built-in empathy layer. Your agent reacts — speaking, thinking,
+ succeeding, failing.
+ </p>
+ <ul class="h-bento-emotions" aria-label="Emotion states">
+ <li><span class="h-em-dot"></span>Celebration</li>
+ <li><span class="h-em-dot"></span>Curiosity</li>
+ <li><span class="h-em-dot"></span>Empathy</li>
+ <li><span class="h-em-dot"></span>Concern</li>
+ </ul>
+ </div>
+ </div>
+ <div class="h-bento-card h-reveal">
+ <div class="h-bento-body">
+ <span class="h-bento-tag">Widgets</span>
+ <h3>5 widget types.</h3>
+ <p>
+ Turntable · Talking Agent · Animation Gallery · ERC-8004 Passport ·
+ Hotspot Tour
+ </p>
+ <a href="/studio" class="h-feature-link">Widget Studio →</a>
+ </div>
+ </div>
+ </div>
+ </section>
+
+ <!-- ── Developer section ── -->
+ <div class="h-dev-section h-reveal">
+ <div class="h-dev-inner">
+ <div class="h-dev-text">
+ <p class="h-section-label">For developers</p>
+ <h2>Drop one tag.<br />Ship a 3D agent.</h2>
+ <p class="h-dev-sub">
+ The <code>&lt;agent-3d&gt;</code> web component lazy-loads, renders
+ anywhere, and connects to your existing AI stack via MCP or A2A. No
+ framework. No build step.
+ </p>
+ <div class="h-dev-links">
+ <a href="/docs" class="h-feature-link">Read the docs →</a>
+ <a
+ href="https://github.com/nirholas/three.ws"
+ target="_blank"
+ rel="noopener"
+ class="h-feature-link"
+ >GitHub →</a
+ >
+ </div>
+ </div>
+ <div class="h-dev-code">
+ <div class="h-dev-code-bar">
+ <span class="h-dev-code-dot"></span>
+ <span class="h-dev-code-dot"></span>
+ <span class="h-dev-code-dot"></span>
+ <span class="h-dev-code-filename">index.html</span>
+ </div>
+ <pre
+ class="h-dev-pre"
+ ><code><span class="c">&lt;!-- 1. Load the component --&gt;</span>
+<span class="tag">&lt;script</span> <span class="attr">type</span>=<span class="val">"module"</span>
+ <span class="attr">src</span>=<span class="val">"https://three.ws/agent-3d/latest/agent-3d.js"</span><span class="tag">&gt;&lt;/script&gt;</span>
+
+<span class="c">&lt;!-- 2. Drop the tag --&gt;</span>
+<span class="tag">&lt;agent-3d</span>
+ <span class="attr">agent-id</span>=<span class="val">"3DAg…uPL"</span>
+ <span class="attr">kiosk</span>
+<span class="tag">&gt;&lt;/agent-3d&gt;</span></code></pre>
+ </div>
+ </div>
+ </div>
+
+ <!-- ── Final CTA ── -->
+ <section class="h-cta-section">
+ <div class="h-cta-inner h-reveal">
+ <h2>Your agent deserves<br />a face.</h2>
+ <p>Free to start. No credit card. No install.</p>
+ <div class="h-cta-row-center">
+ <a href="/create" class="h-btn-primary">
+ <span>Create your agent</span>
+ <span class="arrow">→</span>
+ </a>
+ <a href="/app" class="h-btn-ghost">Try the viewer</a>
+ </div>
+ </div>
+ </section>
+
+ <footer class="h-footer h-footer-horizon">
+ <div class="h-footer-glow-line" aria-hidden="true"></div>
+ <div class="h-footer-floor" aria-hidden="true"></div>
+ <div class="h-footer-haze" aria-hidden="true"></div>
+ <div class="h-footer-watermark" aria-hidden="true">three.ws</div>
+ <div class="h-footer-avatar" aria-hidden="true">
+ <model-viewer
+ src="/animations/robotexpressive.glb"
+ auto-rotate
+ auto-rotate-delay="0"
+ rotation-per-second="20deg"
+ interaction-prompt="none"
+ camera-controls="false"
+ disable-zoom
+ shadow-intensity="0"
+ exposure="0.7"
+ environment-image="neutral"
+ camera-orbit="0deg 80deg 9m"
+ field-of-view="45deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+
+ <div class="h-footer-cta">
+ <div class="h-footer-newsletter">
+ <h3>Stay in the loop</h3>
+ <p>Get updates on new features, agent tooling, and protocol changes.</p>
+ <form class="h-footer-newsletter-form" data-newsletter-form novalidate>
+ <input
+ type="email"
+ class="h-footer-newsletter-input"
+ name="email"
+ placeholder="Enter your email"
+ aria-label="Email address"
+ autocomplete="email"
+ required
+ />
+ <button
+ type="submit"
+ class="h-footer-newsletter-btn"
+ aria-label="Subscribe"
+ >
+ <svg viewBox="0 0 16 16" aria-hidden="true">
+ <path
+ fill="none"
+ stroke="currentColor"
+ stroke-width="1.6"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M2 8h11m0 0L9 4m4 4l-4 4"
+ />
+ </svg>
+ </button>
+ </form>
+ <p
+ class="h-footer-newsletter-msg"
+ data-newsletter-msg
+ aria-live="polite"
+ ></p>
+ </div>
+ <div class="h-footer-community">
+ <h3>Join the community</h3>
+ <p>Follow along for builds, demos, and conversations with the team.</p>
+ <a
+ class="h-footer-community-btn"
+ href="https://x.com/trythreews"
+ target="_blank"
+ rel="noopener"
+ >
+ <svg viewBox="0 0 24 24" aria-hidden="true">
+ <path
+ fill="currentColor"
+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
+ />
+ </svg>
+ Follow on X
+ </a>
+ </div>
+ </div>
+ <div class="h-footer-inner">
+ <div class="h-footer-brand-col">
+ <div class="h-footer-brand">
+ <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />
+ <span class="wordmark-dot" aria-hidden="true"></span>
+ <span>three.ws</span>
+ </div>
+ <p class="h-footer-tagline">Give your AI a body.</p>
+ <div class="h-footer-socials">
+ <a
+ class="h-footer-social"
+ href="https://x.com/trythreews"
+ target="_blank"
+ rel="noopener"
+ aria-label="three.ws on X"
+ >
+ <svg viewBox="0 0 24 24" aria-hidden="true">
+ <path
+ fill="currentColor"
+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
+ />
+ </svg>
+ </a>
+ <a
+ class="h-footer-social"
+ href="https://github.com/nirholas/three.ws"
+ target="_blank"
+ rel="noopener"
+ aria-label="three.ws on GitHub"
+ >
+ <svg viewBox="0 0 16 16" aria-hidden="true">
+ <path
+ fill="currentColor"
+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"
+ />
+ </svg>
+ </a>
+ </div>
+ </div>
+ <nav class="h-footer-links" aria-label="Footer">
+ <div class="h-footer-link-col">
+ <h4 class="h-footer-link-heading">Product</h4>
+ <a href="/create">Create</a>
+ <a href="/studio">Studio</a>
+ <a href="/widgets">Widgets</a>
+ <a href="/discover">Discover</a>
+ </div>
+ <div class="h-footer-link-col">
+ <h4 class="h-footer-link-heading">Developers</h4>
+ <a href="/docs">Docs</a>
+ <a
+ href="https://github.com/nirholas/three.ws"
+ target="_blank"
+ rel="noopener"
+ >GitHub</a
+ >
+ <a
+ href="https://developers.metaplex.com/core"
+ target="_blank"
+ rel="noopener"
+ >Metaplex Core</a
+ >
+ </div>
+ <div class="h-footer-link-col">
+ <h4 class="h-footer-link-heading">Resources</h4>
+ <a href="/blog">Blog</a>
+ <a href="/dashboard">Dashboard</a>
+ </div>
+ </nav>
+ </div>
+ <div class="h-footer-bottom">
+ <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
+ <div class="h-footer-legal-links">
+ <a href="/legal/privacy">Privacy Policy</a>
+ <a href="/legal/tos">Terms of Use</a>
+ </div>
+ </div>
+ </footer>
+ </main>
+
+ <script>
+ // Devices with < 2 GB RAM get no WebGL viewers — avoids GPU OOM and
+ // context-limit issues. navigator.deviceMemory is undefined on Firefox/Safari
+ // so we default to "capable" when the API is absent.
+ const LOW_MEMORY = typeof navigator.deviceMemory === 'number' && navigator.deviceMemory < 2;
+ const REDUCED_MOTION = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ // Skip GL only on truly constrained devices. Reduced-motion users still
+ // see the avatars (without auto-rotate); skipping rendering for them left
+ // the bento/Act 2/Act 3 canvases permanently blank.
+ const SKIP_OFFSCREEN_GL = LOW_MEMORY;
+
+ // Scroll reveal — use viewport (root: null) so IntersectionObserver
+ // avoids the perspective transform on .home-parallax breaking intersection math.
+ (function () {
+ const root = document.querySelector('.home-parallax');
+ const els = document.querySelectorAll('.h-reveal');
+ const observer = new IntersectionObserver(
+ (entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('revealed');
+ observer.unobserve(entry.target);
+ }
+ });
+ },
+ { root: null, threshold: 0.12, rootMargin: '0px 0px -50px 0px' },
+ );
+ els.forEach((el) => {
+ const siblings = Array.from(el.parentElement.querySelectorAll('.h-reveal'));
+ const idx = siblings.indexOf(el);
+ el.style.transitionDelay = idx * 0.09 + 's';
+ observer.observe(el);
+ });
+ })();
+
+ // Hero avatar — Act2Viewer with cursor/scroll orbit + click → real animations
+ (function () {
+ const scrollEl = document.querySelector('.home-parallax');
+ const canvas = document.getElementById('hero-avatar');
+ const heroAct = document.querySelector('.h-hero-act');
+ if (!scrollEl || !canvas || !heroAct) return;
+
+ let mouseX = 0,
+ mouseY = 0,
+ scrollProgress = 0;
+ const BASE_THETA = -45,
+ BASE_PHI = 80,
+ BASE_R = 20;
+ let curTheta = BASE_THETA,
+ curPhi = BASE_PHI,
+ curR = BASE_R;
+
+ window.addEventListener(
+ 'mousemove',
+ (e) => {
+ mouseX = (e.clientX / innerWidth) * 2 - 1;
+ mouseY = (e.clientY / innerHeight) * 2 - 1;
+ },
+ { passive: true },
+ );
+
+ scrollEl.addEventListener(
+ 'scroll',
+ () => {
+ scrollProgress = Math.min(scrollEl.scrollTop / heroAct.offsetHeight, 1);
+ },
+ { passive: true },
+ );
+
+ function whenReady(cb) {
+ if (window.Act2Viewer) return cb();
+ setTimeout(() => whenReady(cb), 60);
+ }
+
+ whenReady(() => {
+ const viewer = new window.Act2Viewer(canvas, { fov: 18 });
+ let orbitActive = false;
+
+ /* cursor + scroll orbit loop — starts after model loads to avoid camera snap */
+ (function tick() {
+ if (orbitActive) {
+ const scrollTheta = scrollProgress * 90;
+ const scrollPhi = -scrollProgress * 8;
+ const scrollR = scrollProgress * 0.8;
+ curTheta += (BASE_THETA + scrollTheta + mouseX * 16 - curTheta) * 0.07;
+ curPhi += (BASE_PHI + scrollPhi + mouseY * 6 - curPhi) * 0.07;
+ curR += (BASE_R + scrollR - curR) * 0.12;
+ viewer.setOrbit(curTheta, curPhi, curR);
+ }
+ requestAnimationFrame(tick);
+ })();
+
+ const wrap = canvas.closest('.h-avatar-wrap');
+
+ /* falling: wait for clip to play out, then expand and slide across.
+ alreadyPlaying=true skips the playClip call (used on first load). */
+ async function doFalling(alreadyPlaying = false) {
+ if (!alreadyPlaying) {
+ try {
+ await viewer.playClip('falling');
+ } catch (_) {}
+ }
+
+ /* wait for the actual clip to finish on the ground */
+ const clipDur = viewer.currentAction
+ ? viewer.currentAction.getClip().duration * 1000
+ : 2200;
+ await new Promise((r) => setTimeout(r, clipDur));
+
+ /* expand to full-width and slide the model slowly across the ground */
+ wrap.classList.add('h-avatar-wrap--traversing');
+ const SLIDE_DUR = 3200;
+ const SLIDE_DIST = 8;
+ const t0 = performance.now();
+ await new Promise((r) => {
+ (function step(now) {
+ const t = Math.min((now - t0) / SLIDE_DUR, 1);
+ const x = SLIDE_DIST * t;
+ if (viewer.model) viewer.model.position.x = x;
+ viewer._focusX = x;
+ if (t < 1) {
+ requestAnimationFrame(step);
+ } else {
+ r();
+ }
+ })(performance.now());
+ });
+
+ /* reset + back to dance */
+ if (viewer.model) viewer.model.position.x = 0;
+ viewer._focusX = 0;
+ wrap.classList.remove('h-avatar-wrap--traversing');
+ viewer.playClip('dance').catch(() => {});
+ }
+
+ canvas.style.opacity = '0';
+ viewer
+ .loadModel('/avatars/cz.glb', { autoPlay: false })
+ .then(async () => {
+ /* Scale up ring geometry so it fills the canvas */
+ viewer.model.traverse((node) => {
+ if (node.isMesh || node.isGroup) {
+ const n = node.name.toLowerCase();
+ if (n.includes('ring') || n.includes('circle') || n.includes('halo') || n.includes('orbit') || n.includes('arc')) {
+ node.scale.setScalar(2.5);
+ }
+ }
+ });
+ viewer._modelFocusY = 1.1;
+ viewer.setOrbit(curTheta, curPhi, curR);
+ orbitActive = true;
+ /* fetch + start the falling clip before revealing — no T-pose flash */
+ try {
+ await viewer.playClip('falling');
+ } catch (_) {}
+ canvas.style.transition = 'opacity 0.15s';
+ canvas.style.opacity = '1';
+ /* clip is already playing — pass flag so doFalling skips the restart */
+ doFalling(true);
+ })
+ .catch(console.error);
+
+ /* click → random manifest animation; falling gets full traverse treatment */
+ const FUN = [
+ 'falling',
+ 'wave',
+ 'dance',
+ 'celebrate',
+ 'jump',
+ 'rumba',
+ 'capoeira',
+ 'thriller',
+ 'kiss',
+ 'taunt',
+ 'pray',
+ 'idle',
+ 'angry',
+ 'defeated',
+ 'dying',
+ 'reaction',
+ 'silly',
+ 'sitclap',
+ 'sitlaugh',
+ 'walk',
+ 'dodge',
+ 'stepback',
+ 'shoved',
+ 'standup',
+ 'header',
+ 'coverstand',
+ 'goalkeeper',
+ 'jumpdown',
+ 'jumpdown2',
+ 'jumpdown3',
+ 'removing',
+ 'falltolanding',
+ ];
+ let lastAnim = null;
+ canvas.style.cursor = 'pointer';
+ canvas.addEventListener('click', async () => {
+ const pool = FUN.filter((a) => a !== lastAnim);
+ const name = pool[Math.floor(Math.random() * pool.length)];
+ lastAnim = name;
+ if (name === 'falling') {
+ doFalling();
+ return;
+ }
+ try {
+ await viewer.playClip(name);
+ const def = viewer._manifest.find((d) => d.name === name);
+ if (def && !def.loop) {
+ setTimeout(() => viewer.playClip('dance').catch(() => {}), 2600);
+ }
+ } catch (_) {}
+ });
+ });
+ })();
+
+ // Act 2 viewer — Three.js + animation manifest, same trick as /app.
+ // Every model gets every clip from /animations/manifest.json (retargeted
+ // onto its skeleton via AnimationMixer), regardless of what's baked in.
+ (function () {
+ const canvas = document.getElementById('home-act2-canvas');
+ const opts = document.querySelectorAll('.h-av-opt');
+ const chipsWrap = document.querySelector('[data-role="anim-chips"]');
+ if (!canvas || !chipsWrap) return;
+
+ /* Wait for the Act2Viewer ESM to load (it sets window.Act2Viewer) */
+ function whenReady(cb) {
+ if (window.Act2Viewer) return cb();
+ setTimeout(() => whenReady(cb), 60);
+ }
+
+ function initAct2() {
+ whenReady(() => {
+ const viewer = new window.Act2Viewer(canvas);
+
+ function prettyLabel(def) {
+ const icon = def.icon || '✨';
+ const label = (def.label || def.name).replace(/\s*\([^)]*\)/g, '').trim();
+ return icon + ' ' + label;
+ }
+
+ function rebuildChips(defs) {
+ chipsWrap.innerHTML = '';
+ defs.forEach((def, i) => {
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'h-anim-chip';
+ btn.dataset.anim = def.name;
+ btn.textContent = prettyLabel(def);
+ if (i === 0) btn.dataset.active = 'true';
+ btn.addEventListener('click', async () => {
+ chipsWrap
+ .querySelectorAll('.h-anim-chip')
+ .forEach((c) => delete c.dataset.active);
+ btn.dataset.active = 'true';
+ try {
+ await viewer.playClip(def.name);
+ } catch (e) {
+ /* ignore */
+ }
+ });
+ chipsWrap.appendChild(btn);
+ });
+ }
+
+ viewer.onClipsReady = rebuildChips;
+
+ /* default avatar — Robot (matches aria-pressed="true" in HTML) */
+ viewer.loadModel('/animations/robotexpressive.glb').catch(console.error);
+
+ /* avatar picker */
+ opts.forEach((btn) => {
+ btn.addEventListener('click', async () => {
+ opts.forEach((b) => b.setAttribute('aria-pressed', 'false'));
+ btn.setAttribute('aria-pressed', 'true');
+ try {
+ await viewer.loadModel(btn.dataset.src);
+ } catch (e) {
+ console.error(e);
+ }
+ });
+ });
+
+ /* click on canvas to toggle zoom (default → extra-wide) */
+ let wider = false;
+ const NEAR = 22,
+ FAR = 36;
+ canvas.addEventListener('click', () => {
+ wider = !wider;
+ viewer.zoom(wider ? FAR : NEAR);
+ });
+ });
+ }
+
+ if (!SKIP_OFFSCREEN_GL) {
+ let act2Inited = false;
+ const act2Obs = new IntersectionObserver((entries) => {
+ if (entries[0].isIntersecting && !act2Inited) {
+ act2Inited = true;
+ act2Obs.disconnect();
+ initAct2();
+ }
+ }, { threshold: 0, rootMargin: '600px 0px 600px 0px' });
+ act2Obs.observe(canvas);
+ }
+ })();
+
+ // Bento Viewer card — same Act2Viewer + animation panel as Act 2
+ (function () {
+ const canvas = document.getElementById('bento-cz-canvas');
+ const grid = document.querySelector('[data-role="bento-anim-grid"]');
+ const stopBtn = document.querySelector('[data-role="bento-anim-stop"]');
+ if (!canvas || !grid) return;
+
+ function whenReady(cb) {
+ if (window.Act2Viewer) return cb();
+ setTimeout(() => whenReady(cb), 60);
+ }
+
+ function initViewer() {
+ whenReady(() => {
+ const viewer = new window.Act2Viewer(canvas, { fov: 20 });
+
+ function prettyLabel(def) {
+ return (def.label || def.name).replace(/\s*\([^)]*\)/g, '').trim();
+ }
+
+ function buildButtons(defs) {
+ grid.innerHTML = '';
+ defs.forEach((def, i) => {
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'h-bento-anim-btn';
+ btn.dataset.anim = def.name;
+ btn.title = def.label || def.name;
+ const icon = document.createElement('span');
+ icon.className = 'h-bento-anim-btn__icon';
+ icon.textContent = def.icon || '✨';
+ const label = document.createElement('span');
+ label.className = 'h-bento-anim-btn__label';
+ label.textContent = prettyLabel(def);
+ btn.appendChild(icon);
+ btn.appendChild(label);
+ if (i === 0) btn.classList.add('h-bento-anim-btn--active');
+ btn.addEventListener('click', async () => {
+ grid.querySelectorAll('.h-bento-anim-btn').forEach((b) =>
+ b.classList.remove('h-bento-anim-btn--active'),
+ );
+ btn.classList.add('h-bento-anim-btn--active');
+ btn.classList.add('h-bento-anim-btn--loading');
+ try {
+ await viewer.playClip(def.name);
+ } catch (_) {}
+ btn.classList.remove('h-bento-anim-btn--loading');
+ });
+ grid.appendChild(btn);
+ });
+ }
+
+ viewer.onClipsReady = buildButtons;
+ viewer
+ .loadModel('/avatars/cz.glb', { autoPlay: false })
+ .then(() => viewer.playClip('celebrate').catch(() => {}))
+ .catch(console.error);
+
+ if (stopBtn) {
+ stopBtn.addEventListener('click', () => {
+ if (viewer.mixer) viewer.mixer.stopAllAction();
+ viewer.currentAction = null;
+ grid.querySelectorAll('.h-bento-anim-btn').forEach((b) =>
+ b.classList.remove('h-bento-anim-btn--active'),
+ );
+ });
+ }
+ });
+ }
+
+ // Defer viewer init until canvas scrolls into view — avoids creating
+ // WebGL context before the card is visible inside the parallax container.
+ if (!SKIP_OFFSCREEN_GL) {
+ let inited = false;
+ const io = new IntersectionObserver((entries) => {
+ if (entries[0].isIntersecting && !inited) {
+ inited = true;
+ io.disconnect();
+ initViewer();
+ }
+ }, { threshold: 0, rootMargin: '600px 0px 600px 0px' });
+ io.observe(canvas);
+ }
+ })();
+
+ // Chain ribbon (Act 3)
+ (function () {
+ const ribbon = document.querySelector('[data-role="home-chain-ribbon"]');
+ if (!ribbon) return;
+ const labels = [
+ 'Solana',
+ 'Base',
+ 'Ethereum',
+ 'BSC',
+ 'Arbitrum',
+ 'Avalanche',
+ 'Celo',
+ 'Linea',
+ 'zkSync',
+ 'Scroll',
+ 'Optimism',
+ 'Mode',
+ ];
+ ribbon.replaceChildren(
+ ...labels.map((l) => {
+ const s = document.createElement('span');
+ s.className = 'chain-pill';
+ s.textContent = l;
+ return s;
+ }),
+ );
+ })();
+
+ // Custom cursor
+ (function () {
+ const cursor = document.getElementById('cursor');
+ if (!cursor || window.matchMedia('(hover: none)').matches || REDUCED_MOTION) return;
+ let cx = -100,
+ cy = -100,
+ tx = -100,
+ ty = -100;
+ document.addEventListener('mousemove', (e) => {
+ tx = e.clientX;
+ ty = e.clientY;
+ });
+ document.addEventListener('mouseleave', () => {
+ tx = cy = -100;
+ });
+ const hover = 'a,button,[role="button"],.h-av-opt,.h-anim-chip';
+ document.querySelectorAll(hover).forEach((el) => {
+ el.addEventListener('mouseenter', () => cursor.classList.add('cursor--hover'));
+ el.addEventListener('mouseleave', () =>
+ cursor.classList.remove('cursor--hover'),
+ );
+ });
+ (function loop() {
+ cx += (tx - cx) * 0.18;
+ cy += (ty - cy) * 0.18;
+ cursor.style.transform = `translate(${cx}px,${cy}px) translate(-50%,-50%)`;
+ requestAnimationFrame(loop);
+ })();
+ })();
+
+ // Act 3 — animated trio of ghost avatars (robot, CZ, soldier)
+ (function () {
+ const configs = [
+ {
+ id: 'act3-avatar-a',
+ src: '/animations/robotexpressive.glb',
+ anim: 'capoeira',
+ },
+ { id: 'act3-avatar-b', src: '/avatars/cz.glb', anim: 'rumba' },
+ { id: 'act3-avatar-c', src: '/animations/soldier.glb', anim: 'wave' },
+ ];
+
+ function whenReady(cb) {
+ if (window.Act2Viewer) return cb();
+ setTimeout(() => whenReady(cb), 60);
+ }
+
+ function initAct3() {
+ whenReady(() => {
+ configs.forEach(({ id, src, anim }) => {
+ const canvas = document.getElementById(id);
+ if (!canvas) return;
+ const viewer = new window.Act2Viewer(canvas, { fov: 22 });
+ viewer
+ .loadModel(src)
+ .then(() => viewer.playClip(anim).catch(() => {}))
+ .catch(() => {});
+ });
+ });
+ }
+
+ // Observe the first Act3 canvas; when it enters view, init all three.
+ const firstCanvas = document.getElementById('act3-avatar-a');
+ if (firstCanvas && !SKIP_OFFSCREEN_GL) {
+ let act3Inited = false;
+ const act3Obs = new IntersectionObserver((entries) => {
+ if (entries[0].isIntersecting && !act3Inited) {
+ act3Inited = true;
+ act3Obs.disconnect();
+ initAct3();
+ }
+ }, { threshold: 0, rootMargin: '600px 0px 600px 0px' });
+ act3Obs.observe(firstCanvas);
+ }
+ })();
+
+ // Star field canvas
+ (function () {
+ for (const canvas of document.querySelectorAll('[data-role="star-canvas"]')) {
+ const dpr = Math.min(window.devicePixelRatio || 1, 2);
+ const w = window.innerWidth * dpr;
+ const h = window.innerHeight * 8 * dpr;
+ canvas.width = w;
+ canvas.height = h;
+ const ctx = canvas.getContext('2d');
+ const tint = canvas.dataset.tint || '255,255,255';
+ const count = parseInt(canvas.dataset.count || '250', 10);
+ for (let i = 0; i < count; i++) {
+ const x = Math.random() * w;
+ const y = Math.random() * h;
+ const r = (Math.random() * 1.4 + 0.3) * dpr;
+ ctx.beginPath();
+ ctx.arc(x, y, r, 0, Math.PI * 2);
+ ctx.fillStyle = `rgba(${tint},${Math.random() * 0.65 + 0.2})`;
+ ctx.fill();
+ }
+ for (let i = 0; i < 10; i++) {
+ const x = Math.random() * w,
+ y = Math.random() * h;
+ const g = ctx.createRadialGradient(x, y, 0, x, y, 6 * dpr);
+ g.addColorStop(0, `rgba(${tint},0.9)`);
+ g.addColorStop(1, `rgba(${tint},0)`);
+ ctx.beginPath();
+ ctx.arc(x, y, 6 * dpr, 0, Math.PI * 2);
+ ctx.fillStyle = g;
+ ctx.fill();
+ }
+ }
+ })();
+ </script>
+ </body>
+</html>
diff --git a/public/nav.css b/public/nav.css
index 22e3de4e3..cc3bd9ca3 100644
--- a/public/nav.css
+++ b/public/nav.css
@@ -454,6 +454,7 @@
border-radius: 9px;
color: rgba(255, 255, 255, 0.88);
text-decoration: none;
+ line-height: 1.3;
transition:
background 0.15s ease,
color 0.15s ease,