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: discover detail API, home-next overhaul, avatar SDK refactor, login + 404 pages, new modules

nirholase28476363b5a
diff --git a/api/discover-detail.js b/api/discover-detail.js
index ea969a77a..f6ab6a397 100644
--- a/api/discover-detail.js
+++ b/api/discover-detail.js
@@ -75,6 +75,44 @@ export default wrap(async (req, res) => {
canonicalUrl = `${origin}/discover/a/${chainId}/${id}`;
ogImageUrl = `${origin}/api/a-og?chain=${chainId}&id=${encodeURIComponent(id)}`;
}
+ } else if (kind === 'solana') {
+ const asset = url.searchParams.get('asset');
+ if (!asset) return sendShell(res, origin, null, null, null);
+
+ const rows = await sql`
+ SELECT ai.id, ai.name, ai.description, ai.wallet_address, ai.skills,
+ ai.meta, ai.created_at,
+ a.thumbnail_key AS avatar_thumb
+ FROM agent_identities ai
+ LEFT JOIN avatars a ON a.id = ai.avatar_id AND a.deleted_at IS NULL
+ WHERE ai.deleted_at IS NULL
+ AND ai.meta->>'chain_type' = 'solana'
+ AND ai.meta->>'sol_mint_address' = ${asset}
+ LIMIT 1
+ `.catch(() => []);
+
+ if (rows.length) {
+ const r = rows[0];
+ const network = r.meta?.network || 'mainnet';
+ const thumb = r.avatar_thumb ? publicUrl(r.avatar_thumb) : null;
+ item = {
+ kind: 'solana',
+ asset,
+ name: r.name || 'Solana Agent',
+ description: r.description || '',
+ image: thumb,
+ has3d: !!r.avatar_thumb,
+ skills: r.skills || [],
+ owner: r.wallet_address,
+ ownerShort: shortAddr(r.wallet_address),
+ createdAt: r.created_at,
+ network,
+ explorerUrl: `https://solscan.io/token/${asset}`,
+ ownerExplorerUrl: r.wallet_address ? `https://solscan.io/account/${r.wallet_address}` : null,
+ };
+ canonicalUrl = `${origin}/discover/a/sol/${asset}`;
+ ogImageUrl = thumb || `${origin}/og-image.png`;
+ }
} else if (kind === 'avatar') {
if (!id) return sendShell(res, origin, null, null, null);
diff --git a/api/explore-item.js b/api/explore-item.js
index 80bc86c4c..6f8fc63a9 100644
--- a/api/explore-item.js
+++ b/api/explore-item.js
@@ -1,9 +1,9 @@
/**
* GET /api/explore-item?kind=onchain&chain=<id>&id=<agentId>
* GET /api/explore-item?kind=avatar&id=<avatarId>
+ * GET /api/explore-item?kind=solana&id=<asset_pubkey>
*
- * Returns a single item (onchain agent or public avatar) in the same shape as
- * the /api/explore feed items.
+ * Returns a single item in the same shape as the /api/explore feed items.
*/
import { sql } from './_lib/db.js';
@@ -132,7 +132,45 @@ export default wrap(async (req, res) => {
return json(res, 200, { item });
}
- return error(res, 400, 'validation_error', 'kind must be onchain or avatar');
+ if (kind === 'solana') {
+ const rows = await sql`
+ SELECT ai.id, ai.name, ai.description, ai.wallet_address, ai.skills,
+ ai.meta, ai.created_at,
+ a.thumbnail_key AS avatar_thumb
+ FROM agent_identities ai
+ LEFT JOIN avatars a ON a.id = ai.avatar_id AND a.deleted_at IS NULL
+ WHERE ai.deleted_at IS NULL
+ AND ai.meta->>'chain_type' = 'solana'
+ AND ai.meta->>'sol_mint_address' = ${id}
+ LIMIT 1
+ `;
+
+ if (!rows.length) return error(res, 404, 'not_found', 'solana agent not found');
+
+ const r = rows[0];
+ const asset = r.meta?.sol_mint_address;
+ const network = r.meta?.network || 'mainnet';
+ const thumb = r.avatar_thumb ? publicUrl(r.avatar_thumb) : null;
+ const item = {
+ kind: 'solana',
+ asset,
+ name: r.name || 'Solana Agent',
+ description: r.description || '',
+ image: thumb,
+ has3d: !!r.avatar_thumb,
+ skills: r.skills || [],
+ owner: r.wallet_address,
+ ownerShort: shortAddr(r.wallet_address),
+ createdAt: r.created_at,
+ network,
+ explorerUrl: asset ? `https://solscan.io/token/${asset}` : null,
+ ownerExplorerUrl: r.wallet_address ? `https://solscan.io/account/${r.wallet_address}` : null,
+ };
+
+ return json(res, 200, { item });
+ }
+
+ return error(res, 400, 'validation_error', 'kind must be onchain, avatar, or solana');
});
function shortAddr(a) {
diff --git a/api/explore.js b/api/explore.js
index 3355b1605..adeb0cb5e 100644
--- a/api/explore.js
+++ b/api/explore.js
@@ -7,7 +7,7 @@
* q=<text> — name/description substring
* cursor=<iso> — created_at/registered_at ISO string for pagination
* limit=<int> — page size, default 24, max 60
- * source=<all|onchain|avatar> — restrict feed to one source. Default 'all'.
+ * source=<all|onchain|avatar|solana> — restrict feed to one source. Default 'all'.
* quality=<all|high> — avatar quality filter. 'high' (default) hides
* autonamed/filename-like junk and surfaces named
* community + curated avatars first.
@@ -53,8 +53,9 @@ export default wrap(async (req, res) => {
}
// Setting a chainId implicitly excludes avatars (they're off-chain).
- const includeOnchain = sourceFilter !== 'avatar';
- const includeAvatars = sourceFilter !== 'onchain' && !Number.isFinite(chainId);
+ const includeOnchain = sourceFilter === 'all' || sourceFilter === 'onchain';
+ const includeAvatars = (sourceFilter === 'all' || sourceFilter === 'avatar') && !Number.isFinite(chainId);
+ const includeSolana = sourceFilter === 'all' || sourceFilter === 'solana';
// Filter construction via template fragments kept inline because Neon's
// tagged-template driver doesn't compose them the way pg.Client does; a
@@ -107,6 +108,26 @@ export default wrap(async (req, res) => {
`
: [];
+ const solanaRows = includeSolana
+ ? await sql`
+ SELECT ai.id, ai.name, ai.description, ai.wallet_address, ai.skills,
+ ai.meta, ai.created_at,
+ a.thumbnail_key AS avatar_thumb
+ FROM agent_identities ai
+ LEFT JOIN avatars a ON a.id = ai.avatar_id AND a.deleted_at IS NULL
+ WHERE ai.deleted_at IS NULL
+ AND ai.meta->>'chain_type' = 'solana'
+ AND ai.meta->>'network' = 'mainnet'
+ AND (${q || null}::text IS NULL OR (
+ coalesce(ai.name,'') ILIKE ${'%' + q + '%'}
+ OR coalesce(ai.description,'') ILIKE ${'%' + q + '%'}
+ ))
+ AND (${cursorDate ? cursorDate.toISOString() : null}::timestamptz IS NULL OR ai.created_at < ${cursorDate ? cursorDate.toISOString() : null}::timestamptz)
+ ORDER BY ai.created_at DESC NULLS LAST
+ LIMIT ${limit + 1}
+ `
+ : [];
+
const onchainItems = onchainRows.map((r) => {
const chain = CHAIN_BY_ID[r.chain_id];
return {
@@ -136,6 +157,27 @@ export default wrap(async (req, res) => {
};
});
+ const solanaItems = solanaRows.map((r) => {
+ const asset = r.meta?.sol_mint_address;
+ const thumb = r.avatar_thumb ? publicUrl(r.avatar_thumb) : null;
+ return {
+ kind: 'solana',
+ sortDate: r.created_at,
+ asset,
+ name: r.name || 'Solana Agent',
+ description: r.description || '',
+ image: thumb,
+ has3d: !!r.avatar_thumb,
+ skills: r.skills || [],
+ owner: r.wallet_address,
+ ownerShort: shortAddr(r.wallet_address),
+ createdAt: r.created_at,
+ explorerUrl: asset ? `https://solscan.io/token/${asset}` : null,
+ ownerExplorerUrl: r.wallet_address ? `https://solscan.io/account/${r.wallet_address}` : null,
+ network: r.meta?.network || 'mainnet',
+ };
+ });
+
let avatarItems = avatarRows.map((r) => {
const glb = publicUrl(r.storage_key);
const handle = r.owner_username
@@ -202,7 +244,7 @@ export default wrap(async (req, res) => {
avatarItems.push(...matching);
}
- const merged = [...onchainItems, ...avatarItems].sort(
+ const merged = [...onchainItems, ...solanaItems, ...avatarItems].sort(
(a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime(),
);
@@ -210,7 +252,6 @@ export default wrap(async (req, res) => {
const items = merged.slice(0, limit);
const nextCursor = hasMore && items.length > 0 ? items[items.length - 1].sortDate : null;
- // Totals (cheap counts; merged feed total = onchain + public avatars).
const [{ total: onchainTotal }] = await sql`
SELECT count(*)::text as total FROM erc8004_agents_index WHERE active = true
`;
@@ -220,8 +261,13 @@ export default wrap(async (req, res) => {
const [{ total: avatarTotal }] = await sql`
SELECT count(*)::text as total FROM avatars WHERE deleted_at IS NULL AND visibility = 'public'
`;
+ const [{ total: solanaTotal }] = await sql`
+ SELECT count(*)::text as total FROM agent_identities
+ WHERE deleted_at IS NULL AND meta->>'chain_type' = 'solana' AND meta->>'network' = 'mainnet'
+ `;
const avatarCount = Number(avatarTotal) + DEMO_AVATARS.length;
- const allTotal = Number(onchainTotal) + avatarCount;
+ const solCount = Number(solanaTotal);
+ const allTotal = Number(onchainTotal) + solCount + avatarCount;
const threeDTotal = Number(onchain3d) + avatarCount;
return json(res, 200, {
@@ -231,6 +277,7 @@ export default wrap(async (req, res) => {
all: allTotal,
threeD: threeDTotal,
onchain: Number(onchainTotal),
+ solana: solCount,
avatars: avatarCount,
},
});
diff --git a/pages/avatar-sdk.html b/pages/avatar-sdk.html
index cbb7d7b2b..dee831546 100644
--- a/pages/avatar-sdk.html
+++ b/pages/avatar-sdk.html
@@ -31,812 +31,8 @@
<link rel="stylesheet" href="/footer.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
<link rel="stylesheet" href="/mobile.css" />
+ <link rel="stylesheet" href="/avatar-sdk.css" />
<script defer src="/footer-newsletter.js"></script>
-
- <style>
- :root {
- --sdk-bg: #000000;
- --sdk-surface: #0a0a0a;
- --sdk-card: #111111;
- --sdk-border: rgba(255, 255, 255, 0.08);
- --sdk-border-hi: rgba(255, 255, 255, 0.15);
- --sdk-accent: #ffffff;
- --sdk-accent2: #ffffff;
- --sdk-cyan: #ffffff;
- --sdk-text: #e8e8e8;
- --sdk-muted: #888888;
- --sdk-dim: #555555;
- --sdk-code-bg: #0a0a0a;
- --sdk-pill-bg: rgba(255, 255, 255, 0.08);
- --sdk-pill-border: rgba(255, 255, 255, 0.15);
- --sdk-success: #e8e8e8;
- --sdk-error: #f87171;
- --sdk-radius: 14px;
- --sdk-radius-sm: 8px;
- --sdk-max: 1080px;
- }
-
- html, body {
- margin: 0;
- background: var(--sdk-bg);
- color: var(--sdk-text);
- -webkit-font-smoothing: antialiased;
- }
- body {
- display: flex;
- flex-direction: column;
- min-height: 100vh;
- font-family: 'Inter', system-ui, sans-serif;
- }
-
- /* ── Layout ─────────────────────────────────────────────────── */
- .sdk-wrap {
- max-width: var(--sdk-max);
- margin: 0 auto;
- padding: 0 24px;
- width: 100%;
- box-sizing: border-box;
- }
-
- /* ── Hero ───────────────────────────────────────────────────── */
- .sdk-hero {
- position: relative;
- overflow: hidden;
- padding: 100px 0 0;
- min-height: 680px;
- display: flex;
- align-items: flex-start;
- }
- .sdk-hero-bg {
- position: absolute;
- inset: 0;
- pointer-events: none;
- }
- .sdk-hero-bg-orb {
- position: absolute;
- border-radius: 50%;
- filter: blur(90px);
- opacity: 0.4;
- }
- .sdk-hero-bg-orb.a {
- width: 560px; height: 560px;
- top: -120px; left: -80px;
- background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
- }
- .sdk-hero-bg-orb.b {
- width: 420px; height: 420px;
- top: 60px; right: -60px;
- background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
- }
- .sdk-hero-bg-orb.c {
- width: 300px; height: 300px;
- bottom: 0; left: 40%;
- background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
- }
- .sdk-hero-grid {
- position: absolute;
- inset: 0;
- background-image:
- linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
- linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
- background-size: 48px 48px;
- mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 65%, transparent 100%);
- -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 65%, transparent 100%);
- }
-
- .sdk-hero-inner {
- position: relative;
- z-index: 1;
- display: grid;
- grid-template-columns: 1fr 480px;
- gap: 48px;
- align-items: center;
- padding-bottom: 80px;
- width: 100%;
- }
- .sdk-hero-copy {
- padding-top: 16px;
- }
- .sdk-hero-badge {
- display: inline-flex;
- align-items: center;
- gap: 6px;
- background: var(--sdk-pill-bg);
- border: 1px solid var(--sdk-pill-border);
- border-radius: 100px;
- padding: 5px 12px 5px 8px;
- font-size: 12px;
- font-weight: 600;
- letter-spacing: 0.04em;
- color: #e8e8e8;
- text-transform: uppercase;
- margin-bottom: 20px;
- }
- .sdk-hero-badge-dot {
- width: 6px; height: 6px;
- border-radius: 50%;
- background: #ffffff;
- box-shadow: 0 0 8px #ffffff;
- animation: sdk-dot-pulse 2.4s ease-in-out infinite;
- }
- @keyframes sdk-dot-pulse {
- 0%,100% { box-shadow: 0 0 6px rgba(255,255,255,0.7); }
- 50% { box-shadow: 0 0 14px rgba(255,255,255,1); }
- }
- .sdk-hero-h1 {
- font-family: 'Space Grotesk', 'Inter', sans-serif;
- font-size: clamp(36px, 5vw, 58px);
- font-weight: 700;
- letter-spacing: -0.025em;
- line-height: 1.08;
- margin: 0 0 16px;
- background: linear-gradient(135deg, #ffffff 0%, #cccccc 45%, #ffffff 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- background-clip: text;
- }
- .sdk-hero-sub {
- font-size: 18px;
- line-height: 1.6;
- color: var(--sdk-muted);
- max-width: 52ch;
- margin: 0 0 32px;
- }
- .sdk-hero-sub strong { color: var(--sdk-text); font-weight: 500; }
-
- /* Install command */
- .sdk-install-row {
- display: flex;
- align-items: center;
- gap: 10px;
- flex-wrap: wrap;
- margin-bottom: 32px;
- }
- .sdk-install-cmd {
- display: flex;
- align-items: center;
- gap: 10px;
- background: var(--sdk-code-bg);
- border: 1px solid var(--sdk-border-hi);
- border-radius: var(--sdk-radius-sm);
- padding: 11px 16px;
- font-family: 'JetBrains Mono', ui-monospace, monospace;
- font-size: 14px;
- color: #e8e8e8;
- cursor: pointer;
- transition: border-color 0.15s, box-shadow 0.15s;
- flex: 1;
- min-width: 0;
- }
- .sdk-install-cmd:hover {
- border-color: rgba(255,255,255,0.3);
- box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
- }
- .sdk-install-cmd .prompt { color: var(--sdk-dim); user-select: none; flex-shrink: 0; }
- .sdk-install-cmd .cmd-text { color: #e2e8f0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
- .sdk-install-copy {
- background: none;
- border: none;
- color: var(--sdk-dim);
- cursor: pointer;
- padding: 2px 4px;
- font-family: inherit;
- font-size: 11px;
- transition: color 0.15s;
- flex-shrink: 0;
- }
- .sdk-install-copy:hover { color: var(--sdk-text); }
- .sdk-install-copy.copied { color: var(--sdk-success); }
-
- .sdk-hero-ctas {
- display: flex;
- gap: 12px;
- flex-wrap: wrap;
- }
- .sdk-btn-primary {
- display: inline-flex;
- align-items: center;
- gap: 7px;
- background: #ffffff;
- color: #000000;
- border: none;
- border-radius: var(--sdk-radius-sm);
- padding: 12px 22px;
- font: 600 15px/1 'Inter', sans-serif;
- cursor: pointer;
- text-decoration: none;
- transition: opacity 0.15s, transform 0.1s;
- box-shadow: 0 4px 20px rgba(255,255,255,0.15);
- }
- .sdk-btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
- .sdk-btn-ghost {
- display: inline-flex;
- align-items: center;
- gap: 7px;
- background: transparent;
- color: var(--sdk-muted);
- border: 1px solid rgba(255,255,255,0.12);
- border-radius: var(--sdk-radius-sm);
- padding: 12px 22px;
- font: 600 15px/1 'Inter', sans-serif;
- cursor: pointer;
- text-decoration: none;
- transition: color 0.15s, border-color 0.15s;
- }
- .sdk-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.28); }
-
- /* Hero 3D viewer */
- .sdk-hero-viewer {
- position: relative;
- }
- .sdk-hero-viewer-frame {
- position: relative;
- border-radius: 20px;
- overflow: hidden;
- background: var(--sdk-card);
- border: 1.5px solid var(--sdk-border-hi);
- box-shadow:
- 0 0 0 1px rgba(255,255,255,0.04) inset,
- 0 24px 80px -24px rgba(0,0,0,0.8),
- 0 0 60px -10px rgba(255,255,255,0.05);
- aspect-ratio: 9 / 10;
- max-height: 500px;
- }
- .sdk-hero-viewer-frame three-ws-viewer {
- display: block;
- width: 100%;
- height: 100%;
- }
- .sdk-viewer-badge {
- position: absolute;
- bottom: 14px;
- left: 50%;
- transform: translateX(-50%);
- background: rgba(3,3,7,0.82);
- backdrop-filter: blur(10px);
- border: 1px solid var(--sdk-border);
- border-radius: 100px;
- padding: 5px 12px;
- font-size: 11px;
- color: var(--sdk-muted);
- white-space: nowrap;
- pointer-events: none;
- }
- .sdk-viewer-badge code {
- color: #e8e8e8;
- font-family: ui-monospace, monospace;
- font-size: 11px;
- }
- .sdk-hero-viewer-glow {
- position: absolute;
- inset: -40px;
- background: radial-gradient(ellipse at 50% 60%, rgba(255,255,255,0.05) 0%, transparent 65%);
- pointer-events: none;
- z-index: -1;
- }
-
- /* Scroll hint */
- .sdk-hero-scroll {
- position: absolute;
- bottom: 20px;
- left: 50%;
- transform: translateX(-50%);
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 6px;
- color: var(--sdk-dim);
- font-size: 11px;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- z-index: 2;
- }
- .sdk-hero-scroll-line {
- width: 1px;
- height: 40px;
- background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
- animation: sdk-scroll-line 2s ease-in-out infinite;
- }
- @keyframes sdk-scroll-line {
- 0%,100% { opacity: 0.4; transform: scaleY(0.8); }
- 50% { opacity: 1; transform: scaleY(1); }
- }
-
- /* ── Section headings ───────────────────────────────────────── */
- .sdk-section {
- padding: 80px 0;
- border-top: 1px solid rgba(255,255,255,0.05);
- }
- .sdk-section:first-of-type { border-top: none; }
- .sdk-section-label {
- display: inline-flex;
- align-items: center;
- gap: 8px;
- font-size: 11px;
- font-weight: 700;
- letter-spacing: 0.1em;
- text-transform: uppercase;
- color: var(--sdk-accent);
- margin-bottom: 12px;
- }
- .sdk-section-label::before {
- content: '';
- display: block;
- width: 20px;
- height: 1.5px;
- background: var(--sdk-accent);
- }
- .sdk-h2 {
- font-family: 'Space Grotesk', 'Inter', sans-serif;
- font-size: clamp(24px, 3.5vw, 36px);
- font-weight: 700;
- letter-spacing: -0.02em;
- margin: 0 0 12px;
- color: var(--sdk-text);
- }
- .sdk-lead {
- font-size: 17px;
- line-height: 1.65;
- color: var(--sdk-muted);
- max-width: 58ch;
- margin: 0 0 48px;
- }
-
- /* ── Feature grid ───────────────────────────────────────────── */
- .sdk-feature-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
- gap: 16px;
- }
- .sdk-feat-card {
- background: var(--sdk-card);
- border: 1.5px solid var(--sdk-border);
- border-radius: var(--sdk-radius);
- padding: 24px;
- transition: border-color 0.2s, box-shadow 0.2s;
- position: relative;
- overflow: hidden;
- }
- .sdk-feat-card::before {
- content: '';
- position: absolute;
- top: 0; left: 0; right: 0;
- height: 2px;
- background: linear-gradient(90deg, transparent, var(--card-accent, #ffffff), transparent);
- opacity: 0;
- transition: opacity 0.25s;
- }
- .sdk-feat-card:hover {
- border-color: var(--sdk-border-hi);
- box-shadow: 0 8px 40px -12px rgba(0,0,0,0.6), 0 0 0 1px var(--sdk-border-hi);
- }
- .sdk-feat-card:hover::before { opacity: 1; }
- .sdk-feat-icon {
- width: 40px; height: 40px;
- border-radius: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 16px;
- font-size: 20px;
- background: var(--icon-bg, rgba(255,255,255,0.15));
- border: 1px solid var(--icon-border, rgba(255,255,255,0.25));
- }
- .sdk-feat-title {
- font-family: 'Space Grotesk', sans-serif;
- font-size: 16px;
- font-weight: 600;
- color: var(--sdk-text);
- margin: 0 0 8px;
- }
- .sdk-feat-desc {
- font-size: 13.5px;
- line-height: 1.6;
- color: var(--sdk-muted);
- margin: 0;
- }
- .sdk-feat-tag {
- display: inline-block;
- margin-top: 12px;
- background: rgba(255,255,255,0.05);
- border: 1px solid rgba(255,255,255,0.08);
- border-radius: 4px;
- padding: 2px 7px;
- font-family: ui-monospace, monospace;
- font-size: 11px;
- color: var(--sdk-muted);
- }
-
- /* ── Code blocks ────────────────────────────────────────────── */
- .sdk-code-section {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 40px;
- align-items: start;
- }
- .sdk-code-section.full { grid-template-columns: 1fr; }
- .sdk-code-section.reversed { direction: rtl; }
- .sdk-code-section.reversed > * { direction: ltr; }
-
- .sdk-code-copy {
- position: relative;
- }
- .sdk-code-label {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 8px;
- }
- .sdk-code-filename {
- font-size: 12px;
- font-weight: 600;
- color: var(--sdk-muted);
- font-family: ui-monospace, monospace;
- letter-spacing: 0.03em;
- }
- .sdk-copy-btn {
- background: rgba(255,255,255,0.05);
- border: 1px solid rgba(255,255,255,0.08);
- border-radius: 5px;
- color: var(--sdk-muted);
- cursor: pointer;
- font: 11px/1 'Inter', sans-serif;
- padding: 4px 10px;
- transition: color 0.15s, border-color 0.15s, background 0.15s;
- }
- .sdk-copy-btn:hover {
- color: var(--sdk-text);
- border-color: rgba(255,255,255,0.18);
- background: rgba(255,255,255,0.08);
- }
- .sdk-copy-btn.copied {
- color: var(--sdk-success);
- border-color: rgba(255,255,255,0.3);
- }
- pre.sdk-pre {
- margin: 0;
- background: var(--sdk-code-bg);
- border: 1px solid var(--sdk-border);
- border-radius: var(--sdk-radius-sm);
- padding: 18px 20px;
- overflow-x: auto;
- font-family: 'JetBrains Mono', ui-monospace, monospace;
- font-size: 13px;
- line-height: 1.75;
- color: #e2e8f0;
- tab-size: 2;
- }
- pre.sdk-pre .t-kw { color: #e8e8e8; }
- pre.sdk-pre .t-str { color: #e8e8e8; }
- pre.sdk-pre .t-tag { color: #ffffff; }
- pre.sdk-pre .t-attr { color: #e8e8e8; }
- pre.sdk-pre .t-cmt { color: #475569; font-style: italic; }
- pre.sdk-pre .t-fn { color: #e8e8e8; }
- pre.sdk-pre .t-num { color: #e8e8e8; }
- pre.sdk-pre .t-op { color: #94a3b8; }
-
- /* ── Tabs ───────────────────────────────────────────────────── */
- .sdk-tabs { }
- .sdk-tab-list {
- display: flex;
- gap: 2px;
- margin-bottom: 0;
- background: var(--sdk-code-bg);
- border: 1px solid var(--sdk-border);
- border-bottom: none;
- border-radius: var(--sdk-radius-sm) var(--sdk-radius-sm) 0 0;
- padding: 6px 6px 0;
- overflow-x: auto;
- }
- .sdk-tab-btn {
- background: none;
- border: none;
- color: var(--sdk-dim);
- cursor: pointer;
- font: 12px/1.4 'Inter', sans-serif;
- padding: 7px 14px 9px;
- border-radius: 5px 5px 0 0;
- transition: color 0.15s, background 0.15s;
- white-space: nowrap;
- position: relative;
- }
- .sdk-tab-btn:hover { color: var(--sdk-muted); }
- .sdk-tab-btn.active {
- color: var(--sdk-text);
- background: rgba(255,255,255,0.12);
- }
- .sdk-tab-btn.active::after {
- content: '';
- position: absolute;
- bottom: -1px; left: 0; right: 0;
- height: 2px;
- background: var(--sdk-accent);
- border-radius: 2px 2px 0 0;
- }
- .sdk-tab-panel pre.sdk-pre {
- border-radius: 0 var(--sdk-radius-sm) var(--sdk-radius-sm) var(--sdk-radius-sm);
- }
- .sdk-tab-panel[hidden] { display: none; }
-
- /* ── Copy row on tabs ───────────────────────────────────────── */
- .sdk-tab-copy-row {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- padding: 6px 12px 0;
- background: var(--sdk-code-bg);
- border-left: 1px solid var(--sdk-border);
- border-right: 1px solid var(--sdk-border);
- }
-
- /* ── Quick-start steps ──────────────────────────────────────── */
- .sdk-steps {
- display: flex;
- flex-direction: column;
- gap: 40px;
- }
- .sdk-step {
- display: grid;
- grid-template-columns: 40px 1fr;
- gap: 20px;
- }
- .sdk-step-num {
- width: 40px; height: 40px;
- border-radius: 50%;
- background: var(--sdk-pill-bg);
- border: 1.5px solid var(--sdk-pill-border);
- display: flex;
- align-items: center;
- justify-content: center;
- font-family: 'Space Grotesk', sans-serif;
- font-size: 16px;
- font-weight: 700;
- color: #e8e8e8;
- flex-shrink: 0;
- margin-top: 2px;
- }
- .sdk-step-body {}
- .sdk-step-title {
- font-family: 'Space Grotesk', sans-serif;
- font-size: 18px;
- font-weight: 600;
- color: var(--sdk-text);
- margin: 0 0 6px;
- }
- .sdk-step-desc {
- font-size: 14px;
- line-height: 1.65;
- color: var(--sdk-muted);
- margin: 0 0 14px;
- }
- .sdk-step-desc a { color: #e8e8e8; text-decoration: none; }
- .sdk-step-desc a:hover { text-decoration: underline; }
-
- /* ── Creator live demo ──────────────────────────────────────── */
- .sdk-creator-demo-card {
- background: var(--sdk-card);
- border: 1.5px solid var(--sdk-border);
- border-radius: var(--sdk-radius);
- padding: 32px;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
- .sdk-creator-desc {
- font-size: 14px;
- line-height: 1.65;
- color: var(--sdk-muted);
- margin: 0;
- }
- .sdk-creator-status {
- font-size: 13px;
- font-family: ui-monospace, monospace;
- padding: 8px 14px;
- border-radius: 6px;
- background: rgba(255,255,255,0.04);
- color: var(--sdk-dim);
- min-height: 34px;
- width: 100%;
- box-sizing: border-box;
- display: none;
- }
- .sdk-creator-status.info { display: block; color: #ffffff; background: rgba(255,255,255,0.06); }
- .sdk-creator-status.ok { display: block; color: var(--sdk-success); background: rgba(255,255,255,0.07); }
- .sdk-creator-status.err { display: block; color: var(--sdk-error); background: rgba(248,113,113,0.07); }
- .sdk-creator-status.muted { display: block; color: var(--sdk-dim); }
-
- /* ── Comparison table ───────────────────────────────────────── */
- .sdk-table-wrap {
- overflow-x: auto;
- border-radius: var(--sdk-radius);
- border: 1.5px solid var(--sdk-border);
- }
- table.sdk-table {
- width: 100%;
- border-collapse: collapse;
- background: var(--sdk-card);
- font-size: 14px;
- }
- .sdk-table th {
- background: rgba(255,255,255,0.08);
- padding: 14px 18px;
- text-align: left;
- font-family: 'Space Grotesk', sans-serif;
- font-size: 13px;
- font-weight: 600;
- color: var(--sdk-text);
- letter-spacing: 0.01em;
- border-bottom: 1px solid var(--sdk-border);
- }
- .sdk-table th:first-child { border-radius: var(--sdk-radius-sm) 0 0 0; }
- .sdk-table th:last-child { border-radius: 0 var(--sdk-radius-sm) 0 0; }
- .sdk-table td {
- padding: 13px 18px;
- color: var(--sdk-muted);
- border-bottom: 1px solid rgba(255,255,255,0.04);
- vertical-align: top;
- }
- .sdk-table tr:last-child td { border-bottom: none; }
- .sdk-table tr:hover td { background: rgba(255,255,255,0.04); }
- .sdk-table td:first-child { color: var(--sdk-text); font-weight: 500; }
- .sdk-table .check { color: var(--sdk-success); font-weight: 700; }
- .sdk-table .cross { color: #f87171; }
- .sdk-table .col-three { color: #e8e8e8; }
-
- /* ── API reference cards ────────────────────────────────────── */
- .sdk-api-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
- gap: 16px;
- }
- .sdk-api-card {
- background: var(--sdk-card);
- border: 1.5px solid var(--sdk-border);
- border-radius: var(--sdk-radius);
- overflow: hidden;
- }
- .sdk-api-card-head {
- background: rgba(255,255,255,0.07);
- border-bottom: 1px solid var(--sdk-border);
- padding: 14px 18px;
- display: flex;
- align-items: center;
- gap: 10px;
- }
- .sdk-api-export-badge {
- font-size: 10px;
- font-weight: 700;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- background: rgba(255,255,255,0.2);
- border: 1px solid rgba(255,255,255,0.35);
- color: #e8e8e8;
- padding: 2px 7px;
- border-radius: 4px;
- }
- .sdk-api-name {
- font-family: ui-monospace, monospace;
- font-size: 14px;
- font-weight: 600;
- color: var(--sdk-text);
- }
- .sdk-api-card-body {
- padding: 16px 18px;
- }
- .sdk-api-desc {
- font-size: 13.5px;
- line-height: 1.6;
- color: var(--sdk-muted);
- margin: 0 0 14px;
- }
- .sdk-api-props {
- list-style: none;
- margin: 0;
- padding: 0;
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .sdk-api-props li {
- display: grid;
- grid-template-columns: auto 1fr;
- gap: 8px;
- align-items: baseline;
- }
- .sdk-api-prop-name {
- font-family: ui-monospace, monospace;
- font-size: 12px;
- color: #e8e8e8;
- white-space: nowrap;
- }
- .sdk-api-prop-desc {
- font-size: 12.5px;
- color: var(--sdk-dim);
- line-height: 1.5;
- }
-
- /* ── CTA banner ─────────────────────────────────────────────── */
- .sdk-cta-banner {
- border-radius: var(--sdk-radius);
- background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 100%);
- border: 1.5px solid rgba(255,255,255,0.3);
- padding: 48px 40px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 32px;
- position: relative;
- overflow: hidden;
- }
- .sdk-cta-banner::before {
- content: '';
- position: absolute;
- inset: 0;
- background: radial-gradient(ellipse at 80% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
- pointer-events: none;
- }
- .sdk-cta-banner-copy {}
- .sdk-cta-banner h2 {
- font-family: 'Space Grotesk', sans-serif;
- font-size: 26px;
- font-weight: 700;
- letter-spacing: -0.02em;
- margin: 0 0 8px;
- color: var(--sdk-text);
- }
- .sdk-cta-banner p {
- font-size: 15px;
- color: var(--sdk-muted);
- margin: 0;
- max-width: 46ch;
- }
- .sdk-cta-banner-actions {
- display: flex;
- gap: 12px;
- flex-shrink: 0;
- flex-wrap: wrap;
- }
-
- /* ── Mobile ─────────────────────────────────────────────────── */
- @media (max-width: 900px) {
- .sdk-hero { padding: 72px 0 0; min-height: auto; }
- .sdk-hero-inner {
- grid-template-columns: 1fr;
- gap: 32px;
- padding-bottom: 48px;
- }
- .sdk-hero-viewer { order: -1; }
- .sdk-hero-viewer-frame {
- aspect-ratio: 16 / 9;
- max-height: 280px;
- }
- .sdk-hero-scroll { display: none; }
- .sdk-code-section {
- grid-template-columns: 1fr;
- gap: 24px;
- }
- .sdk-code-section.reversed { direction: ltr; }
- .sdk-cta-banner {
- flex-direction: column;
- padding: 32px 24px;
- text-align: center;
- }
- .sdk-cta-banner p { margin: 0 auto; }
- .sdk-cta-banner-actions { justify-content: center; }
- }
- @media (max-width: 600px) {
- .sdk-hero-h1 { font-size: 32px; }
- .sdk-hero-sub { font-size: 16px; }
- .sdk-section { padding: 56px 0; }
- .sdk-h2 { font-size: 24px; }
- .sdk-feature-grid { grid-template-columns: 1fr; }
- .sdk-api-grid { grid-template-columns: 1fr; }
- .sdk-step { grid-template-columns: 32px 1fr; gap: 14px; }
- .sdk-step-num { width: 32px; height: 32px; font-size: 14px; }
- pre.sdk-pre { font-size: 11.5px; padding: 14px; }
- }
- </style>
</head>
<body>
<header>
@@ -875,7 +71,7 @@
npm · @three-ws/avatar
</div>
<h1 class="sdk-hero-h1" id="sdk-hero-title">
- The 3D Avatar SDK<br />your app deserves.
+ The 3D Avatar SDK<br />your app <em>deserves</em>.
</h1>
<p class="sdk-hero-sub">
Drop-in <strong>web component</strong>, React bindings, iframe creator, and cloud upload — the complete <strong>Ready Player Me replacement</strong>, open and self-hostable.
@@ -888,8 +84,6 @@
tabindex="0"
title="Click to copy"
aria-label="Copy install command"
- onclick="this.querySelector('.sdk-install-copy').click()"
- onkeydown="if(event.key==='Enter'||event.key===' ')this.querySelector('.sdk-install-copy').click()"
>
<span class="prompt" aria-hidden="true">$</span>
<span class="cmd-text" id="install-cmd">npm install @three-ws/avatar three</span>
@@ -902,11 +96,33 @@
Quick start
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true"><path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
+ <a href="#playground" class="sdk-btn-ghost">
+ Try playground
+ </a>
<a href="https://github.com/nirholas/three.ws/tree/main/avatar-sdk" class="sdk-btn-ghost" target="_blank" rel="noopener">
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path 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 0016 8c0-4.42-3.58-8-8-8z"/></svg>
GitHub
</a>
</div>
+
+ <div class="sdk-stats sdk-reveal">
+ <div class="sdk-stat">
+ <span class="sdk-stat-value">&lt;50<span class="sdk-stat-unit">KB</span></span>
+ <span class="sdk-stat-label">Viewer gzipped</span>
+ </div>
+ <div class="sdk-stat">
+ <span class="sdk-stat-value">0<span class="sdk-stat-unit"> deps</span></span>
+ <span class="sdk-stat-label">Beyond Three.js</span>
+ </div>
+ <div class="sdk-stat">
+ <span class="sdk-stat-value">50+</span>
+ <span class="sdk-stat-label">Mixamo animations</span>
+ </div>
+ <div class="sdk-stat">
+ <span class="sdk-stat-value">2<span class="sdk-stat-unit"> lines</span></span>
+ <span class="sdk-stat-label">To render an avatar</span>
+ </div>
+ </div>
</div>
<div class="sdk-hero-viewer" aria-label="Live 3D avatar demo">
@@ -933,41 +149,41 @@
<!-- ── Features ──────────────────────────────────────────────── -->
<section class="sdk-section" aria-labelledby="sdk-feat-title">
<div class="sdk-wrap">
- <div class="sdk-section-label" aria-hidden="true">Capabilities</div>
- <h2 class="sdk-h2" id="sdk-feat-title">Everything in one package</h2>
- <p class="sdk-lead">Four building blocks — use what you need, tree-shake the rest.</p>
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">Capabilities</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-feat-title">Everything in one package</h2>
+ <p class="sdk-lead sdk-reveal">Four building blocks — use what you need, tree-shake the rest.</p>
<div class="sdk-feature-grid">
- <div class="sdk-feat-card" style="--card-accent:#ffffff">
- <div class="sdk-feat-icon" style="--icon-bg:rgba(255,255,255,0.15);--icon-border:rgba(255,255,255,0.25)">
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><rect x="2" y="2" width="16" height="16" rx="3" stroke="#e8e8e8" stroke-width="1.5"/><path d="M2 7h16" stroke="#e8e8e8" stroke-width="1.5"/><circle cx="5" cy="4.5" r="1" fill="#e8e8e8"/><circle cx="8" cy="4.5" r="1" fill="#e8e8e8"/></svg>
+ <div class="sdk-feat-card sdk-reveal sdk-reveal-delay-1" style="--card-accent:#a78bfa;--icon-bg:rgba(167,139,250,0.1);--icon-border:rgba(167,139,250,0.2)">
+ <div class="sdk-feat-icon">
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><rect x="2" y="2" width="16" height="16" rx="3" stroke="#a78bfa" stroke-width="1.5"/><path d="M2 7h16" stroke="#a78bfa" stroke-width="1.5"/><circle cx="5" cy="4.5" r="1" fill="#a78bfa"/><circle cx="8" cy="4.5" r="1" fill="#a78bfa"/></svg>
</div>
<p class="sdk-feat-title">Web Component</p>
<p class="sdk-feat-desc">Drop <code>&lt;agent-3d&gt;</code> or the lightweight <code>&lt;three-ws-viewer&gt;</code> into any HTML page or framework. Self-registers on import.</p>
<span class="sdk-feat-tag">framework-agnostic</span>
</div>
- <div class="sdk-feat-card" style="--card-accent:#ffffff">
- <div class="sdk-feat-icon" style="--icon-bg:rgba(255,255,255,0.15);--icon-border:rgba(255,255,255,0.25)">
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><circle cx="10" cy="10" r="3" stroke="#e8e8e8" stroke-width="1.5"/><path d="M10 3v2M10 15v2M3 10h2M15 10h2" stroke="#e8e8e8" stroke-width="1.5" stroke-linecap="round"/><path d="M5.64 5.64l1.42 1.42M12.94 12.94l1.42 1.42M5.64 14.36l1.42-1.42M12.94 7.06l1.42-1.42" stroke="#e8e8e8" stroke-width="1.3" stroke-linecap="round"/></svg>
+ <div class="sdk-feat-card sdk-reveal sdk-reveal-delay-2" style="--card-accent:#818cf8;--icon-bg:rgba(129,140,248,0.1);--icon-border:rgba(129,140,248,0.2)">
+ <div class="sdk-feat-icon">
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><circle cx="10" cy="10" r="3" stroke="#818cf8" stroke-width="1.5"/><path d="M10 3v2M10 15v2M3 10h2M15 10h2" stroke="#818cf8" stroke-width="1.5" stroke-linecap="round"/><path d="M5.64 5.64l1.42 1.42M12.94 12.94l1.42 1.42M5.64 14.36l1.42-1.42M12.94 7.06l1.42-1.42" stroke="#818cf8" stroke-width="1.3" stroke-linecap="round"/></svg>
</div>
<p class="sdk-feat-title">React Bindings</p>
<p class="sdk-feat-desc">First-class React 18+ components — <code>&lt;Avatar&gt;</code>, <code>&lt;AgentAvatar&gt;</code>, <code>&lt;AvatarCreator&gt;</code> and a <code>useAvatar(id)</code> hook.</p>
<span class="sdk-feat-tag">@three-ws/avatar/react</span>
</div>
- <div class="sdk-feat-card" style="--card-accent:#ffffff">
- <div class="sdk-feat-icon" style="--icon-bg:rgba(255,255,255,0.12);--icon-border:rgba(255,255,255,0.22)">
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><rect x="3" y="3" width="14" height="14" rx="2.5" stroke="#e8e8e8" stroke-width="1.5"/><path d="M8 3v14" stroke="#e8e8e8" stroke-width="1.3" stroke-dasharray="2 2"/><path d="M13 8l-3 4-2-2" stroke="#e8e8e8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
+ <div class="sdk-feat-card sdk-reveal sdk-reveal-delay-3" style="--card-accent:#67e8f9;--icon-bg:rgba(103,232,249,0.1);--icon-border:rgba(103,232,249,0.2)">
+ <div class="sdk-feat-icon">
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><rect x="3" y="3" width="14" height="14" rx="2.5" stroke="#67e8f9" stroke-width="1.5"/><path d="M8 3v14" stroke="#67e8f9" stroke-width="1.3" stroke-dasharray="2 2"/><path d="M13 8l-3 4-2-2" stroke="#67e8f9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
</div>
<p class="sdk-feat-title">Creator Iframe</p>
<p class="sdk-feat-desc">Open the three.ws Avatar Studio or Avaturn in a modal. Resolves with a GLB Blob via postMessage — no polling, no storage tokens required.</p>
<span class="sdk-feat-tag">AvatarCreator class</span>
</div>
- <div class="sdk-feat-card" style="--card-accent:#e8e8e8">
- <div class="sdk-feat-icon" style="--icon-bg:rgba(255,255,255,0.12);--icon-border:rgba(255,255,255,0.22)">
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M10 3v10M10 3l-3 3M10 3l3 3" stroke="#e8e8e8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 13v3a1 1 0 001 1h10a1 1 0 001-1v-3" stroke="#e8e8e8" stroke-width="1.5" stroke-linecap="round"/></svg>
+ <div class="sdk-feat-card sdk-reveal sdk-reveal-delay-4" style="--card-accent:#4ade80;--icon-bg:rgba(74,222,128,0.1);--icon-border:rgba(74,222,128,0.2)">
+ <div class="sdk-feat-icon">
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M10 3v10M10 3l-3 3M10 3l3 3" stroke="#4ade80" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 13v3a1 1 0 001 1h10a1 1 0 001-1v-3" stroke="#4ade80" stroke-width="1.5" stroke-linecap="round"/></svg>
</div>
<p class="sdk-feat-title">Cloud Upload</p>
<p class="sdk-feat-desc">One-call <code>saveBlob()</code> presigns to R2, uploads, registers the avatar, auto-generates USDZ for iOS and a half-body variant for VR.</p>
@@ -977,16 +193,79 @@
</div>
</section>
+ <!-- ── Interactive Playground ─────────────────────────────────── -->
+ <section class="sdk-section" id="playground" aria-labelledby="sdk-pg-title">
+ <div class="sdk-wrap">
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">Playground</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-pg-title">Try it live</h2>
+ <p class="sdk-lead sdk-reveal">Configure the viewer, see the result in real time, copy the code.</p>
+
+ <div class="sdk-playground sdk-reveal" id="sdk-playground">
+ <div class="sdk-playground-layout">
+ <div class="sdk-playground-stage">
+ <span class="sdk-playground-stage-label">Preview</span>
+ <three-ws-viewer
+ id="pg-viewer"
+ src="/avatars/default.glb"
+ background="#09090b"
+ alt="Playground avatar preview"
+ style="width:100%;height:100%"
+ ></three-ws-viewer>
+ </div>
+ <div class="sdk-playground-controls">
+ <div class="sdk-playground-header">
+ <span class="sdk-playground-header-title">Configuration</span>
+ <button class="sdk-copy-btn" id="pg-copy-btn">Copy code</button>
+ </div>
+ <div class="sdk-playground-config">
+ <div class="sdk-pg-field">
+ <label for="pg-avatar">Avatar</label>
+ <select id="pg-avatar">
+ <option value="/avatars/default.glb">Default avatar</option>
+ <option value="/avatars/cz.glb">CZ avatar</option>
+ </select>
+ </div>
+ <div class="sdk-pg-field">
+ <label for="pg-bg">Background</label>
+ <select id="pg-bg">
+ <option value="#09090b">Dark (#09090b)</option>
+ <option value="#1a1a2e">Navy (#1a1a2e)</option>
+ <option value="#0f172a">Slate (#0f172a)</option>
+ <option value="transparent">Transparent</option>
+ <option value="#ffffff">White (#ffffff)</option>
+ </select>
+ </div>
+ <div class="sdk-pg-field">
+ <label for="pg-component">Component</label>
+ <select id="pg-component">
+ <option value="three-ws-viewer">three-ws-viewer (lightweight)</option>
+ <option value="agent-3d">agent-3d (full runtime)</option>
+ </select>
+ </div>
+ <div class="sdk-pg-field sdk-pg-toggle-row">
+ <label>Auto-rotate</label>
+ <button class="sdk-pg-toggle" id="pg-rotate" aria-label="Toggle auto-rotate" role="switch" aria-checked="false"></button>
+ </div>
+ </div>
+ <div class="sdk-playground-code">
+ <pre class="sdk-pre" id="pg-code-output"></pre>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+
<!-- ── Quick start ───────────────────────────────────────────── -->
<section class="sdk-section" id="quickstart" aria-labelledby="sdk-qs-title">
<div class="sdk-wrap">
- <div class="sdk-section-label" aria-hidden="true">Quick start</div>
- <h2 class="sdk-h2" id="sdk-qs-title">Up in 60 seconds</h2>
- <p class="sdk-lead">Three steps from zero to a live 3D avatar in your page.</p>
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">Quick start</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-qs-title">Up in 60 seconds</h2>
+ <p class="sdk-lead sdk-reveal">Three steps from zero to a live 3D avatar in your page.</p>
<div class="sdk-steps">
<!-- Step 1 -->
- <div class="sdk-step">
+ <div class="sdk-step sdk-reveal">
<div class="sdk-step-num" aria-hidden="true">1</div>
<div class="sdk-step-body">
<h3 class="sdk-step-title">Install</h3>
@@ -1002,7 +281,7 @@
</div>
<!-- Step 2 -->
- <div class="sdk-step">
+ <div class="sdk-step sdk-reveal">
<div class="sdk-step-num" aria-hidden="true">2</div>
<div class="sdk-step-body">
<h3 class="sdk-step-title">Add the web component</h3>
@@ -1056,7 +335,7 @@ document.body.<span class="t-fn">appendChild</span>(el)<span class="t-op">;</spa
</div>
<!-- Step 3 -->
- <div class="sdk-step">
+ <div class="sdk-step sdk-reveal">
<div class="sdk-step-num" aria-hidden="true">3</div>
<div class="sdk-step-body">
<h3 class="sdk-step-title">Let users build their avatar</h3>
@@ -1092,12 +371,12 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<div class="sdk-wrap">
<div class="sdk-code-section">
<div>
- <div class="sdk-section-label" aria-hidden="true">Pure visual</div>
- <h2 class="sdk-h2" id="sdk-viewer-title"><code>&lt;three-ws-viewer&gt;</code></h2>
- <p class="sdk-lead" style="margin-bottom:24px">
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">Pure visual</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-viewer-title"><code>&lt;three-ws-viewer&gt;</code></h2>
+ <p class="sdk-lead sdk-reveal" style="margin-bottom:24px">
When you don't need the full agent runtime — chat, voice, lipsync — use the lightweight viewer. It only loads Three.js and OrbitControls. <strong>No WebSocket. No AI.</strong>
</p>
- <div class="sdk-code-copy">
+ <div class="sdk-code-copy sdk-reveal">
<div class="sdk-code-label">
<span class="sdk-code-filename">pure-viewer.html</span>
<button class="sdk-copy-btn" data-target="code-viewer">Copy</button>
@@ -1114,11 +393,11 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<span class="t-tag">&gt;&lt;/three-ws-viewer&gt;</span></pre>
</div>
</div>
- <div style="display:flex;flex-direction:column;gap:16px">
+ <div class="sdk-reveal" style="display:flex;flex-direction:column;gap:16px">
<div style="background:var(--sdk-card);border:1.5px solid var(--sdk-border);border-radius:var(--sdk-radius);overflow:hidden;aspect-ratio:3/4;max-height:420px">
<three-ws-viewer
src="/avatars/default.glb"
- background="#090912"
+ background="#060608"
alt="Lightweight viewer demo"
style="width:100%;height:100%"
></three-ws-viewer>
@@ -1136,12 +415,12 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<div class="sdk-wrap">
<div class="sdk-code-section reversed">
<div>
- <div class="sdk-section-label" aria-hidden="true">Creator</div>
- <h2 class="sdk-h2" id="sdk-creator-title">AvatarCreator</h2>
- <p class="sdk-lead" style="margin-bottom:24px">
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">Creator</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-creator-title">AvatarCreator</h2>
+ <p class="sdk-lead sdk-reveal" style="margin-bottom:24px">
Opens the three.ws Avatar Studio in a fullscreen modal. The user builds their avatar and clicks Export — you receive a GLB <code>Blob</code> in the callback. No OAuth, no API keys needed for the modal itself.
</p>
- <div class="sdk-creator-demo-card">
+ <div class="sdk-creator-demo-card sdk-reveal">
<p class="sdk-creator-desc">
Click the button to open the Avatar Studio right here. After you export an avatar the file size will appear below.
</p>
@@ -1152,7 +431,7 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<div id="sdk-creator-status" class="sdk-creator-status" role="status" aria-live="polite"></div>
</div>
</div>
- <div>
+ <div class="sdk-reveal">
<div class="sdk-code-copy">
<div class="sdk-code-label">
<span class="sdk-code-filename">creator-minimal.js</span>
@@ -1189,11 +468,11 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<!-- ── React ─────────────────────────────────────────────────── -->
<section class="sdk-section" aria-labelledby="sdk-react-title">
<div class="sdk-wrap">
- <div class="sdk-section-label" aria-hidden="true">React</div>
- <h2 class="sdk-h2" id="sdk-react-title">React 18+ bindings</h2>
- <p class="sdk-lead">All four exports are typed and tree-shakeable. Marked <code>'use client'</code> for Next.js App Router.</p>
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">React</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-react-title">React 18+ bindings</h2>
+ <p class="sdk-lead sdk-reveal">All four exports are typed and tree-shakeable. Marked <code>'use client'</code> for Next.js App Router.</p>
- <div class="sdk-tabs">
+ <div class="sdk-tabs sdk-reveal">
<div class="sdk-tab-list" role="tablist" aria-label="React component examples">
<button class="sdk-tab-btn active" role="tab" aria-selected="true">&lt;Avatar&gt;</button>
<button class="sdk-tab-btn" role="tab" aria-selected="false">&lt;AgentAvatar&gt;</button>
@@ -1273,12 +552,12 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<!-- ── API Reference ─────────────────────────────────────────── -->
<section class="sdk-section" aria-labelledby="sdk-api-title">
<div class="sdk-wrap">
- <div class="sdk-section-label" aria-hidden="true">API Reference</div>
- <h2 class="sdk-h2" id="sdk-api-title">Exports</h2>
- <p class="sdk-lead">Everything the package surfaces.</p>
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">API Reference</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-api-title">Exports</h2>
+ <p class="sdk-lead sdk-reveal">Everything the package surfaces.</p>
<div class="sdk-api-grid">
- <div class="sdk-api-card">
+ <div class="sdk-api-card sdk-reveal sdk-reveal-delay-1">
<div class="sdk-api-card-head">
<span class="sdk-api-export-badge">element</span>
<span class="sdk-api-name">&lt;agent-3d&gt;</span>
@@ -1294,7 +573,7 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
</div>
</div>
- <div class="sdk-api-card">
+ <div class="sdk-api-card sdk-reveal sdk-reveal-delay-2">
<div class="sdk-api-card-head">
<span class="sdk-api-export-badge">element</span>
<span class="sdk-api-name">&lt;three-ws-viewer&gt;</span>
@@ -1310,7 +589,7 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
</div>
</div>
- <div class="sdk-api-card">
+ <div class="sdk-api-card sdk-reveal sdk-reveal-delay-3">
<div class="sdk-api-card-head">
<span class="sdk-api-export-badge">class</span>
<span class="sdk-api-name">AvatarCreator</span>
@@ -1326,7 +605,7 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
</div>
</div>
- <div class="sdk-api-card">
+ <div class="sdk-api-card sdk-reveal sdk-reveal-delay-4">
<div class="sdk-api-card-head">
<span class="sdk-api-export-badge">function</span>
<span class="sdk-api-name">saveBlob(blob, opts)</span>
@@ -1348,11 +627,11 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<!-- ── Comparison ────────────────────────────────────────────── -->
<section class="sdk-section" aria-labelledby="sdk-compare-title">
<div class="sdk-wrap">
- <div class="sdk-section-label" aria-hidden="true">Comparison</div>
- <h2 class="sdk-h2" id="sdk-compare-title">vs. Ready Player Me</h2>
- <p class="sdk-lead">RPM was acquired and closed their free tier. Here's what you get when you migrate.</p>
+ <div class="sdk-section-label sdk-reveal" aria-hidden="true">Comparison</div>
+ <h2 class="sdk-h2 sdk-reveal" id="sdk-compare-title">vs. Ready Player Me</h2>
+ <p class="sdk-lead sdk-reveal">RPM was acquired and closed their free tier. Here's what you get when you migrate.</p>
- <div class="sdk-table-wrap" role="region" aria-label="Comparison table" tabindex="0">
+ <div class="sdk-table-wrap sdk-reveal" role="region" aria-label="Comparison table" tabindex="0">
<table class="sdk-table">
<thead>
<tr>
@@ -1426,7 +705,7 @@ creator.<span class="t-fn">open</span>()<span class="t-op">;</span></pre>
<!-- ── CTA ───────────────────────────────────────────────────── -->
<section class="sdk-section" aria-labelledby="sdk-cta-title">
<div class="sdk-wrap">
- <div class="sdk-cta-banner">
+ <div class="sdk-cta-banner sdk-reveal">
<div class="sdk-cta-banner-copy">
<h2 id="sdk-cta-title">Ready to ship 3D avatars?</h2>
<p>Create your first avatar free. No credit card. Push to production in minutes.</p>
diff --git a/pages/discover-next.html b/pages/discover-next.html
index b62804f73..489e753fd 100644
--- a/pages/discover-next.html
+++ b/pages/discover-next.html
@@ -155,6 +155,7 @@
backdrop-filter: blur(6px);
}
.card-badge.live { color: var(--ok); border-color: rgba(34,197,94,0.3); }
+ .card-badge.sol { color: #9945ff; border-color: rgba(153,69,255,0.35); }
/* ── LOAD MORE / STATUS ── */
.load-more-wrap { text-align: center; padding: 32px 0 0; }
@@ -220,13 +221,15 @@
<div class="stats-bar" id="stats-bar" style="display:none">
<span><strong id="stat-total">—</strong> agents</span>
+ <span><strong id="stat-solana">—</strong> on Solana</span>
<span><strong id="stat-3d">—</strong> with 3D avatars</span>
</div>
<div class="filter-bar" id="filter-bar">
<button class="filter-btn active" data-source="all">All</button>
+ <button class="filter-btn" data-source="solana">Solana</button>
<button class="filter-btn" data-source="avatar">3D avatars</button>
- <button class="filter-btn" data-source="onchain">On-chain</button>
+ <button class="filter-btn" data-source="onchain">On-chain (EVM)</button>
</div>
<div class="grid-wrap">
@@ -282,12 +285,14 @@
loadMoreBtn.style.display = exhausted ? 'none' : '';
loadMoreBtn.disabled = false;
- // Stats on first page
- if (!params.get('cursor') && d.totalCount != null) {
+ if (!params.get('cursor') && d.totals) {
+ const t = d.totals;
const total = document.getElementById('stat-total');
const s3d = document.getElementById('stat-3d');
- if (total) total.textContent = Number(d.totalCount).toLocaleString();
- if (s3d && d.count3d != null) s3d.textContent = Number(d.count3d).toLocaleString();
+ const sSol = document.getElementById('stat-solana');
+ if (total) total.textContent = Number(t.all).toLocaleString();
+ if (s3d) s3d.textContent = Number(t.threeD).toLocaleString();
+ if (sSol) sSol.textContent = Number(t.solana).toLocaleString();
document.getElementById('stats-bar').style.display = '';
}
} catch (err) {
@@ -324,8 +329,20 @@
`;
const img = a.querySelector('img');
if (img) img.addEventListener('load', () => img.classList.remove('loading'));
+ } else if (item.kind === 'solana') {
+ a.href = `/discover/a/sol/${encodeURIComponent(item.asset)}`;
+ const imgSrc = item.image || '';
+ a.innerHTML = `
+ ${imgSrc ? `<img src="${escHtml(imgSrc)}" alt="${escHtml(item.name)}" loading="lazy" class="loading" />` : ''}
+ <span class="card-badge sol">◎ Solana</span>
+ <div class="card-meta">
+ <div class="card-name">${escHtml(item.name || 'Solana Agent')}</div>
+ <div class="card-author">${escHtml(item.ownerShort || '')}</div>
+ </div>
+ `;
+ const img = a.querySelector('img');
+ if (img) img.addEventListener('load', () => img.classList.remove('loading'));
} else {
- // On-chain ERC-8004 agent
const detailUrl = `/discover/a/${encodeURIComponent(item.chainId)}/${encodeURIComponent(item.agentId)}`;
a.href = detailUrl;
const imgSrc = item.image || '';
diff --git a/pages/home-next.html b/pages/home-next.html
index 11544e53d..bbfb1d347 100644
--- a/pages/home-next.html
+++ b/pages/home-next.html
@@ -185,7 +185,7 @@
}
/* ── Hero stage ──────────────────────────────────────────── */
- .hero-stage { position: relative; overflow: hidden; background: var(--bg); }
+ .hero-stage { position: relative; overflow: hidden; background: var(--bg); container-type: inline-size; }
.hero-stage agent-3d {
position: absolute; inset: 0; display: block; width: 100%; height: 100%;
}
@@ -490,6 +490,61 @@
border-bottom: 1px solid var(--hairline);
}
+ /* Walk embed preview */
+ .walk-preview-wrap {
+ display: flex; flex-direction: column; gap: 0;
+ }
+ .walk-preview-canvas-area {
+ position: relative; aspect-ratio: 16 / 9;
+ background: #0d0f14; overflow: hidden; cursor: grab;
+ }
+ .walk-preview-canvas-area:active { cursor: grabbing; }
+ .walk-preview-canvas {
+ display: block; width: 100%; height: 100%;
+ }
+ .walk-preview-loading {
+ position: absolute; inset: 0; display: flex;
+ flex-direction: column; align-items: center;
+ justify-content: center; gap: 12px;
+ background: #0d0f14; z-index: 4;
+ font-family: var(--font-mono); font-size: 11px;
+ color: var(--text-3); letter-spacing: 0.1em;
+ transition: opacity 0.5s ease;
+ }
+ .walk-preview-loading.is-done { opacity: 0; pointer-events: none; }
+ .walk-preview-spinner {
+ width: 24px; height: 24px; border: 2px solid var(--hairline-strong);
+ border-top-color: var(--text-2); border-radius: 50%;
+ animation: walk-spin 0.8s linear infinite;
+ }
+ @keyframes walk-spin { to { transform: rotate(360deg); } }
+ .walk-preview-hint {
+ position: absolute; bottom: 10px; left: 50%;
+ transform: translateX(-50%); display: flex; gap: 14px;
+ font-family: var(--font-mono); font-size: 9.5px;
+ color: var(--text-4); letter-spacing: 0.06em;
+ opacity: 0.7; pointer-events: none; z-index: 3;
+ white-space: nowrap;
+ }
+ .walk-preview-hint kbd {
+ display: inline-block; padding: 1px 4px;
+ border: 1px solid var(--hairline-strong);
+ border-radius: 3px; font-family: var(--font-mono);
+ font-size: 9px; color: var(--text-3);
+ background: var(--surface-2); margin: 0 1px;
+ }
+ .walk-preview-joystick {
+ position: absolute; bottom: 14px; right: 14px;
+ width: 90px; height: 90px; z-index: 5;
+ }
+ @media (min-width: 768px) {
+ .walk-preview-joystick { display: none; }
+ }
+ @media (max-width: 767px) {
+ .walk-preview-hint { display: none; }
+ .walk-preview-joystick { display: block; }
+ }
+
/* Pump.fun earn rows */
.earn-rows { display: flex; flex-direction: column; gap: 1px; }
.earn-row {
@@ -527,44 +582,97 @@
.step-title { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 12px; }
.step-body { color: var(--text-2); font-size: 15px; line-height: 1.55; margin: 0; }
- /* ── SHOWCASE ────────────────────────────────────────────── */
- .showcase {
- display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
- background: var(--hairline); border: 1px solid var(--hairline);
- border-radius: 14px; overflow: hidden;
+ /* ── SHOWCASE 3D ─────────────────────────────────────────── */
+ .showcase-3d { perspective: 1200px; perspective-origin: 50% 40%; }
+ .showcase-3d-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
+ @media (max-width: 1080px) { .showcase-3d-grid { grid-template-columns: repeat(2, 1fr); } }
+ @media (max-width: 560px) { .showcase-3d-grid { grid-template-columns: 1fr; max-width: 340px; margin: 0 auto; } }
+ .showcase-agent-card {
+ position: relative; aspect-ratio: 3 / 4; border-radius: 16px;
+ overflow: hidden; background: var(--surface-0); border: 1px solid var(--hairline);
+ transform-style: preserve-3d;
+ transform: rotateX(0) rotateY(0) translateZ(0);
+ transition: transform 0.45s cubic-bezier(.22,.68,0,.98), box-shadow 0.4s, border-color 0.3s;
+ cursor: pointer; text-decoration: none; display: block;
}
- @media (max-width: 1080px) { .showcase { grid-template-columns: repeat(2, 1fr); } }
- .shot {
- background: var(--surface-0); aspect-ratio: 3 / 4;
- position: relative; overflow: hidden; transition: background 0.15s;
- display: flex; flex-direction: column; justify-content: flex-end;
- }
- .shot:hover { background: var(--surface-1); }
- .shot-fill { position: absolute; inset: 0; }
- .shot-fill img {
- width: 100%; height: 100%; object-fit: cover;
- filter: grayscale(0.25) contrast(1.05); transition: filter 0.3s;
- }
- .shot:hover .shot-fill img { filter: grayscale(0) contrast(1.05); }
- .shot-meta {
- position: absolute; bottom: 0; left: 0; right: 0; padding: 20px;
- background: linear-gradient(180deg, transparent 0%, rgba(5,5,5,0.92) 70%);
- color: var(--text); z-index: 2;
- }
- .shot-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 2px; }
- .shot-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }
- .shot-tag {
- position: absolute; top: 14px; left: 14px; z-index: 2;
- font-family: var(--font-mono); font-size: 10px;
+ .showcase-agent-card:hover {
+ transform: translateZ(24px) scale(1.03);
+ border-color: rgba(255,255,255,0.12);
+ box-shadow: 0 20px 60px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
+ }
+ .showcase-agent-card agent-3d {
+ position: absolute; inset: 0; width: 100%; height: 100%;
+ display: block; opacity: 0; transition: opacity 0.6s ease;
+ }
+ .showcase-agent-card agent-3d.loaded { opacity: 1; }
+ .showcase-card-grad { position: absolute; inset: 0; z-index: 0; opacity: 0.5; transition: opacity 0.4s; }
+ .showcase-agent-card:hover .showcase-card-grad { opacity: 0.7; }
+ .showcase-card-floor {
+ position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
+ background: linear-gradient(180deg, transparent 0%, rgba(5,5,5,0.95) 100%);
+ z-index: 1; pointer-events: none;
+ }
+ .showcase-card-meta {
+ position: absolute; bottom: 0; left: 0; right: 0;
+ padding: 18px 16px; z-index: 3; color: var(--text);
+ }
+ .showcase-card-name {
+ font-family: var(--font-display); font-size: 15px; font-weight: 600;
+ letter-spacing: -0.015em; margin: 0 0 3px;
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
+ }
+ .showcase-card-sub {
+ font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
+ letter-spacing: 0.08em; text-transform: uppercase;
+ }
+ .showcase-card-tag {
+ position: absolute; top: 12px; left: 12px; z-index: 4;
+ font-family: var(--font-mono); font-size: 9.5px;
letter-spacing: 0.18em; text-transform: uppercase; color: var(--text);
- padding: 4px 9px; background: rgba(5,5,5,0.55);
- border: 1px solid var(--hairline-strong); border-radius: 99px;
- backdrop-filter: blur(6px);
+ padding: 3px 8px; background: rgba(5,5,5,0.55);
+ border: 1px solid var(--hairline-strong); border-radius: 99px; backdrop-filter: blur(6px);
+ }
+ .showcase-card-anim-tag {
+ position: absolute; top: 12px; right: 12px; z-index: 4;
+ font-family: var(--font-mono); font-size: 9px;
+ letter-spacing: 0.08em; color: rgba(255,255,255,0.35); text-transform: lowercase;
+ }
+ .showcase-card-skel {
+ position: absolute; inset: 0;
+ display: flex; align-items: center; justify-content: center; z-index: 0;
+ }
+ .showcase-card-skel-ring {
+ width: 32px; height: 32px;
+ border: 2px solid rgba(255,255,255,0.08); border-top-color: rgba(255,255,255,0.25);
+ border-radius: 50%; animation: showcase-spin 0.9s linear infinite;
+ }
+ @keyframes showcase-spin { to { transform: rotate(360deg); } }
+ .showcase-cta-card {
+ position: relative; aspect-ratio: 3 / 4; border-radius: 16px;
+ overflow: hidden; border: 1px solid var(--hairline);
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
+ text-align: center; text-decoration: none; background: var(--surface-0);
+ transition: transform 0.35s cubic-bezier(.22,.68,0,.98), border-color 0.3s, background 0.3s;
+ cursor: pointer; gap: 10px; padding: 24px;
+ }
+ .showcase-cta-card:hover {
+ transform: translateZ(12px) scale(1.02);
+ border-color: rgba(255,255,255,0.15); background: var(--surface-1);
+ }
+ .showcase-cta-icon { font-size: 28px; opacity: 0.4; transition: opacity 0.3s; }
+ .showcase-cta-card:hover .showcase-cta-icon { opacity: 0.7; }
+ .showcase-cta-label {
+ font-family: var(--font-display); font-size: 15px; font-weight: 600;
+ color: var(--text); letter-spacing: -0.01em;
+ }
+ .showcase-cta-sub {
+ font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
+ letter-spacing: 0.06em; text-transform: uppercase;
}
- /* ── DEVELOPER SECTION ───────────────────────────────────── */
+ /* ── DEVELOPER SECTION / API PLAYGROUND ──────────────────── */
.dev-grid {
- display: grid; grid-template-columns: 1.1fr 1fr; gap: 1px;
+ display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1px;
background: var(--hairline); border: 1px solid var(--hairline);
border-radius: 14px; overflow: hidden;
}
@@ -574,8 +682,22 @@
padding: 14px 20px; border-bottom: 1px solid var(--hairline);
font-family: var(--font-mono); font-size: 11.5px;
letter-spacing: 0.12em; color: var(--text-3);
- display: flex; justify-content: space-between;
+ display: flex; justify-content: space-between; align-items: center;
+ }
+ .dev-tabs {
+ display: flex; gap: 0; border-bottom: 1px solid var(--hairline);
}
+ .dev-tab {
+ padding: 10px 18px; font-family: var(--font-mono); font-size: 11px;
+ letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4);
+ cursor: pointer; border-bottom: 2px solid transparent;
+ transition: color 0.15s, border-color 0.15s; user-select: none;
+ background: none; border-top: none; border-left: none; border-right: none;
+ }
+ .dev-tab:hover { color: var(--text-2); }
+ .dev-tab.active { color: var(--text); border-bottom-color: var(--text); }
+ .dev-tab-content { display: none; }
+ .dev-tab-content.active { display: block; }
.dev-code {
font-family: var(--font-mono); font-size: 12.5px;
line-height: 1.8; padding: 24px 24px; color: var(--text-2);
@@ -586,7 +708,7 @@
.dev-code .str { color: #c5c5c5; }
.dev-code .cmt { color: var(--text-4); }
.dev-code .num { color: #b0b0b0; }
- .dev-links { padding: 20px 24px; border-top: 1px solid var(--hairline); }
+ .dev-links { padding: 16px 24px; border-top: 1px solid var(--hairline); }
.dev-links-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dev-link {
display: inline-flex; align-items: center; gap: 7px;
@@ -598,8 +720,14 @@
.dev-link:hover { border-color: var(--text); color: var(--text); }
.dev-right { display: flex; flex-direction: column; }
.dev-api-row {
- padding: 18px 24px; border-bottom: 1px solid var(--hairline);
- display: flex; flex-direction: column; gap: 5px;
+ padding: 14px 20px; border-bottom: 1px solid var(--hairline);
+ display: flex; flex-direction: column; gap: 4px;
+ cursor: pointer; transition: background 0.15s;
+ }
+ .dev-api-row:hover { background: var(--surface-1); }
+ .dev-api-row.active {
+ background: var(--surface-2);
+ box-shadow: inset 3px 0 0 var(--text-3);
}
.dev-api-method {
font-family: var(--font-mono); font-size: 11px;
@@ -608,16 +736,108 @@
.dev-api-path {
font-family: var(--font-mono); font-size: 13px; color: var(--text);
}
- .dev-api-desc { font-size: 13px; color: var(--text-3); }
+ .dev-api-desc { font-size: 12px; color: var(--text-4); }
.dev-badge {
display: inline-block; font-family: var(--font-mono); font-size: 10px;
letter-spacing: 0.1em; text-transform: uppercase;
padding: 2px 7px; border-radius: 4px; font-weight: 700;
+ min-width: 36px; text-align: center;
}
- .dev-badge.get { background: rgba(255,255,255,0.12); color: var(--green); }
- .dev-badge.post { background: rgba(255,255,255,0.15); color: #cccccc; }
+ .dev-badge.get { background: rgba(74,222,128,0.12); color: #4ade80; }
+ .dev-badge.post { background: rgba(96,165,250,0.12); color: #60a5fa; }
.dev-badge.mcp { background: rgba(255,92,168,0.12); color: #ff8cc8; }
+ /* ── Playground request builder ──────────────────────────── */
+ .pg-request { padding: 20px 24px; }
+ .pg-field { margin-bottom: 14px; }
+ .pg-field-label {
+ font-family: var(--font-mono); font-size: 10.5px;
+ letter-spacing: 0.12em; text-transform: uppercase;
+ color: var(--text-4); margin-bottom: 6px; display: block;
+ }
+ .pg-input {
+ width: 100%; background: var(--surface-2); border: 1px solid var(--hairline-strong);
+ border-radius: 6px; padding: 9px 12px; color: var(--text);
+ font-family: var(--font-mono); font-size: 12.5px; outline: none;
+ transition: border-color 0.15s;
+ }
+ .pg-input:focus { border-color: var(--text-3); }
+ .pg-input::placeholder { color: var(--text-4); }
+ textarea.pg-input { min-height: 80px; resize: vertical; line-height: 1.6; }
+ .pg-url-bar {
+ display: flex; align-items: center; gap: 0;
+ background: var(--surface-2); border: 1px solid var(--hairline-strong);
+ border-radius: 6px; overflow: hidden; margin-bottom: 16px;
+ }
+ .pg-url-method {
+ padding: 9px 12px; font-family: var(--font-mono); font-size: 11px;
+ font-weight: 700; letter-spacing: 0.08em; color: #4ade80;
+ border-right: 1px solid var(--hairline-strong); background: var(--surface-1);
+ min-width: 52px; text-align: center; user-select: none;
+ }
+ .pg-url-method.post { color: #60a5fa; }
+ .pg-url-path {
+ flex: 1; padding: 9px 12px; font-family: var(--font-mono); font-size: 12.5px;
+ color: var(--text-2); background: transparent; border: none; outline: none;
+ }
+ .pg-url-path::placeholder { color: var(--text-4); }
+ .pg-send {
+ padding: 9px 20px; background: var(--text); color: var(--bg);
+ font-family: var(--font-mono); font-size: 11px; font-weight: 700;
+ letter-spacing: 0.1em; text-transform: uppercase; border: none;
+ border-radius: 6px; cursor: pointer; transition: opacity 0.15s;
+ }
+ .pg-send:hover { opacity: 0.85; }
+ .pg-send:active { opacity: 0.7; }
+ .pg-send:disabled { opacity: 0.4; cursor: not-allowed; }
+ .pg-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
+ .pg-status {
+ font-family: var(--font-mono); font-size: 11px;
+ letter-spacing: 0.05em; color: var(--text-4);
+ }
+ .pg-status.ok { color: #4ade80; }
+ .pg-status.err { color: #f87171; }
+ .pg-response {
+ background: var(--surface-1); border: 1px solid var(--hairline);
+ border-radius: 8px; overflow: hidden;
+ }
+ .pg-response-head {
+ padding: 10px 16px; border-bottom: 1px solid var(--hairline);
+ font-family: var(--font-mono); font-size: 10.5px;
+ letter-spacing: 0.1em; text-transform: uppercase;
+ color: var(--text-4); display: flex; justify-content: space-between;
+ }
+ .pg-response-body {
+ padding: 16px; font-family: var(--font-mono); font-size: 12px;
+ line-height: 1.7; color: var(--text-2); max-height: 260px;
+ overflow-y: auto; white-space: pre-wrap; word-break: break-all;
+ }
+ .pg-response-body::-webkit-scrollbar { width: 5px; }
+ .pg-response-body::-webkit-scrollbar-track { background: transparent; }
+ .pg-response-body::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 3px; }
+ .pg-empty {
+ padding: 40px 24px; text-align: center; color: var(--text-4);
+ font-size: 13px; line-height: 1.6;
+ }
+ .pg-empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.3; }
+ .pg-response-body .json-key { color: #60a5fa; }
+ .pg-response-body .json-str { color: #4ade80; }
+ .pg-response-body .json-num { color: #fbbf24; }
+ .pg-response-body .json-bool { color: #c084fc; }
+ .pg-response-body .json-null { color: var(--text-4); }
+ .pg-curl-code {
+ font-family: var(--font-mono); font-size: 12px;
+ line-height: 1.8; padding: 24px; color: var(--text-2);
+ white-space: pre-wrap; word-break: break-all;
+ }
+ .pg-copy {
+ padding: 4px 10px; background: var(--surface-2); border: 1px solid var(--hairline-strong);
+ border-radius: 4px; color: var(--text-3); font-family: var(--font-mono);
+ font-size: 10px; letter-spacing: 0.1em; cursor: pointer;
+ transition: color 0.15s, border-color 0.15s;
+ }
+ .pg-copy:hover { color: var(--text); border-color: var(--text-3); }
+
/* ── PRICING TEASER ──────────────────────────────────────── */
.pricing-grid {
display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
@@ -749,6 +969,109 @@
}
.hero-stage agent-3d.loaded { opacity: 1; }
+ /* ── HERO THOUGHT BUBBLE ────────────────────────────────── */
+ .hero-thought {
+ position: absolute;
+ top: 10%; left: 50%;
+ transform: translateX(-50%) translate3d(var(--tilt-x, 0px), var(--tilt-y, 0px), 0);
+ transform-origin: bottom center;
+ z-index: 20;
+ width: max-content;
+ max-width: min(clamp(220px, 52cqi, 360px), calc(100% - 32px));
+ opacity: 0; pointer-events: none;
+ transition: opacity 0.35s cubic-bezier(.2,.7,.3,1);
+ will-change: transform, opacity;
+ }
+ .hero-thought.visible { opacity: 1; pointer-events: auto; }
+ .hero-thought-inner {
+ background: rgba(14,14,14,0.88);
+ backdrop-filter: blur(16px) saturate(140%);
+ -webkit-backdrop-filter: blur(16px) saturate(140%);
+ border: 1px solid rgba(255,255,255,0.1);
+ border-radius: clamp(10px, 2cqi, 14px);
+ padding: clamp(10px, 2cqi, 14px) clamp(12px, 2.6cqi, 18px);
+ font-size: clamp(12px, 2cqi, 14px); line-height: 1.55; color: var(--text);
+ max-height: clamp(120px, 26cqi, 180px); overflow-y: auto;
+ scrollbar-width: thin; scrollbar-color: var(--hairline-strong) transparent;
+ }
+ .hero-thought-inner::-webkit-scrollbar { width: 4px; }
+ .hero-thought-inner::-webkit-scrollbar-track { background: transparent; }
+ .hero-thought-inner::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }
+ .hero-thought-tail {
+ width: 20px; height: 12px; margin: -1px auto 0;
+ display: block; position: relative;
+ }
+ .hero-thought-tail::before {
+ content: ""; position: absolute; top: 0; left: 50%;
+ transform: translateX(-50%); width: 0; height: 0;
+ border-left: 10px solid transparent; border-right: 10px solid transparent;
+ border-top: 12px solid rgba(255,255,255,0.1);
+ }
+ .hero-thought-tail::after {
+ content: ""; position: absolute; top: 0; left: 50%;
+ transform: translateX(-50%); width: 0; height: 0;
+ border-left: 9px solid transparent; border-right: 9px solid transparent;
+ border-top: 11px solid rgba(14,14,14,0.88);
+ }
+ .hero-thought-dots {
+ display: flex; gap: 5px; align-items: center; padding: 2px 0;
+ }
+ .hero-thought-dots span {
+ width: 6px; height: 6px; border-radius: 50%;
+ background: var(--text-3);
+ animation: thought-bounce 1.4s ease-in-out infinite;
+ }
+ .hero-thought-dots span:nth-child(2) { animation-delay: 0.15s; }
+ .hero-thought-dots span:nth-child(3) { animation-delay: 0.3s; }
+ @keyframes thought-bounce {
+ 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
+ 30% { opacity: 1; transform: translateY(-4px); }
+ }
+
+ /* ── HERO CHAT INPUT ────────────────────────────────────── */
+ .hero-chat-bar {
+ position: absolute; bottom: 72px; left: 50%;
+ transform: translateX(-50%); z-index: 20;
+ width: min(380px, calc(100% - 40px));
+ }
+ .hero-chat-form {
+ display: flex; align-items: center; gap: 0;
+ background: rgba(14,14,14,0.82);
+ backdrop-filter: blur(16px) saturate(140%);
+ -webkit-backdrop-filter: blur(16px) saturate(140%);
+ border: 1px solid rgba(255,255,255,0.1);
+ border-radius: 999px; padding: 4px 4px 4px 16px;
+ transition: border-color 0.2s;
+ }
+ .hero-chat-form:focus-within { border-color: rgba(255,255,255,0.25); }
+ .hero-chat-input {
+ flex: 1; background: transparent; border: none; outline: none;
+ color: var(--text); font-family: var(--font-body);
+ font-size: 13.5px; padding: 8px 0; min-width: 0;
+ }
+ .hero-chat-input::placeholder { color: var(--text-4); }
+ .hero-chat-send {
+ flex-shrink: 0; width: 32px; height: 32px;
+ border-radius: 50%; border: none;
+ background: var(--text); color: var(--bg);
+ display: flex; align-items: center; justify-content: center;
+ cursor: pointer; transition: opacity 0.15s, transform 0.15s;
+ }
+ .hero-chat-send:hover { opacity: 0.85; }
+ .hero-chat-send:active { transform: scale(0.92); }
+ .hero-chat-send:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
+ .hero-chat-send svg { width: 14px; height: 14px; }
+ .hero-chat-hint {
+ text-align: center; margin-top: 8px;
+ font-family: var(--font-mono); font-size: 10px;
+ letter-spacing: 0.12em; text-transform: uppercase;
+ color: var(--text-4); opacity: 0.6;
+ }
+ @media (max-width: 980px) {
+ .hero-chat-bar { bottom: 20px; }
+ .hero-thought { top: 4%; }
+ }
+
/* ── REVEAL ANIMATIONS ──────────────────────────────────── */
.reveal {
opacity: 0; transform: translateY(32px);
@@ -789,6 +1112,28 @@
.door:hover .door-screenshot img { transform: scale(1.03); }
.pricing-card { transition: background 0.15s, transform 0.2s; }
.pricing-card:hover { transform: translateY(-2px); }
+
+ /* ── PRICING AVATAR STAGE ────────────────────────────── */
+ .pricing-stage { position: relative; }
+ #pricing-canvas {
+ position: absolute;
+ top: -200px; left: 0; right: 0; bottom: 0;
+ pointer-events: none; z-index: 10;
+ }
+ .pricing-card.is-active {
+ background: var(--surface-1);
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
+ transform: translateY(-2px);
+ }
+ .pricing-hint {
+ text-align: center; margin-top: 20px;
+ font-family: var(--font-mono); font-size: 11px;
+ letter-spacing: 0.12em; text-transform: uppercase;
+ color: var(--text-4);
+ }
+ @media (max-width: 860px) {
+ #pricing-canvas, .pricing-hint { display: none; }
+ }
@keyframes stat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.stat-animated { animation: stat-in 0.5s cubic-bezier(.2,.7,.3,1) both; }
@@ -798,166 +1143,1236 @@
.hero-stage agent-3d { opacity: 1 !important; transition: none !important; }
.hero-stage-shimmer { display: none !important; }
}
- </style>
- <noscript><style>.reveal{opacity:1!important;transform:none!important}.hero-text>*{opacity:1!important;transform:none!important}</style></noscript>
- <script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
-</head>
-<body>
-<!-- ── NAV ──────────────────────────────────────────────────────── -->
-<header class="nav">
- <div class="nav-inner">
- <a class="brand" href="/">
- <span class="brand-mark"></span>
- <span>three.ws</span>
- </a>
- <nav class="nav-main" aria-label="Primary">
- <a href="/create">Build</a>
- <a href="#embed">Embed</a>
- <a href="/discover">Discover</a>
- <a href="/pricing">Pricing</a>
- <a href="/docs">Docs</a>
- </nav>
- <div class="nav-end">
- <a href="/login">Sign in</a>
- <a class="console" href="/dashboard">Console →</a>
- </div>
- <button class="nav-toggle" aria-label="Menu" aria-expanded="false" id="nav-toggle">
- <svg class="open" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/></svg>
- <svg class="close" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"><line x1="3" y1="3" x2="13" y2="13"/><line x1="13" y1="3" x2="3" y2="13"/></svg>
- </button>
- </div>
-</header>
-<nav class="nav-drawer" id="nav-drawer" aria-label="Mobile" aria-hidden="true">
- <a href="/create">Build</a>
- <a href="#embed">Embed</a>
- <a href="/discover">Discover</a>
- <a href="/pricing">Pricing</a>
- <a href="/docs">Docs</a>
- <div class="sep"></div>
- <a href="/login">Sign in</a>
- <a class="btn primary" href="/dashboard" style="margin-top:4px;">Console →</a>
-</nav>
+ /* ── HERO ANIMATION CHIPS ────────────────────────────────── */
+ .hero-chips-wrap {
+ position: absolute;
+ bottom: 0; left: 0; right: 0;
+ z-index: 10;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 8px;
+ padding: 32px 20px 20px;
+ background: linear-gradient(0deg, rgba(5,5,5,0.75) 0%, transparent 100%);
+ pointer-events: none;
+ }
+ .hero-chips-wrap > * { pointer-events: auto; }
+ .hero-chips-label {
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 0.22em;
+ text-transform: uppercase;
+ color: var(--text-4);
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+ .hero-chips-label::before {
+ content: "";
+ display: inline-block;
+ width: 5px; height: 5px;
+ border-radius: 50%;
+ background: var(--text-3);
+ box-shadow: 0 0 5px var(--text-3);
+ animation: pulse-green 2.4s ease-in-out infinite;
+ }
+ .hero-chips {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 6px;
+ }
+ .hero-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 7px 13px;
+ border-radius: 999px;
+ background: rgba(5,5,5,0.6);
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+ border: 1px solid var(--hairline-strong);
+ color: var(--text-3);
+ font: 500 12.5px/1 var(--font-body);
+ cursor: pointer;
+ transition: border-color 0.15s, color 0.15s, background 0.15s;
+ user-select: none;
+ }
+ .hero-chip:hover {
+ border-color: rgba(255,255,255,0.4);
+ color: var(--text);
+ background: rgba(255,255,255,0.06);
+ }
+ .hero-chip[data-active="true"] {
+ border-color: rgba(255,255,255,0.55);
+ color: var(--text);
+ background: rgba(255,255,255,0.1);
+ }
+ .hero-chips-counter {
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 0.12em;
+ color: var(--text-4);
+ }
+ .hero-chips-counter strong { color: var(--text-3); font-weight: 600; }
+ @media (max-width: 980px) { .hero-chips-wrap { display: none; } }
+ @media (prefers-reduced-motion: reduce) {
+ .hero-chips-label::before { animation: none !important; }
+ }
-<!-- ── HERO ─────────────────────────────────────────────────────── -->
-<section class="hero">
- <div class="hero-text">
- <div class="eyebrow">Open beta · live now</div>
- <h1 class="hero-h">
- The 3D agent<br/>
- layer of the<br/>
- <em>internet.</em>
- </h1>
- <ul class="hero-bullets">
- <li><strong>Create</strong> a 3D AI agent from a selfie in 60 seconds</li>
- <li><strong>Embed</strong> it on any website with two lines of HTML</li>
- <li><strong>Earn</strong> USDC per chat with x402 micropayments</li>
- </ul>
- <div class="hero-cta-row">
- <a class="btn primary" href="/create">Build your agent <span class="arrow">→</span></a>
- <a class="btn" href="#embed">See the embed</a>
- </div>
- <div class="metrics" id="metrics-strip">
- <div class="metric"><strong id="m-agents">—</strong>agents live</div>
- <div class="metric"><strong id="m-sites">—</strong>embeds</div>
- <div class="metric"><strong id="m-onchain">—</strong>on-chain</div>
- </div>
- </div>
- <div class="hero-stage" id="hero-stage">
- <span class="stage-marker">live</span>
- <div class="hero-stage-shimmer" id="hero-shimmer"></div>
- <div class="hero-stage-inner" id="hero-stage-inner"></div>
- <div class="stage-meta">
- <span>nich</span>
- <span>/api/avatars/bacff13e</span>
- </div>
- </div>
-</section>
+ /* ── 3D STACK GRID ───────────────────────────────────────────── */
+ .stack-3d {
+ perspective: 1400px;
+ perspective-origin: 50% 40%;
+ }
+ .stack-3d-scene {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1px;
+ background: var(--hairline);
+ border: 1px solid var(--hairline);
+ border-radius: 14px;
+ overflow: hidden;
+ transform-style: preserve-3d;
+ transform: rotateX(0deg) rotateY(0deg);
+ transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
+ will-change: transform;
+ }
+ .stack-card {
+ position: relative;
+ background: var(--surface-0);
+ padding: 40px 32px 36px;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ text-decoration: none;
+ color: var(--text);
+ transition:
+ background 0.3s ease,
+ opacity 0.35s ease;
+ cursor: pointer;
+ overflow: hidden;
+ min-height: 210px;
+ }
+ .stack-card::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ opacity: 0;
+ background: radial-gradient(
+ 600px circle at var(--mx, 50%) var(--my, 50%),
+ rgba(255,255,255,0.045),
+ transparent 40%
+ );
+ transition: opacity 0.4s ease;
+ pointer-events: none;
+ z-index: 1;
+ }
+ .stack-card:hover::before { opacity: 1; }
+ .stack-card::after {
+ content: '';
+ position: absolute;
+ inset: -1px;
+ border-radius: inherit;
+ opacity: 0;
+ background: radial-gradient(
+ 400px circle at var(--mx, 50%) var(--my, 50%),
+ rgba(255,255,255,0.13),
+ transparent 40%
+ );
+ mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
+ mask-composite: exclude;
+ -webkit-mask-composite: xor;
+ padding: 1px;
+ transition: opacity 0.4s ease;
+ pointer-events: none;
+ z-index: 2;
+ }
+ .stack-card:hover::after { opacity: 1; }
+ .stack-card:hover {
+ background: var(--surface-1);
+ z-index: 3;
+ }
+ .stack-3d-scene:hover .stack-card:not(:hover) {
+ opacity: 0.55;
+ }
+ .stack-card-num {
+ font-family: var(--font-mono);
+ font-size: 11px;
+ letter-spacing: 0.18em;
+ color: var(--text-4);
+ margin-bottom: 6px;
+ }
+ .stack-card-title {
+ font-family: var(--font-display);
+ font-size: clamp(22px, 2.2vw, 30px);
+ font-weight: 600;
+ letter-spacing: -0.025em;
+ line-height: 1.1;
+ margin: 0;
+ }
+ .stack-card-desc {
+ color: var(--text-2);
+ font-size: 14px;
+ line-height: 1.55;
+ margin: 0;
+ flex: 1;
+ }
+ .stack-card-arrow {
+ font-family: var(--font-mono);
+ font-size: 16px;
+ color: var(--text-4);
+ align-self: flex-end;
+ transition: color 0.25s, transform 0.25s;
+ }
+ .stack-card:hover .stack-card-arrow {
+ color: var(--text);
+ transform: translate(4px, -4px);
+ }
+ /* staggered entrance */
+ .stack-3d .stack-card {
+ opacity: 0;
+ transform: translateY(30px);
+ transition:
+ background 0.3s ease,
+ opacity 0.55s cubic-bezier(0.23, 1, 0.32, 1),
+ transform 0.55s cubic-bezier(0.23, 1, 0.32, 1);
+ }
+ .stack-3d.vis .stack-card {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ .stack-3d.vis .stack-card:nth-child(1) { transition-delay: 0.04s; }
+ .stack-3d.vis .stack-card:nth-child(2) { transition-delay: 0.09s; }
+ .stack-3d.vis .stack-card:nth-child(3) { transition-delay: 0.14s; }
+ .stack-3d.vis .stack-card:nth-child(4) { transition-delay: 0.19s; }
+ .stack-3d.vis .stack-card:nth-child(5) { transition-delay: 0.24s; }
+ .stack-3d.vis .stack-card:nth-child(6) { transition-delay: 0.29s; }
+ .stack-3d.vis.settled .stack-card { transition-delay: 0s; }
+ @media (max-width: 980px) {
+ .stack-3d-scene { grid-template-columns: repeat(2, 1fr); }
+ .stack-3d { perspective: 1000px; }
+ }
+ @media (max-width: 600px) {
+ .stack-3d-scene { grid-template-columns: 1fr; }
+ .stack-3d { perspective: none; }
+ .stack-card { min-height: auto; padding: 28px 24px 24px; }
+ .stack-3d .stack-card,
+ .stack-3d .stack-card:hover,
+ .stack-3d-scene:hover .stack-card:not(:hover) {
+ transform: none !important; opacity: 1 !important;
+ }
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .stack-card, .stack-3d-scene { transition: none !important; }
+ .stack-3d .stack-card { opacity: 1 !important; transform: none !important; }
+ }
-<!-- ── STATS BAR ─────────────────────────────────────────────────── -->
-<div class="stats-bar" id="stats-bar">
- <div class="stats-bar-inner">
- <div class="stat-cell">
- <div class="stat-val" id="sb-agents">—</div>
- <div class="stat-lbl">Agents live</div>
- </div>
- <div class="stat-cell">
- <div class="stat-val" id="sb-widgets">—</div>
- <div class="stat-lbl">Widgets deployed</div>
- </div>
- <div class="stat-cell">
- <div class="stat-val" id="sb-onchain">—</div>
- <div class="stat-lbl">On-chain agents</div>
- </div>
- <div class="stat-cell">
- <div class="stat-val">200+</div>
- <div class="stat-lbl">Animation clips</div>
- </div>
- <div class="stat-cell">
- <div class="stat-val">&lt;2 lines</div>
- <div class="stat-lbl">To embed</div>
- </div>
- </div>
-</div>
+ /* ── V4-STYLE IMMERSIVE CLOSE ────────────────────────────────── */
+ .vclose {
+ position: relative; min-height: 100vh;
+ display: flex; align-items: center; justify-content: center;
+ overflow: hidden; border-top: 1px solid var(--hairline);
+ }
+ .vclose-agent {
+ position: absolute; inset: 0; width: 100%; height: 100%;
+ display: block; z-index: 1;
+ opacity: 0; transition: opacity 0.9s cubic-bezier(.2,.7,.3,1);
+ }
+ .vclose-agent.loaded { opacity: 1; }
+ .vclose-grid {
+ position: absolute; inset: 0; z-index: 0; pointer-events: none;
+ background-image:
+ linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
+ linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
+ background-size: 60px 60px;
+ mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
+ }
+ .vclose-vignette {
+ position: absolute; inset: 0; z-index: 2; pointer-events: none;
+ background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 30%, rgba(5,5,5,0.92) 100%);
+ }
+ .vclose-overlay {
+ position: relative; z-index: 3;
+ display: flex; flex-direction: column; align-items: center;
+ text-align: center; gap: 24px;
+ padding: 80px 32px;
+ max-width: 720px; margin: 0 auto;
+ }
+ .vclose-eyebrow {
+ font-family: var(--font-mono); font-size: 11px;
+ letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-3);
+ display: flex; align-items: center; gap: 8px;
+ }
+ .vclose-eyebrow::before {
+ content: ""; width: 5px; height: 5px; border-radius: 50%;
+ background: var(--text-3); box-shadow: 0 0 5px var(--text-3);
+ animation: pulse-green 2.4s ease-in-out infinite;
+ }
+ .vclose-title {
+ font-family: var(--font-display);
+ font-size: clamp(48px, 7vw, 96px);
+ line-height: 0.92; letter-spacing: -0.045em;
+ font-weight: 600; margin: 0; color: var(--text);
+ }
+ .vclose-title em { font-style: normal; color: var(--text-3); font-weight: 500; }
+ .vclose-sub {
+ font-size: 17px; color: var(--text-2); max-width: 460px; line-height: 1.55; margin: 0;
+ }
+ .vclose-chips {
+ display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
+ margin-top: 8px;
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .vclose-eyebrow::before { animation: none !important; }
+ .vclose-agent { opacity: 1 !important; transition: none !important; }
+ }
-<!-- ── LOGO STRIP ────────────────────────────────────────────────── -->
-<div class="logo-strip">
- <div class="wrap-1280">
- <div class="logo-strip-cap">Embedded across the web</div>
- <div class="logo-row">
- <span class="logo">claude.ai</span>
- <span class="logo">lobehub</span>
- <span class="logo">agenc.tech</span>
- <span class="logo">pump.fun</span>
- <span class="logo">solana</span>
- <span class="logo">metaplex</span>
- <span class="logo">erc-8004</span>
- <span class="logo">x402</span>
- </div>
- </div>
-</div>
-<!-- ── THE EMBED ─────────────────────────────────────────────────── -->
+ /* ── PLAYGROUND ──────────────────────────────────────────── */
+ .pg {
+ border: 1px solid var(--hairline); border-radius: 14px;
+ overflow: hidden; background: var(--hairline);
+ display: flex; flex-direction: column; gap: 1px;
+ }
+ .pg-toolbar {
+ display: flex; align-items: center; justify-content: space-between;
+ padding: 10px 16px; background: var(--surface-0);
+ }
+ .pg-tabs { display: flex; gap: 2px; }
+ .pg-tab {
+ padding: 5px 12px; border-radius: 5px;
+ font-family: var(--font-mono); font-size: 11.5px;
+ color: var(--text-3); background: transparent; border: 0;
+ cursor: pointer; transition: background 0.12s, color 0.12s;
+ }
+ .pg-tab:hover { color: var(--text-2); }
+ .pg-tab.active { background: var(--surface-2); color: var(--text); }
+ .pg-toolbar-end { display: flex; gap: 6px; align-items: center; }
+ .pg-copy {
+ background: transparent; color: var(--text);
+ border: 1px solid var(--hairline-strong);
+ padding: 5px 12px; border-radius: 6px;
+ font-family: var(--font-mono); font-size: 11.5px;
+ cursor: pointer; transition: border-color 0.15s, background 0.15s;
+ }
+ .pg-copy:hover { border-color: var(--text); }
+ .pg-copy.copied { background: var(--text); color: var(--bg); border-color: var(--text); }
+
+ /* Controls strip */
+ .pg-controls {
+ display: flex; gap: 1px; background: var(--hairline);
+ }
+ @media (max-width: 980px) { .pg-controls { flex-wrap: wrap; } }
+ .pg-control-group {
+ background: var(--surface-0); padding: 10px 16px;
+ display: flex; align-items: center; gap: 10px;
+ }
+ .pg-avatars-group { flex: 1.5; min-width: 0; overflow: hidden; }
+ .pg-control-label {
+ font-family: var(--font-mono); font-size: 10px;
+ letter-spacing: 0.18em; text-transform: uppercase;
+ color: var(--text-4); flex-shrink: 0;
+ }
+ .pg-chips { display: flex; gap: 4px; flex-wrap: wrap; }
+ .pg-chip {
+ padding: 4px 10px; border-radius: 5px;
+ font-family: var(--font-mono); font-size: 11px;
+ color: var(--text-3); background: transparent;
+ border: 1px solid var(--hairline-strong); cursor: pointer;
+ transition: border-color 0.12s, color 0.12s, background 0.12s;
+ white-space: nowrap;
+ }
+ .pg-chip:hover { border-color: var(--text-3); color: var(--text-2); }
+ .pg-chip.active {
+ border-color: rgba(255,255,255,0.5); color: var(--text);
+ background: rgba(255,255,255,0.08);
+ }
+
+ /* Avatar row */
+ .pg-avatar-row {
+ display: flex; gap: 6px; overflow-x: auto;
+ scrollbar-width: none; padding: 2px;
+ }
+ .pg-avatar-row::-webkit-scrollbar { display: none; }
+ .pg-avatar-item {
+ flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
+ border: 2px solid transparent; cursor: pointer; overflow: hidden;
+ transition: border-color 0.15s, transform 0.15s;
+ background: var(--surface-2); padding: 0;
+ }
+ .pg-avatar-item:hover { border-color: var(--text-3); transform: scale(1.1); }
+ .pg-avatar-item.active { border-color: var(--text); }
+ .pg-avatar-item img {
+ width: 100%; height: 100%; object-fit: cover; display: block;
+ border-radius: 50%;
+ }
+ .pg-avatar-item .pg-avatar-initial {
+ width: 100%; height: 100%; display: none;
+ align-items: center; justify-content: center;
+ font-family: var(--font-mono); font-size: 11px; font-weight: 600;
+ color: var(--text-3); text-transform: uppercase; line-height: 1;
+ }
+
+ /* Split: code + preview */
+ .pg-split {
+ display: grid; grid-template-columns: 1fr 1fr;
+ gap: 1px; background: var(--hairline); min-height: 480px;
+ }
+ @media (max-width: 980px) { .pg-split { grid-template-columns: 1fr; } }
+
+ .pg-left {
+ background: var(--surface-0);
+ display: flex; flex-direction: column;
+ }
+ .pg-editor-head {
+ padding: 10px 16px; border-bottom: 1px solid var(--hairline);
+ font-family: var(--font-mono); font-size: 11px;
+ color: var(--text-4); letter-spacing: 0.08em;
+ }
+
+ /* Editor: textarea overlay on pre for highlighting */
+ .pg-editor {
+ position: relative; flex: 1; min-height: 320px;
+ }
+ .pg-editor textarea,
+ .pg-editor pre {
+ font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
+ padding: 20px 24px; margin: 0; border: 0;
+ position: absolute; top: 0; left: 0;
+ width: 100%; height: 100%;
+ white-space: pre; word-wrap: normal; overflow-wrap: normal;
+ tab-size: 2; box-sizing: border-box; overflow: auto;
+ }
+ .pg-editor textarea {
+ resize: none; background: transparent;
+ color: transparent; caret-color: var(--text);
+ z-index: 2; outline: none;
+ -webkit-text-fill-color: transparent;
+ }
+ .pg-editor pre {
+ pointer-events: none; z-index: 1;
+ color: var(--text-2); background: transparent;
+ }
+ .pg-editor pre .tag { color: #d3d3d3; }
+ .pg-editor pre .attr { color: #989898; }
+ .pg-editor pre .str { color: #f6f6f6; }
+ .pg-editor pre .com { color: var(--text-4); }
+ .pg-editor pre .kw { color: var(--text-3); }
+
+ .pg-right {
+ background: var(--surface-0);
+ display: flex; flex-direction: column; position: relative;
+ }
+ .pg-preview-head {
+ padding: 10px 16px; border-bottom: 1px solid var(--hairline);
+ font-family: var(--font-mono); font-size: 11px;
+ color: var(--text-4); letter-spacing: 0.08em;
+ display: flex; justify-content: space-between; align-items: center;
+ }
+ .pg-status {
+ color: var(--text-3); display: flex; align-items: center; gap: 6px;
+ }
+ .pg-status::before {
+ content: ""; width: 5px; height: 5px; border-radius: 50%;
+ background: var(--green); box-shadow: 0 0 5px var(--green);
+ animation: pulse-green 2.4s ease-in-out infinite;
+ }
+ .pg-preview {
+ flex: 1; position: relative; min-height: 340px;
+ transition: background-color 0.3s;
+ overflow: hidden;
+ }
+ .pg-preview agent-3d {
+ position: absolute; inset: 0; display: block;
+ width: 100%; height: 100%;
+ }
+
+ /* Animation bar */
+ .pg-anims {
+ padding: 10px 16px; border-top: 1px solid var(--hairline);
+ display: flex; gap: 4px; flex-wrap: wrap;
+ position: relative; z-index: 2;
+ }
+ .pg-anim {
+ padding: 4px 10px; border-radius: 5px;
+ font-family: var(--font-mono); font-size: 11px;
+ color: var(--text-3); background: transparent;
+ border: 1px solid var(--hairline-strong); cursor: pointer;
+ transition: border-color 0.12s, color 0.12s, background 0.12s;
+ }
+ .pg-anim:hover { border-color: var(--text-3); color: var(--text-2); }
+ .pg-anim.active {
+ border-color: rgba(255,255,255,0.5); color: var(--text);
+ background: rgba(255,255,255,0.08);
+ }
+
+ .pg-copy:focus-visible, .pg-tab:focus-visible, .pg-chip:focus-visible,
+ .pg-anim:focus-visible, .pg-avatar-item:focus-visible {
+ outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px;
+ }
+
+ /* ── COLOR PICKER ────────────────────────────────────────── */
+ .pg-color-trigger {
+ position: relative;
+ width: 26px; height: 26px; border-radius: 6px;
+ border: 1px solid var(--hairline-strong);
+ cursor: pointer; flex-shrink: 0;
+ background: conic-gradient(
+ from 0deg,
+ #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000
+ );
+ transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
+ padding: 0;
+ }
+ .pg-color-trigger:hover {
+ border-color: var(--text-3);
+ transform: scale(1.1);
+ }
+ .pg-color-trigger.active {
+ border-color: var(--text);
+ box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
+ }
+ .pg-color-trigger.has-color {
+ background: var(--pg-picked-color, #888);
+ }
+ .pg-color-popover {
+ position: absolute;
+ top: calc(100% + 8px);
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 50;
+ background: var(--surface-1);
+ border: 1px solid var(--hairline-strong);
+ border-radius: 10px;
+ padding: 14px;
+ box-shadow: 0 12px 40px -8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
+ display: none;
+ flex-direction: column;
+ gap: 10px;
+ width: 220px;
+ }
+ .pg-color-popover.open {
+ display: flex;
+ animation: pg-pop-in 0.18s cubic-bezier(.2,.7,.3,1);
+ }
+ @keyframes pg-pop-in {
+ from { opacity: 0; transform: translateY(-4px) scale(0.97); }
+ to { opacity: 1; transform: translateY(0) scale(1); }
+ }
+ .pg-color-popover-label {
+ font-family: var(--font-mono); font-size: 10px;
+ letter-spacing: 0.15em; text-transform: uppercase;
+ color: var(--text-4);
+ }
+ .pg-color-swatches {
+ display: grid;
+ grid-template-columns: repeat(6, 1fr);
+ gap: 5px;
+ }
+ .pg-color-swatch {
+ width: 100%; aspect-ratio: 1; border-radius: 5px;
+ border: 2px solid transparent;
+ cursor: pointer; padding: 0;
+ transition: border-color 0.12s, transform 0.12s;
+ }
+ .pg-color-swatch:hover {
+ border-color: rgba(255,255,255,0.4);
+ transform: scale(1.12);
+ }
+ .pg-color-swatch.active {
+ border-color: var(--text);
+ }
+ .pg-color-hex-row {
+ display: flex; align-items: center; gap: 6px;
+ }
+ .pg-color-hex-input {
+ flex: 1;
+ background: var(--surface-2);
+ border: 1px solid var(--hairline-strong);
+ border-radius: 5px;
+ padding: 6px 8px;
+ font-family: var(--font-mono);
+ font-size: 12px;
+ color: var(--text);
+ outline: none;
+ transition: border-color 0.15s;
+ }
+ .pg-color-hex-input:focus { border-color: var(--text-3); }
+ .pg-color-preview {
+ width: 28px; height: 28px; border-radius: 5px;
+ border: 1px solid var(--hairline-strong);
+ flex-shrink: 0;
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .pg-status::before { animation: none !important; }
+ }
+
+ /* ── LIVE FEATURE AGENTS ──────────────────────────────────── */
+ .door-screenshot { position: relative; }
+ .door-agent { position: absolute; inset: 0; }
+ .door-agent agent-3d {
+ width: 100%; height: 100%; display: block;
+ pointer-events: none;
+ transition: transform 0.4s cubic-bezier(.2,.7,.3,1);
+ }
+ .door:hover .door-agent agent-3d { transform: scale(1.03); }
+ .door-earn-overlay {
+ position: absolute; bottom: 10px; left: 10px; right: 10px;
+ padding: 10px 14px; z-index: 2;
+ background: rgba(5,5,5,0.82); backdrop-filter: blur(12px);
+ border: 1px solid var(--hairline-strong); border-radius: 7px;
+ display: flex; justify-content: space-between; align-items: baseline;
+ pointer-events: none;
+ }
+ .door-earn-val {
+ font-family: var(--font-display); font-size: 18px; font-weight: 600;
+ letter-spacing: -0.02em; color: var(--text);
+ font-variant-numeric: tabular-nums;
+ }
+ .door-earn-lbl {
+ font-family: var(--font-mono); font-size: 9px;
+ letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-3);
+ }
+ .bento-screenshot { position: relative; }
+ .bento-agent { position: absolute; inset: 0; }
+ .bento-agent agent-3d { width: 100%; height: 100%; display: block; }
+ .bento-agent-mini {
+ position: relative; height: 200px;
+ border-radius: 7px; overflow: hidden;
+ border: 1px solid var(--hairline-strong);
+ background: var(--surface-2); margin-top: 8px;
+ }
+ .bento-agent-mini agent-3d {
+ position: absolute; inset: 0;
+ width: 100%; height: 100%; display: block;
+ }
+ .bento-pill-btn {
+ cursor: pointer; background: transparent;
+ font-family: var(--font-mono); font-size: 11px;
+ letter-spacing: 0.1em; text-transform: uppercase;
+ color: var(--text-3); border: 1px solid var(--hairline-strong);
+ padding: 3px 8px; border-radius: 4px;
+ transition: border-color 0.12s, color 0.12s, background 0.12s;
+ }
+ .bento-pill-btn:hover { border-color: var(--text-3); color: var(--text-2); }
+ .bento-pill-btn.active {
+ border-color: rgba(255,255,255,0.5); color: var(--text);
+ background: rgba(255,255,255,0.08);
+ }
+
+ /* ── WALK IFRAME ─────────────────────────────────────────── */
+ .walk-iframe-wrap {
+ position: relative; aspect-ratio: 4/3;
+ overflow: hidden; border-radius: 0 0 13px 13px;
+ }
+ .walk-iframe {
+ position: absolute; inset: 0;
+ width: 100%; height: 100%; border: 0;
+ background: var(--surface-2);
+ }
+
+ /* ── AVATAR DROP ──────────────────────────────────────────────── */
+ .body-drop {
+ position: relative;
+ min-height: 70vh;
+ display: flex;
+ align-items: center;
+ overflow: visible;
+ }
+ .body-drop-content {
+ position: relative; z-index: 10;
+ max-width: 560px;
+ padding: 80px 0 140px;
+ }
+ .body-drop-title {
+ font-family: var(--font-display);
+ font-size: clamp(44px, 5.5vw, 80px);
+ line-height: 0.95; letter-spacing: -0.04em;
+ font-weight: 600; margin: 0 0 24px;
+ }
+ .body-drop-title em { font-style: normal; color: var(--text-3); font-weight: 500; }
+ #drop-sit-line {
+ text-shadow: var(--drop-shadow, none);
+ transition: text-shadow 90ms linear;
+ }
+ .body-drop-sub {
+ font-size: 17px; color: var(--text-2);
+ max-width: 440px; line-height: 1.55; margin: 0 0 44px;
+ }
+ #drop-canvas {
+ position: absolute; inset: 0;
+ width: 100%; height: 100%;
+ pointer-events: none; z-index: 20;
+ }
+ .body-drop .cta-row { position: relative; z-index: 10; }
+ .body-drop .btn { transform-origin: bottom center; will-change: transform; }
+ @media (max-width: 720px) {
+ .body-drop { min-height: auto; }
+ .body-drop-content { padding: 48px 0 100px; }
+ }
+
+ /* ── MANIFESTO ──────────────────────────────────────────── */
+ .manifesto {
+ display: flex;
+ flex-direction: column;
+ gap: 0;
+ }
+ .manifesto-beat {
+ padding: 64px 0;
+ border-bottom: 1px solid var(--hairline);
+ }
+ .manifesto-beat:first-child { padding-top: 0; }
+ .manifesto-beat:last-child { border-bottom: none; padding-bottom: 0; }
+
+ .manifesto-statement {
+ font-family: var(--font-display);
+ font-size: clamp(36px, 4.8vw, 68px);
+ line-height: 1.05;
+ letter-spacing: -0.04em;
+ font-weight: 600;
+ margin: 0;
+ color: var(--text);
+ }
+ .manifesto-statement em {
+ font-style: normal;
+ color: var(--text-3);
+ font-weight: 500;
+ }
+ .manifesto-statement--dim {
+ color: var(--text-3);
+ }
+
+ .manifesto-aside {
+ font-size: 17px;
+ color: var(--text-3);
+ margin: 20px 0 0;
+ max-width: 540px;
+ line-height: 1.6;
+ }
+
+ .manifesto-steps {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ }
+ .manifesto-step {
+ font-family: var(--font-display);
+ font-size: clamp(22px, 2.8vw, 36px);
+ font-weight: 500;
+ letter-spacing: -0.02em;
+ color: var(--text-4);
+ line-height: 1.2;
+ }
+ .manifesto-step:nth-child(2) { color: var(--text-3); }
+ .manifesto-step:nth-child(3) { color: var(--text-2); }
+
+ .manifesto-lead {
+ font-size: clamp(18px, 2vw, 22px);
+ color: var(--text-3);
+ margin: 0 0 28px;
+ line-height: 1.5;
+ max-width: 480px;
+ }
+ .manifesto-keyword {
+ font-family: var(--font-display);
+ font-size: clamp(80px, 14vw, 180px);
+ line-height: 0.88;
+ letter-spacing: -0.055em;
+ font-weight: 700;
+ margin: 0;
+ color: var(--text);
+ position: relative;
+ }
+ .manifesto-keyword::after {
+ content: "";
+ position: absolute;
+ left: 0; right: 30%; bottom: -4px;
+ height: 2px;
+ background: linear-gradient(90deg, var(--text-3), transparent);
+ opacity: 0.4;
+ }
+
+ .manifesto-negations {
+ margin-bottom: 36px;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ }
+ .manifesto-neg {
+ font-size: clamp(16px, 1.6vw, 19px);
+ color: var(--text-4);
+ margin: 0;
+ line-height: 1.5;
+ text-decoration: line-through;
+ text-decoration-color: rgba(255,255,255,0.15);
+ text-decoration-thickness: 1px;
+ }
+ .manifesto-affirmation {
+ font-family: var(--font-display);
+ font-size: clamp(24px, 3vw, 40px);
+ line-height: 1.2;
+ letter-spacing: -0.025em;
+ font-weight: 600;
+ color: var(--text);
+ margin: 0;
+ max-width: 640px;
+ }
+
+ .manifesto-body {
+ font-size: 17px;
+ color: var(--text-2);
+ margin: 28px 0 0;
+ max-width: 560px;
+ line-height: 1.65;
+ }
+
+ .manifesto-caps {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+ margin-bottom: 28px;
+ }
+ .manifesto-cap {
+ font-family: var(--font-mono);
+ font-size: 11.5px;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--text-2);
+ padding: 8px 16px;
+ border: 1px solid var(--hairline-strong);
+ border-radius: 999px;
+ transition: border-color 0.2s, color 0.2s, background 0.2s;
+ }
+ .manifesto-cap:hover {
+ border-color: var(--text-3);
+ color: var(--text);
+ background: rgba(255,255,255,0.03);
+ }
+
+ .manifesto-close-dim {
+ font-family: var(--font-display);
+ font-size: clamp(22px, 2.8vw, 36px);
+ font-weight: 500;
+ letter-spacing: -0.02em;
+ color: var(--text-4);
+ margin: 0 0 12px;
+ line-height: 1.15;
+ }
+ .manifesto-close {
+ font-family: var(--font-display);
+ font-size: clamp(40px, 5.5vw, 76px);
+ line-height: 1.0;
+ letter-spacing: -0.04em;
+ font-weight: 600;
+ margin: 0;
+ color: var(--text);
+ }
+
+ .manifesto-embed {
+ font-family: var(--font-mono);
+ font-size: 13px;
+ color: var(--text-3);
+ margin: 20px 0 0;
+ letter-spacing: 0.02em;
+ }
+ .manifesto-embed code {
+ color: var(--text);
+ font-weight: 500;
+ }
+
+ @media (max-width: 720px) {
+ .manifesto-beat { padding: 44px 0; }
+ .manifesto-keyword::after { right: 10%; }
+ }
+ /* ── INTERACTIVE BENTO DEMOS ─────────────────────────────── */
+ .bento-interact{margin-top:10px;position:relative}
+ .bento-action-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border-radius:7px;font-family:var(--font-mono);font-size:11.5px;letter-spacing:0.06em;color:var(--text);background:var(--surface-2);border:1px solid var(--hairline-strong);cursor:pointer;transition:border-color .15s,background .15s,transform .12s}
+ .bento-action-btn:hover{border-color:var(--text-3);background:rgba(255,255,255,.06);transform:translateY(-1px)}
+ .bento-action-btn:active{transform:translateY(0)}
+ .bento-action-btn:focus-visible{outline:2px solid rgba(255,255,255,.5);outline-offset:2px}
+ .bento-action-btn.sm{padding:5px 11px;font-size:10.5px}
+ .studio-zone{display:flex;gap:8px;align-items:stretch}
+ .studio-drop{flex:1;border:1px dashed var(--hairline-strong);border-radius:8px;padding:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;cursor:pointer;transition:border-color .2s,background .2s;font-family:var(--font-mono);font-size:11px;color:var(--text-3);text-align:center;min-height:80px}
+ .studio-drop:hover,.studio-drop.drag-over{border-color:var(--text-2);background:rgba(255,255,255,.03)}
+ .studio-drop-icon{font-size:22px;opacity:.5}
+ .studio-processing{display:none;align-items:center;justify-content:center;gap:10px;padding:12px;font-family:var(--font-mono);font-size:11px;color:var(--text-3)}
+ .studio-processing.active{display:flex}
+ .studio-processing-ring{width:18px;height:18px;border:2px solid var(--hairline-strong);border-top-color:var(--text-2);border-radius:50%;animation:walk-spin .7s linear infinite}
+ .studio-preview-img{width:48px;height:48px;border-radius:50%;object-fit:cover;border:1px solid var(--hairline-strong);display:none}
+ .studio-preview-img.show{display:block}
+ .studio-done{display:none;align-items:center;gap:8px;font-family:var(--font-mono);font-size:11px;color:var(--text-2)}
+ .studio-done.show{display:flex}
+ .studio-done-check{width:18px;height:18px;border-radius:50%;background:var(--text);color:var(--bg);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700}
+ .mocap-demo{display:flex;flex-direction:column;gap:8px}
+ .mocap-bar{display:flex;align-items:center;gap:10px}
+ .mocap-waveform{width:100%;height:48px;border-radius:6px;background:var(--surface-2);border:1px solid var(--hairline-strong);display:block}
+ .mocap-status{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;color:var(--text-4);text-align:center}
+ .mocap-status.live{color:var(--text-2)}
+ .walk-minimap-wrap{position:relative;border-radius:8px;overflow:hidden;border:1px solid var(--hairline-strong);background:#0a0d12}
+ .walk-minimap{width:100%;height:140px;display:block;cursor:crosshair}
+ .walk-minimap:focus{outline:2px solid rgba(255,255,255,.3);outline-offset:-2px}
+ .walk-minimap-hud{position:absolute;top:6px;left:8px;display:flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:9px;color:var(--text-3);letter-spacing:.08em}
+ .walk-minimap-dot{width:5px;height:5px;border-radius:50%;background:#4ade80;box-shadow:0 0 4px #4ade8088}
+ .walk-minimap-hint{position:absolute;bottom:6px;left:50%;transform:translateX(-50%);font-family:var(--font-mono);font-size:8.5px;color:var(--text-4);letter-spacing:.06em;white-space:nowrap}
+ .walk-minimap-hint kbd{display:inline-block;padding:0 3px;border:1px solid var(--hairline-strong);border-radius:2px;font-family:var(--font-mono);font-size:8px;background:var(--surface-2)}
+ .x402-demo{display:flex;flex-direction:column;gap:8px}
+ .x402-step{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:8px;transition:all .3s ease}
+ .x402-code{font-family:var(--font-mono);font-size:11.5px;color:var(--text-2);flex:1}
+ .x402-code.err{color:#f87171}
+ .x402-code.ok{color:#4ade80}
+ .x402-spinner{width:16px;height:16px;border:2px solid var(--hairline-strong);border-top-color:var(--text-2);border-radius:50%;animation:walk-spin .6s linear infinite;display:none}
+ .x402-amount{font-family:var(--font-display);font-size:14px;font-weight:600;color:#4ade80;display:none}
+ .x402-amount.show{display:block}
+ .mint-demo{perspective:600px}
+ .mint-card{position:relative;padding:16px;background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:10px;transition:transform .6s cubic-bezier(.2,.7,.3,1),box-shadow .3s,border-color .3s}
+ .mint-card.minted{border-color:rgba(255,255,255,.2);box-shadow:0 0 20px -4px rgba(255,255,255,.08)}
+ .mint-card-inner{display:flex;align-items:center;justify-content:space-between;gap:10px}
+ .mint-card-info{display:flex;flex-direction:column;gap:2px}
+ .mint-card-label{font-family:var(--font-mono);font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:var(--text-4);transition:color .3s}
+ .mint-card-name{font-family:var(--font-display);font-size:16px;font-weight:600;color:var(--text)}
+ .mint-card-chain{font-family:var(--font-mono);font-size:10px;color:var(--text-3);display:none}
+ .mint-card.minted .mint-card-chain{display:block}
+ .mint-card.minted .mint-card-label{color:#4ade80}
+ .mint-progress{width:28px;height:28px;position:relative;display:none}
+ .mint-progress.active{display:block}
+ .mint-progress svg{width:100%;height:100%;transform:rotate(-90deg)}
+ .mint-progress circle{fill:none;stroke-width:3;stroke:var(--text-2);stroke-linecap:round;stroke-dasharray:78.5;stroke-dashoffset:78.5;transition:stroke-dashoffset 1.2s cubic-bezier(.2,.7,.3,1)}
+ .mint-progress.done circle{stroke-dashoffset:0;stroke:#4ade80}
+ .skill-demo{display:flex;flex-direction:column;gap:8px}
+ .skill-result{background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:7px;padding:10px 14px;font-family:var(--font-mono);font-size:11px;color:var(--text-2);line-height:1.6;max-height:100px;overflow-y:auto;transition:border-color .3s}
+ .skill-result.fresh{border-color:rgba(255,255,255,.2)}
+ .skill-result .json-key{color:#60a5fa}
+ .skill-result .json-str{color:#4ade80}
+ .skill-result .json-num{color:#fbbf24}
+ .memory-demo{display:flex;flex-direction:column;gap:8px}
+ .memory-input-row{display:flex;gap:6px}
+ .memory-input{flex:1;background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:6px;padding:7px 10px;font-family:var(--font-mono);font-size:11.5px;color:var(--text);outline:none;transition:border-color .15s}
+ .memory-input:focus{border-color:var(--text-3)}
+ .memory-input::placeholder{color:var(--text-4)}
+ .memory-log{display:flex;flex-direction:column;gap:4px;max-height:72px;overflow-y:auto}
+ .memory-entry{font-family:var(--font-mono);font-size:10.5px;color:var(--text-3);line-height:1.5;padding:3px 0;animation:mem-in .3s ease}
+ .memory-entry .mem-op{color:var(--text-4);margin-right:4px}
+ .memory-entry .mem-val{color:var(--text-2)}
+ @keyframes mem-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
+ .ar-demo{display:flex;align-items:center;gap:12px}
+ .ar-phone{width:64px;height:100px;border:2px solid var(--hairline-strong);border-radius:10px;background:var(--surface-2);position:relative;overflow:hidden;flex-shrink:0;transition:border-color .3s}
+ .ar-phone.active{border-color:var(--text-3)}
+ .ar-phone-notch{width:24px;height:4px;background:var(--hairline-strong);border-radius:2px;margin:4px auto 0}
+ .ar-phone-screen{position:absolute;inset:10px 3px 6px;background:#111;border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden}
+ .ar-phone-avatar{width:32px;height:32px;border-radius:50%;background:var(--surface-1);border:1px solid var(--hairline-strong);display:flex;align-items:center;justify-content:center;font-size:14px;opacity:0;transition:opacity .4s,transform .4s}
+ .ar-phone.active .ar-phone-avatar{opacity:1;transform:scale(1.1)}
+ .ar-phone-crosshair{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transition:opacity .3s}
+ .ar-phone.active .ar-phone-crosshair{opacity:.5}
+ .ar-phone-crosshair::before,.ar-phone-crosshair::after{content:'';position:absolute;background:var(--text-3)}
+ .ar-phone-crosshair::before{width:16px;height:1px}
+ .ar-phone-crosshair::after{width:1px;height:16px}
+ .ar-info{display:flex;flex-direction:column;gap:4px}
+ .ar-status{font-family:var(--font-mono);font-size:10px;color:var(--text-4);letter-spacing:.08em}
+ .ar-status.ready{color:#4ade80}
+ .mktplace-strip{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px 0}
+ .mktplace-strip::-webkit-scrollbar{display:none}
+ .mktplace-item{flex-shrink:0;width:52px;height:52px;border-radius:10px;overflow:hidden;border:1px solid var(--hairline-strong);cursor:pointer;background:var(--surface-2);transition:border-color .15s,transform .15s;position:relative;display:block}
+ .mktplace-item:hover{border-color:var(--text-3);transform:translateY(-2px)}
+ .mktplace-item img{width:100%;height:100%;object-fit:cover;display:block}
+ .mktplace-item-name{position:absolute;bottom:0;left:0;right:0;padding:2px 4px;font-family:var(--font-mono);font-size:7px;color:var(--text);background:rgba(0,0,0,.7);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+ .mktplace-more{flex-shrink:0;width:52px;height:52px;border-radius:10px;border:1px dashed var(--hairline-strong);display:flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:18px;color:var(--text-4);cursor:pointer;transition:border-color .15s,color .15s;text-decoration:none}
+ .mktplace-more:hover{border-color:var(--text-3);color:var(--text-2)}
+ .analytics-demo{display:flex;flex-direction:column;gap:10px}
+ .analytics-counters{display:flex;gap:16px}
+ .analytics-counter{display:flex;flex-direction:column;gap:1px}
+ .analytics-val{font-family:var(--font-display);font-size:18px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;letter-spacing:-0.02em}
+ .analytics-lbl{font-family:var(--font-mono);font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-4)}
+ .analytics-spark{width:100%;height:40px;display:block}
+ .analytics-spark path{fill:none;stroke:var(--text-2);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
+ .analytics-spark .spark-fill{fill:url(#spark-grad);stroke:none;opacity:.15}
+ .analytics-spark .spark-dot{fill:var(--text);r:2.5;animation:spark-pulse 2s ease-in-out infinite}
+ @keyframes spark-pulse{0%,100%{opacity:1}50%{opacity:.4}}
+ </style>
+ <noscript><style>.reveal{opacity:1!important;transform:none!important}.hero-text>*{opacity:1!important;transform:none!important}</style></noscript>
+ <script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
+</head>
+<body>
+
+<!-- ── NAV ──────────────────────────────────────────────────────── -->
+<header class="nav">
+ <div class="nav-inner">
+ <a class="brand" href="/">
+ <span class="brand-mark"></span>
+ <span>three.ws</span>
+ </a>
+ <nav class="nav-main" aria-label="Primary">
+ <a href="/create">Build</a>
+ <a href="#embed">Embed</a>
+ <a href="/discover">Discover</a>
+ <a href="/pricing">Pricing</a>
+ <a href="/docs">Docs</a>
+ </nav>
+ <div class="nav-end">
+ <a href="/login">Sign in</a>
+ <a class="console" href="/dashboard">Console →</a>
+ </div>
+ <button class="nav-toggle" aria-label="Menu" aria-expanded="false" id="nav-toggle">
+ <svg class="open" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/></svg>
+ <svg class="close" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"><line x1="3" y1="3" x2="13" y2="13"/><line x1="13" y1="3" x2="3" y2="13"/></svg>
+ </button>
+ </div>
+</header>
+<nav class="nav-drawer" id="nav-drawer" aria-label="Mobile" aria-hidden="true">
+ <a href="/create">Build</a>
+ <a href="#embed">Embed</a>
+ <a href="/discover">Discover</a>
+ <a href="/pricing">Pricing</a>
+ <a href="/docs">Docs</a>
+ <div class="sep"></div>
+ <a href="/login">Sign in</a>
+ <a class="btn primary" href="/dashboard" style="margin-top:4px;">Console →</a>
+</nav>
+
+<!-- ── HERO ─────────────────────────────────────────────────────── -->
+<section class="hero">
+ <div class="hero-text">
+ <div class="eyebrow">Open beta · live now</div>
+ <h1 class="hero-h">
+ The 3D agent<br/>
+ layer of the<br/>
+ <em>internet.</em>
+ </h1>
+ <ul class="hero-bullets">
+ <li><strong>Create</strong> a 3D AI agent from a selfie in 60 seconds</li>
+ <li><strong>Embed</strong> it on any website with two lines of HTML</li>
+ <li><strong>Earn</strong> USDC per chat with x402 micropayments</li>
+ </ul>
+ <div class="hero-cta-row">
+ <a class="btn primary" href="/create">Build your agent <span class="arrow">→</span></a>
+ <a class="btn" href="#embed">See the embed</a>
+ </div>
+ </div>
+ <div class="hero-stage" id="hero-stage">
+ <span class="stage-marker">live</span>
+ <div class="hero-stage-shimmer" id="hero-shimmer"></div>
+ <div class="hero-stage-inner" id="hero-stage-inner"></div>
+ <div class="hero-thought" id="hero-thought" aria-live="polite" aria-atomic="true">
+ <div class="hero-thought-inner" id="hero-thought-text"></div>
+ <div class="hero-thought-tail"></div>
+ </div>
+ <div class="hero-chat-bar" id="hero-chat-bar">
+ <form class="hero-chat-form" id="hero-chat-form" autocomplete="off">
+ <input class="hero-chat-input" id="hero-chat-input" type="text" placeholder="Ask the avatar anything..." aria-label="Chat with the avatar" />
+ <button class="hero-chat-send" id="hero-chat-send" type="submit" aria-label="Send message">
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2L7 9"/><path d="M14 2L9.5 14L7 9L2 6.5L14 2Z"/></svg>
+ </button>
+ </form>
+ <div class="hero-chat-hint">press enter to chat</div>
+ </div>
+ <div class="stage-meta">
+ <span>nich</span>
+ <span>/api/avatars/bacff13e</span>
+ </div>
+ <div class="hero-chips-wrap" id="hero-chips-wrap">
+ <div class="hero-chips-label">
+ <span>click to animate · <strong class="hero-chips-counter" id="hero-chips-counter">0 moves</strong></span>
+ </div>
+ <div class="hero-chips" id="hero-chips" role="group" aria-label="Trigger an animation on the hero avatar">
+ <button type="button" class="hero-chip hero-chip--rand" data-anim="__random">🎲 Random</button>
+ <button type="button" class="hero-chip" data-anim="wave">👋 Wave</button>
+ <button type="button" class="hero-chip" data-anim="dance">💃 Dance</button>
+ <button type="button" class="hero-chip" data-anim="capoeira">🤸 Capoeira</button>
+ <button type="button" class="hero-chip" data-anim="jump">🦘 Jump</button>
+ <button type="button" class="hero-chip" data-anim="thriller">🧟 Thriller</button>
+ <button type="button" class="hero-chip" data-anim="pray">🙏 Pray</button>
+ </div>
+ </div>
+ </div>
+</section>
+
+<!-- ── STATS BAR ─────────────────────────────────────────────────── -->
+<div class="stats-bar" id="stats-bar">
+ <div class="stats-bar-inner">
+ <div class="stat-cell">
+ <div class="stat-val" id="sb-agents">—</div>
+ <div class="stat-lbl">Agents live</div>
+ </div>
+ <div class="stat-cell">
+ <div class="stat-val" id="sb-widgets">—</div>
+ <div class="stat-lbl">Widgets deployed</div>
+ </div>
+ <div class="stat-cell">
+ <div class="stat-val" id="sb-onchain">—</div>
+ <div class="stat-lbl">On-chain agents</div>
+ </div>
+ <div class="stat-cell">
+ <div class="stat-val">200+</div>
+ <div class="stat-lbl">Animation clips</div>
+ </div>
+ <div class="stat-cell">
+ <div class="stat-val">&lt;2 lines</div>
+ <div class="stat-lbl">To embed</div>
+ </div>
+ </div>
+</div>
+
+<!-- ── LOGO STRIP ────────────────────────────────────────────────── -->
+<div class="logo-strip">
+ <div class="wrap-1280">
+ <div class="logo-strip-cap">Embedded across the web</div>
+ <div class="logo-row">
+ <span class="logo">claude.ai</span>
+ <span class="logo">lobehub</span>
+ <span class="logo">agenc.tech</span>
+ <span class="logo">pump.fun</span>
+ <span class="logo">solana</span>
+ <span class="logo">metaplex</span>
+ <span class="logo">erc-8004</span>
+ <span class="logo">x402</span>
+ </div>
+ </div>
+</div>
+
+<!-- ── PLAYGROUND ──────────────────────────────────────────────────── -->
<section class="block" id="embed">
<div class="wrap-1280">
<div class="block-head reveal">
- <p class="block-eyebrow"><span class="num">01</span>The embed</p>
- <h2 class="block-h">Two lines. <em>Any HTML.</em></h2>
+ <p class="block-eyebrow"><span class="num">01</span>Playground</p>
+ <h2 class="block-h">Try it live. <em>Ship it now.</em></h2>
<p class="block-lede">
- Copy these into any page on the web. The agent on the right is rendered
- by the exact code on the left — no iframe, no SDK install, no build step required.
+ Edit the code below — the preview updates instantly. Switch avatars, trigger animations, toggle features. Copy two lines when you're done.
</p>
</div>
- <div class="embed-grid reveal reveal-d1">
- <div class="pane code-pane">
- <div class="pane-head">
- <div class="tabs">
- <button class="tab active" data-flavor="html">HTML</button>
- <button class="tab" data-flavor="react">React</button>
- <button class="tab" data-flavor="vue">Vue</button>
+ <div class="pg reveal reveal-d1">
+ <div class="pg-toolbar">
+ <div class="pg-tabs" id="pg-tabs">
+ <button class="pg-tab active" data-flavor="html">HTML</button>
+ <button class="pg-tab" data-flavor="react">React</button>
+ <button class="pg-tab" data-flavor="vue">Vue</button>
+ </div>
+ <div class="pg-toolbar-end">
+ <button class="pg-copy" id="pg-copy">Copy</button>
+ </div>
+ </div>
+ <div class="pg-controls">
+ <div class="pg-control-group pg-avatars-group">
+ <span class="pg-control-label">Avatar</span>
+ <div class="pg-avatar-row" id="pg-avatars"></div>
+ </div>
+ <div class="pg-control-group">
+ <span class="pg-control-label">Mode</span>
+ <div class="pg-chips" id="pg-mode-chips">
+ <button class="pg-chip active" data-val="inline">inline</button>
+ <button class="pg-chip" data-val="widget">widget</button>
+ </div>
+ </div>
+ <div class="pg-control-group" style="position:relative">
+ <span class="pg-control-label">BG</span>
+ <div class="pg-chips" id="pg-bg-chips">
+ <button class="pg-chip active" data-val="transparent">none</button>
+ <button class="pg-chip" data-val="#0b0b0b">dark</button>
+ <button class="pg-chip" data-val="#ffffff">light</button>
+ </div>
+ <button class="pg-color-trigger" id="pg-color-trigger" aria-label="Pick a custom background color" title="Custom color"></button>
+ <div class="pg-color-popover" id="pg-color-popover">
+ <span class="pg-color-popover-label">Pick a color</span>
+ <div class="pg-color-swatches" id="pg-color-swatches"></div>
+ <div class="pg-color-hex-row">
+ <div class="pg-color-preview" id="pg-color-preview"></div>
+ <input class="pg-color-hex-input" id="pg-color-hex" type="text" placeholder="#1a1a2e" maxlength="7" spellcheck="false" autocomplete="off" />
+ </div>
+ </div>
+ </div>
+ <div class="pg-control-group">
+ <span class="pg-control-label">Features</span>
+ <div class="pg-chips" id="pg-option-chips">
+ <button class="pg-chip active" data-attr="responsive">responsive</button>
+ <button class="pg-chip" data-attr="name-plate" data-val="on">nameplate</button>
+ <button class="pg-chip" data-attr="avatar-chat" data-val="on">chat</button>
+ <button class="pg-chip active" data-attr="eager">eager</button>
+ </div>
+ </div>
+ </div>
+ <div class="pg-split">
+ <div class="pg-left">
+ <div class="pg-editor-head">index.html</div>
+ <div class="pg-editor" id="pg-editor">
+ <textarea id="pg-textarea" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off"></textarea>
+ <pre id="pg-highlight" aria-hidden="true"></pre>
</div>
- <span>index.html</span>
</div>
-<pre id="embed-snippet"><span class="tag">&lt;script</span> <span class="attr">type</span>=<span class="str">"module"</span>
- <span class="attr">src</span>=<span class="str">"https://three.ws/agent-3d/latest/agent-3d.js"</span><span class="tag">&gt;&lt;/script&gt;</span>
+ <div class="pg-right">
+ <div class="pg-preview-head">
+ <span>↪ live preview</span>
+ <span class="pg-status">running</span>
+ </div>
+ <div class="pg-preview" id="pg-preview"></div>
+ <div class="pg-anims" id="pg-anims">
+ <button class="pg-anim" data-anim="idle">Idle</button>
+ <button class="pg-anim" data-anim="wave">Wave</button>
+ <button class="pg-anim" data-anim="dance">Dance</button>
+ <button class="pg-anim" data-anim="capoeira">Capoeira</button>
+ <button class="pg-anim" data-anim="jump">Jump</button>
+ <button class="pg-anim" data-anim="thriller">Thriller</button>
+ <button class="pg-anim" data-anim="celebrate">Celebrate</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</section>
+
+<!-- ── MANIFESTO ────────────────────────────────────────────────── -->
+<section class="block" id="editorial">
+ <div class="wrap-1280">
+ <div class="manifesto">
+
+ <div class="manifesto-beat reveal">
+ <h2 class="manifesto-statement manifesto-statement--dim">The web was built<br>for documents.</h2>
+ <p class="manifesto-aside">Text, images, links &mdash; a flat canvas for static information.</p>
+ </div>
+
+ <div class="manifesto-beat reveal">
+ <div class="manifesto-steps">
+ <span class="manifesto-step">Then came video.</span>
+ <span class="manifesto-step">Then interactivity.</span>
+ <span class="manifesto-step">Then AI.</span>
+ </div>
+ </div>
-<span class="tag">&lt;agent-3d</span>
- <span class="attr">src</span>=<span class="str">"https://three.ws/api/avatars/bacff13e…"</span>
-<span class="tag">&gt;&lt;/agent-3d&gt;</span>
+ <div class="manifesto-beat reveal">
+ <p class="manifesto-lead">But something fundamental was always missing &mdash;</p>
+ <h2 class="manifesto-keyword">presence.</h2>
+ </div>
-<span class="com">// Voice, memory, animations, and payments included.</span>
-<span class="com">// Works in React, Vue, Svelte, plain HTML.</span></pre>
- <div class="pane-foot">
- <button class="copy-btn" id="copy-btn">Copy</button>
+ <div class="manifesto-beat reveal">
+ <div class="manifesto-negations">
+ <p class="manifesto-neg">Not a chatbot tucked into a corner.</p>
+ <p class="manifesto-neg">Not a popup demanding attention.</p>
</div>
+ <p class="manifesto-affirmation">A living digital being that inhabits your space, knows your visitors, and works while you sleep.</p>
</div>
- <div class="pane render-pane">
- <div class="pane-head">
- <span>↪ live render</span>
- <span style="color: var(--text-3);">running</span>
+
+ <div class="manifesto-beat reveal">
+ <h2 class="manifesto-statement">three.ws gives your AI <em>a body.</em></h2>
+ <p class="manifesto-body">A 3D character generated from a single photograph, deployed with two lines of HTML, monetized through micropayments that settle instantly. Every agent remembers across sessions, moves through multiplayer worlds, and earns revenue via the x402 payment protocol.</p>
+ </div>
+
+ <div class="manifesto-beat reveal">
+ <div class="manifesto-caps">
+ <span class="manifesto-cap">200+ animations</span>
+ <span class="manifesto-cap">Real-time voice</span>
+ <span class="manifesto-cap">On-chain identity</span>
+ <span class="manifesto-cap">Cross-device memory</span>
+ <span class="manifesto-cap">Spatial multiplayer</span>
+ <span class="manifesto-cap">x402 payments</span>
</div>
- <div class="live-agent-slot"></div>
+ <p class="manifesto-embed">All from one embed tag: <code>&lt;agent-3d&gt;</code></p>
</div>
+
+ <div class="manifesto-beat reveal">
+ <p class="manifesto-close-dim">The flat web had its moment.</p>
+ <h2 class="manifesto-close">The living web starts now.</h2>
+ </div>
+
</div>
</div>
</section>
@@ -976,7 +2391,7 @@
<a class="door" href="/create">
<div class="door-num"><span>01</span><span class="lbl">Create</span></div>
<div class="door-screenshot">
- <img src="/screenshots/create.png" alt="Avatar creation flow" loading="lazy" />
+ <div class="door-agent" id="door-create"></div>
</div>
<h3>Selfie to agent in 60 seconds.</h3>
<p>Snap a selfie or upload a GLB. Add a personality prompt, pick a voice, wire up your AI. Publish to the marketplace or keep it private.</p>
@@ -985,7 +2400,7 @@
<a class="door" href="/docs">
<div class="door-num"><span>02</span><span class="lbl">Embed</span></div>
<div class="door-screenshot">
- <img src="/screenshots/viewer.png" alt="Agent embed in a live site" loading="lazy" />
+ <div class="door-agent" id="door-embed"></div>
</div>
<h3>Two lines. Any page.</h3>
<p>Drop <code>&lt;agent-3d&gt;</code> into any page. React, Vue, Svelte, plain HTML. Voice, memory, animation, and payments built-in. Lazy-loaded by default.</p>
@@ -994,7 +2409,11 @@
<a class="door" href="/dashboard/monetize">
<div class="door-num"><span>03</span><span class="lbl">Earn</span></div>
<div class="door-screenshot">
- <img src="/screenshots/features.png" alt="Monetization dashboard" loading="lazy" />
+ <div class="door-agent" id="door-earn"></div>
+ <div class="door-earn-overlay">
+ <div class="door-earn-val" id="door-earn-val">$0.00</div>
+ <div class="door-earn-lbl">USDC earned</div>
+ </div>
</div>
<h3>Charge per chat. Keep everything.</h3>
<p>Gate skills behind x402 USDC micropayments. Keep 100% during open beta. Watch earnings flow in real-time from your dashboard.</p>
@@ -1023,8 +2442,27 @@
</div>
<p class="bento-title">Selfie → 3D avatar in 60 seconds</p>
<p class="bento-desc">Upload a photo, webcam shot, or existing GLB. Our pipeline generates a fully rigged, animatable 3D character compatible with VRM, ReadyPlayerMe, and Avaturn formats. Retargets to any animation clip instantly.</p>
+ <div class="bento-interact" id="studio-interact">
+ <div class="studio-zone" id="studio-zone">
+ <div class="studio-drop" id="studio-drop">
+ <div class="studio-drop-icon">↑</div>
+ <span>Drop a selfie or click to upload</span>
+ <input type="file" accept="image/*" id="studio-file" style="display:none" />
+ </div>
+ <button class="bento-action-btn studio-webcam-btn" id="studio-webcam-btn">Webcam</button>
+ </div>
+ <div class="studio-processing" id="studio-processing">
+ <div class="studio-processing-ring"></div>
+ <img class="studio-preview-img" id="studio-preview-img" alt="" />
+ <span id="studio-processing-text">Generating 3D mesh...</span>
+ </div>
+ <div class="studio-done" id="studio-done">
+ <div class="studio-done-check">✓</div>
+ <span>Avatar generated — rigged &amp; ready</span>
+ </div>
+ </div>
<div class="bento-screenshot">
- <img src="/screenshots/studio.png" alt="Avatar studio" loading="lazy" />
+ <div class="bento-agent" id="bento-studio"></div>
</div>
<div class="bento-pills">
<span class="bento-pill">VRM</span>
@@ -1043,11 +2481,14 @@
</div>
<p class="bento-title">200+ motion clips</p>
<p class="bento-desc">Walk, dance, gesture, emote — a full library of idle loops and triggered animations that blend seamlessly. Or upload your own FBX/BVH captures.</p>
- <div class="bento-pills">
- <span class="bento-pill">Idle loops</span>
- <span class="bento-pill">Walk cycle</span>
- <span class="bento-pill">Emotes</span>
- <span class="bento-pill">Custom FBX</span>
+ <div class="bento-agent-mini" id="bento-anim"></div>
+ <div class="bento-pills" id="bento-anim-pills">
+ <button class="bento-pill bento-pill-btn" data-anim="idle">Idle</button>
+ <button class="bento-pill bento-pill-btn" data-anim="av-walk-feminine">Walk</button>
+ <button class="bento-pill bento-pill-btn" data-anim="wave">Wave</button>
+ <button class="bento-pill bento-pill-btn" data-anim="dance">Dance</button>
+ <button class="bento-pill bento-pill-btn" data-anim="capoeira">Capoeira</button>
+ <button class="bento-pill bento-pill-btn" data-anim="jump">Jump</button>
</div>
</div>
@@ -1059,6 +2500,13 @@
</div>
<p class="bento-title">Real-time voice &amp; face capture</p>
<p class="bento-desc">ElevenLabs voice cloning with LiveKit streaming. Webcam face mocap drives your avatar's expressions and lip sync in real-time — no hardware required.</p>
+ <div class="bento-interact mocap-demo" id="mocap-demo">
+ <div class="mocap-bar">
+ <button class="bento-action-btn" id="mocap-mic-btn">Microphone</button>
+ <span class="mocap-status" id="mocap-status">click to capture</span>
+ </div>
+ <canvas class="mocap-waveform" id="mocap-waveform" height="48"></canvas>
+ </div>
<div class="bento-pills">
<span class="bento-pill">ElevenLabs</span>
<span class="bento-pill">LiveKit</span>
@@ -1075,6 +2523,16 @@
</div>
<p class="bento-title">Multiplayer 3D worlds</p>
<p class="bento-desc">Walk your avatar through live environments. Multiple visitors move together in real-time — CRDT-synced positions, joystick or keyboard control, and WebSocket presence.</p>
+ <div class="bento-interact">
+ <div class="walk-minimap-wrap">
+ <canvas class="walk-minimap" id="walk-minimap" tabindex="0"></canvas>
+ <div class="walk-minimap-hud">
+ <span class="walk-minimap-dot"></span>
+ <span id="walk-player-count">4 players online</span>
+ </div>
+ <div class="walk-minimap-hint"><kbd>W</kbd><kbd>A</kbd><kbd>S</kbd><kbd>D</kbd> or click to move</div>
+ </div>
+ </div>
<div class="bento-pills">
<span class="bento-pill">Multiplayer</span>
<span class="bento-pill">CRDT sync</span>
@@ -1089,7 +2547,15 @@
<span style="font-family:var(--font-mono);font-size:11px;letter-spacing:0.15em;text-transform:uppercase;color:var(--text-3)">x402 Payments</span>
</div>
<p class="bento-title">Charge per chat in USDC</p>
- <p class="bento-desc">Gate any agent skill behind an x402 HTTP paywall. Visitors pay with USDC on Base or Solana. Funds land in your wallet instantly. No intermediary, no escrow, no delays.</p>
+ <p class="bento-desc">Gate any agent skill behind an x402 HTTP paywall. Visitors pay with USDC on Base or Solana. Funds land in your wallet instantly.</p>
+ <div class="bento-interact x402-demo" id="x402-demo">
+ <div class="x402-step" id="x402-step-req">
+ <span class="x402-code err" id="x402-code">HTTP 402 — Payment Required</span>
+ <div class="x402-spinner" id="x402-spinner"></div>
+ <span class="x402-amount" id="x402-amount">+$0.05</span>
+ <button class="bento-action-btn sm" id="x402-pay-btn">Pay $0.05</button>
+ </div>
+ </div>
<div class="bento-pills">
<span class="bento-pill">USDC</span>
<span class="bento-pill">Base</span>
@@ -1106,6 +2572,21 @@
</div>
<p class="bento-title">ERC-8004 agent standard</p>
<p class="bento-desc">Mint your agent as an ERC-8004 token — the emerging on-chain standard for AI agents. Own it, trade it, and let other agents discover and call it autonomously via A2A.</p>
+ <div class="bento-interact mint-demo">
+ <div class="mint-card" id="mint-card">
+ <div class="mint-card-inner">
+ <div class="mint-card-info">
+ <span class="mint-card-label" id="mint-label">ERC-8004</span>
+ <span class="mint-card-name">nich.agent</span>
+ <span class="mint-card-chain" id="mint-chain">Base · Block 18,291,042</span>
+ </div>
+ <div class="mint-progress" id="mint-progress">
+ <svg viewBox="0 0 28 28"><circle cx="14" cy="14" r="12.5"/></svg>
+ </div>
+ <button class="bento-action-btn sm" id="mint-btn">Mint</button>
+ </div>
+ </div>
+ </div>
<div class="bento-pills">
<span class="bento-pill">ERC-8004</span>
<span class="bento-pill">EVM</span>
@@ -1121,12 +2602,15 @@
<span style="font-family:var(--font-mono);font-size:11px;letter-spacing:0.15em;text-transform:uppercase;color:var(--text-3)">Skills</span>
</div>
<p class="bento-title">MCP · A2A · tool chain</p>
- <p class="bento-desc">Wire your agent to any tool via MCP. Call other agents via A2A. Build skill packs and sell them in the marketplace. Jupiter swaps, Pump.fun, Solana RPC, and more pre-built.</p>
- <div class="bento-pills">
- <span class="bento-pill">MCP</span>
- <span class="bento-pill">A2A</span>
- <span class="bento-pill">Jupiter</span>
- <span class="bento-pill">Pump.fun</span>
+ <p class="bento-desc">Wire your agent to any tool via MCP. Call other agents via A2A. Build skill packs and sell them in the marketplace.</p>
+ <div class="bento-interact skill-demo">
+ <div class="bento-pills" id="skill-tools">
+ <button class="bento-pill bento-pill-btn active" data-tool="jupiter">Jupiter</button>
+ <button class="bento-pill bento-pill-btn" data-tool="pump">Pump.fun</button>
+ <button class="bento-pill bento-pill-btn" data-tool="rpc">Solana RPC</button>
+ <button class="bento-pill bento-pill-btn" data-tool="a2a">A2A call</button>
+ </div>
+ <div class="skill-result" id="skill-result"></div>
</div>
</div>
@@ -1137,11 +2621,14 @@
<span style="font-family:var(--font-mono);font-size:11px;letter-spacing:0.15em;text-transform:uppercase;color:var(--text-3)">Memory</span>
</div>
<p class="bento-title">Persistent cross-device memory</p>
- <p class="bento-desc">Your agent remembers every visitor across devices and sessions. Tie-in to your own data sources or use the built-in vector memory — scoped per user, per agent, or globally.</p>
- <div class="bento-pills">
- <span class="bento-pill">Cross-device</span>
- <span class="bento-pill">Vector</span>
- <span class="bento-pill">Per-user</span>
+ <p class="bento-desc">Your agent remembers every visitor across devices and sessions. Tie-in to your own data sources or use the built-in vector memory.</p>
+ <div class="bento-interact memory-demo" id="memory-demo">
+ <div class="memory-input-row">
+ <input class="memory-input" id="memory-input" placeholder="Tell the agent something..." maxlength="120" />
+ <button class="bento-action-btn sm" id="memory-store-btn">Store</button>
+ </div>
+ <button class="bento-action-btn sm" id="memory-recall-btn" style="align-self:flex-start">Recall</button>
+ <div class="memory-log" id="memory-log"></div>
</div>
</div>
@@ -1152,13 +2639,60 @@
<span style="font-family:var(--font-mono);font-size:11px;letter-spacing:0.15em;text-transform:uppercase;color:var(--text-3)">AR / WebXR</span>
</div>
<p class="bento-title">Augmented reality, no app</p>
- <p class="bento-desc">Place your agent in the real world with WebXR on Android or Quick Look on iOS. No app install required — runs from the same embed tag in a mobile browser.</p>
+ <p class="bento-desc">Place your agent in the real world with WebXR on Android or Quick Look on iOS. No app install required.</p>
+ <div class="bento-interact ar-demo" id="ar-demo">
+ <div class="ar-phone" id="ar-phone">
+ <div class="ar-phone-notch"></div>
+ <div class="ar-phone-screen">
+ <div class="ar-phone-avatar" id="ar-phone-avatar">◇</div>
+ <div class="ar-phone-crosshair"></div>
+ </div>
+ </div>
+ <div class="ar-info">
+ <button class="bento-action-btn sm" id="ar-launch-btn">Launch AR</button>
+ <span class="ar-status" id="ar-status">tap to place agent</span>
+ </div>
+ </div>
<div class="bento-pills">
<span class="bento-pill">WebXR</span>
<span class="bento-pill">Quick Look</span>
<span class="bento-pill">iOS / Android</span>
</div>
</div>
+
+ <!-- Marketplace -->
+ <div class="bento-card">
+ <div class="bento-icon">
+ <span class="dot" style="background:#ffffff;box-shadow:0 0 8px #ffffff55"></span>
+ <span style="font-family:var(--font-mono);font-size:11px;letter-spacing:0.15em;text-transform:uppercase;color:var(--text-3)">Marketplace</span>
+ </div>
+ <p class="bento-title">Discover, remix, deploy</p>
+ <p class="bento-desc">Browse public agents in the marketplace. Fork any agent's personality, voice, and skills. Publish your own and let others remix.</p>
+ <div class="bento-interact">
+ <div class="mktplace-strip" id="mktplace-strip"></div>
+ </div>
+ </div>
+
+ <!-- Analytics -->
+ <div class="bento-card">
+ <div class="bento-icon">
+ <span class="dot" style="background:#e8e8e8;box-shadow:0 0 8px #e8e8e855"></span>
+ <span style="font-family:var(--font-mono);font-size:11px;letter-spacing:0.15em;text-transform:uppercase;color:var(--text-3)">Analytics</span>
+ </div>
+ <p class="bento-title">Track everything</p>
+ <p class="bento-desc">Conversations, revenue, engagement, retention — all in real-time. See which skills earn the most.</p>
+ <div class="bento-interact analytics-demo" id="analytics-demo">
+ <div class="analytics-counters">
+ <div class="analytics-counter"><span class="analytics-val" id="an-convos">0</span><span class="analytics-lbl">convos</span></div>
+ <div class="analytics-counter"><span class="analytics-val" id="an-revenue">$0</span><span class="analytics-lbl">revenue</span></div>
+ <div class="analytics-counter"><span class="analytics-val" id="an-retention">0%</span><span class="analytics-lbl">retention</span></div>
+ </div>
+ <svg class="analytics-spark" id="analytics-spark" viewBox="0 0 200 40" preserveAspectRatio="none">
+ <defs><linearGradient id="spark-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="var(--text-2)"/><stop offset="100%" stop-color="transparent"/></linearGradient></defs>
+ </svg>
+ </div>
+ </div>
+ </div>
</div>
</div>
</section>
@@ -1332,27 +2866,22 @@
<a class="btn sm" href="/walk">See walk mode <span class="arrow">→</span></a>
</div>
</div>
- <div class="feat-visual">
+ <div class="feat-visual walk-preview-visual">
<div class="feat-visual-label">Walk embed · live preview</div>
- <div style="padding:28px;display:flex;flex-direction:column;gap:14px;">
- <div style="background:var(--surface-2);border-radius:8px;border:1px solid var(--hairline-strong);aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;">
- <div style="position:absolute;inset:0;background:radial-gradient(ellipse at 30% 60%, rgba(255,255,255,0.12) 0%, transparent 60%), radial-gradient(ellipse at 70% 40%, rgba(255,255,255,0.08) 0%, transparent 50%);"></div>
- <div style="display:flex;gap:16px;align-items:flex-end;position:relative;z-index:1;">
- <div style="display:flex;flex-direction:column;align-items:center;gap:6px;">
- <div style="width:28px;height:48px;background:linear-gradient(180deg,#ffffff,#cccccc);border-radius:14px 14px 6px 6px;opacity:0.9;"></div>
- <div style="font-family:var(--font-mono);font-size:9px;color:var(--text-3);letter-spacing:0.1em;">@alice</div>
- </div>
- <div style="display:flex;flex-direction:column;align-items:center;gap:6px;">
- <div style="width:28px;height:52px;background:linear-gradient(180deg,#ffffff,#cccccc);border-radius:14px 14px 6px 6px;opacity:0.9;"></div>
- <div style="font-family:var(--font-mono);font-size:9px;color:var(--text-3);letter-spacing:0.1em;">@bob</div>
- </div>
- <div style="display:flex;flex-direction:column;align-items:center;gap:6px;">
- <div style="width:28px;height:44px;background:linear-gradient(180deg,#e8e8e8,#cccccc);border-radius:14px 14px 6px 6px;opacity:0.9;"></div>
- <div style="font-family:var(--font-mono);font-size:9px;color:var(--green);letter-spacing:0.1em;">you</div>
- </div>
+ <div class="walk-preview-wrap" id="walk-preview-container">
+ <div class="walk-preview-canvas-area">
+ <canvas class="walk-preview-canvas"></canvas>
+ <div data-walk-loading class="walk-preview-loading">
+ <div class="walk-preview-spinner"></div>
+ <span>Loading 3D scene...</span>
+ </div>
+ <div class="walk-preview-hint">
+ <span><kbd>W</kbd><kbd>A</kbd><kbd>S</kbd><kbd>D</kbd> move</span>
+ <span>drag to orbit</span>
+ <span><kbd>space</kbd> jump</span>
</div>
+ <div data-walk-joystick class="walk-preview-joystick"></div>
</div>
- <div style="font-family:var(--font-mono);font-size:11px;color:var(--text-3);letter-spacing:0.12em;text-align:center;text-transform:uppercase;">3 visitors · live now</div>
<div class="bento-code"><span class="kw">&lt;walk-embed</span><br/> <span class="kw">src=</span><span class="str">"/api/scenes/my-lobby"</span><br/> <span class="kw">multiplayer</span><br/><span class="kw">&gt;&lt;/walk-embed&gt;</span></div>
</div>
</div>
@@ -1370,13 +2899,56 @@
Everything available through a REST API, SDK, and MCP server. Build custom agents, automate workflows, and connect to any AI tool.
</p>
</div>
- <div class="dev-grid reveal reveal-d1">
- <div class="dev-pane">
+ <div class="dev-grid reveal reveal-d1" id="api-playground">
+ <!-- ── Left: request / code pane ─────────────────────── -->
+ <div class="dev-pane" id="pg-left">
<div class="dev-pane-head">
- <span>agent-sdk · Node.js</span>
- <span>npm i @three.ws/agent-sdk</span>
+ <span id="pg-head-title">API Playground</span>
+ <span id="pg-head-sub">interactive</span>
+ </div>
+ <div class="dev-tabs" id="pg-tabs">
+ <button type="button" class="dev-tab active" data-tab="tryit">Try it</button>
+ <button type="button" class="dev-tab" data-tab="sdk">Node SDK</button>
+ <button type="button" class="dev-tab" data-tab="curl">cURL</button>
+ </div>
+
+ <!-- Tab: Try it -->
+ <div class="dev-tab-content active" id="pg-tab-tryit">
+ <div id="pg-empty-state" class="pg-empty">
+ <div class="pg-empty-icon">&lt;/&gt;</div>
+ Select an endpoint to start exploring the API
+ </div>
+ <div id="pg-builder" style="display:none;">
+ <div class="pg-request">
+ <div class="pg-url-bar">
+ <div class="pg-url-method" id="pg-method">GET</div>
+ <input class="pg-url-path" id="pg-path" readonly />
+ </div>
+ <div id="pg-params"></div>
+ <div id="pg-body-wrap" style="display:none;">
+ <div class="pg-field">
+ <label class="pg-field-label">Request body</label>
+ <textarea class="pg-input" id="pg-body" placeholder='{ "key": "value" }'></textarea>
+ </div>
+ </div>
+ <div class="pg-actions">
+ <button type="button" class="pg-send" id="pg-send">Send</button>
+ <span class="pg-status" id="pg-status"></span>
+ </div>
+ <div class="pg-response" id="pg-response" style="display:none;">
+ <div class="pg-response-head">
+ <span>Response</span>
+ <button type="button" class="pg-copy" id="pg-copy-resp">Copy</button>
+ </div>
+ <div class="pg-response-body" id="pg-response-body"></div>
+ </div>
+ </div>
+ </div>
</div>
- <div class="dev-code">
+
+ <!-- Tab: SDK -->
+ <div class="dev-tab-content" id="pg-tab-sdk">
+ <div class="dev-code" id="pg-sdk-code">
<span class="kw">import</span> { <span class="fn">Agent</span> } <span class="kw">from</span> <span class="str">'@three.ws/agent-sdk'</span>;
<span class="kw">const</span> <span class="fn">agent</span> = <span class="kw">new</span> <span class="fn">Agent</span>({
@@ -1393,7 +2965,14 @@
<span class="cmt">// x402 gated endpoint auto-wired</span>
<span class="kw">await</span> <span class="fn">agent</span>.<span class="fn">deploy</span>();
+ </div>
+ </div>
+
+ <!-- Tab: cURL -->
+ <div class="dev-tab-content" id="pg-tab-curl">
+ <div class="pg-curl-code" id="pg-curl-code">Select an endpoint to generate a cURL command.</div>
</div>
+
<div class="dev-links">
<div class="dev-links-row">
<a class="dev-link" href="/docs">Docs</a>
@@ -1403,55 +2982,57 @@
</div>
</div>
</div>
- <div class="dev-pane dev-right">
+
+ <!-- ── Right: endpoint list ──────────────────────────── -->
+ <div class="dev-pane dev-right" id="pg-endpoints">
<div class="dev-pane-head">
- <span>REST API endpoints</span>
+ <span>Endpoints</span>
<span>v1</span>
</div>
- <div class="dev-api-row">
+ <div class="dev-api-row" data-endpoint="list-agents">
<div style="display:flex;align-items:center;gap:8px;">
<span class="dev-badge get">GET</span>
<span class="dev-api-path">/v1/agents</span>
</div>
<div class="dev-api-desc">List all agents in your account</div>
</div>
- <div class="dev-api-row">
+ <div class="dev-api-row" data-endpoint="create-agent">
<div style="display:flex;align-items:center;gap:8px;">
<span class="dev-badge post">POST</span>
<span class="dev-api-path">/v1/agents</span>
</div>
<div class="dev-api-desc">Create agent from avatar + prompt</div>
</div>
- <div class="dev-api-row">
+ <div class="dev-api-row" data-endpoint="chat">
<div style="display:flex;align-items:center;gap:8px;">
<span class="dev-badge post">POST</span>
<span class="dev-api-path">/v1/chat</span>
</div>
<div class="dev-api-desc">Send a message, stream a response</div>
</div>
- <div class="dev-api-row">
+ <div class="dev-api-row" data-endpoint="get-avatar">
<div style="display:flex;align-items:center;gap:8px;">
<span class="dev-badge get">GET</span>
<span class="dev-api-path">/v1/avatars/:id</span>
</div>
<div class="dev-api-desc">Fetch avatar metadata and GLB URL</div>
</div>
- <div class="dev-api-row">
+ <div class="dev-api-row" data-endpoint="mcp">
<div style="display:flex;align-items:center;gap:8px;">
<span class="dev-badge mcp">MCP</span>
<span class="dev-api-path">three.ws/mcp</span>
</div>
<div class="dev-api-desc">Model Context Protocol server</div>
</div>
- <div class="dev-api-row">
+ <div class="dev-api-row" data-endpoint="a2a">
<div style="display:flex;align-items:center;gap:8px;">
<span class="dev-badge mcp">A2A</span>
<span class="dev-api-path">/v1/a2a/:agentId</span>
</div>
<div class="dev-api-desc">Agent-to-agent protocol endpoint</div>
</div>
- <div style="padding:16px 24px;margin-top:auto;border-top:1px solid var(--hairline);">
- <a class="btn sm" href="/dashboard/api">Get API key <span class="arrow">→</span></a>
+ <div style="padding:14px 20px;margin-top:auto;border-top:1px solid var(--hairline);">
+ <a class="btn sm" href="/dashboard/api">Get API key <span class="arrow">&rarr;</span></a>
</div>
</div>
</div>
@@ -1485,43 +3066,69 @@
</div>
</section>
-<!-- ── SHOWCASE ───────────────────────────────────────────────────── -->
+<!-- ── 3D STACK ────────────────────────────────────────────────────── -->
<section class="block">
<div class="wrap-1280">
<div class="block-head reveal">
- <p class="block-eyebrow"><span class="num">07</span>Discover</p>
+ <p class="block-eyebrow"><span class="num">07</span>The stack</p>
+ <h2 class="block-h">Six pieces. <em>One layer.</em></h2>
+ <p class="block-lede">Every component is open, real, and shipping today. Use one. Use all. They compose.</p>
+ </div>
+ <div class="stack-3d reveal" id="stack-3d">
+ <div class="stack-3d-scene" id="stack-3d-scene">
+ <a href="/studio" class="stack-card">
+ <span class="stack-card-num">01</span>
+ <span class="stack-card-title">Studio</span>
+ <span class="stack-card-desc">Selfie to rigged avatar in seconds. Browser-native, GPU-accelerated — no software to install.</span>
+ <span class="stack-card-arrow">↗</span>
+ </a>
+ <a href="/discover" class="stack-card">
+ <span class="stack-card-num">02</span>
+ <span class="stack-card-title">Registry</span>
+ <span class="stack-card-desc">ERC-8004 on-chain identity. Agents discoverable, portable, and attestable across any A2A or MCP client.</span>
+ <span class="stack-card-arrow">↗</span>
+ </a>
+ <a href="/docs" class="stack-card">
+ <span class="stack-card-num">03</span>
+ <span class="stack-card-title">Embed</span>
+ <span class="stack-card-desc">&lt;agent-3d&gt; web component. One tag. Any host. Lazy-loaded, isolated CSS, CDN-hosted globally.</span>
+ <span class="stack-card-arrow">↗</span>
+ </a>
+ <a href="/dashboard/monetize" class="stack-card">
+ <span class="stack-card-num">04</span>
+ <span class="stack-card-title">x402</span>
+ <span class="stack-card-desc">HTTP-native USDC micropayments. Bill per skill, message, or session. 0% platform fee during open beta.</span>
+ <span class="stack-card-arrow">↗</span>
+ </a>
+ <a href="/walk" class="stack-card">
+ <span class="stack-card-num">05</span>
+ <span class="stack-card-title">Walk</span>
+ <span class="stack-card-desc">Multiplayer 3D worlds. CRDT-synced avatar positions, spatial voice, joystick control — in one embed tag.</span>
+ <span class="stack-card-arrow">↗</span>
+ </a>
+ <a href="/docs/sdk" class="stack-card">
+ <span class="stack-card-num">06</span>
+ <span class="stack-card-title">SDK</span>
+ <span class="stack-card-desc">JavaScript, Python, Rust. Mint, sign, attest, render, pay. MIT licensed. Available on npm.</span>
+ <span class="stack-card-arrow">↗</span>
+ </a>
+ </div>
+ </div>
+ </div>
+</section>
+
+<!-- ── SHOWCASE 3D ────────────────────────────────────────────────── -->
+<section class="block" id="showcase-3d-section">
+ <div class="wrap-1280">
+ <div class="block-head reveal">
+ <p class="block-eyebrow"><span class="num">08</span>Discover</p>
<h2 class="block-h">Living agents, <em>right now.</em></h2>
<p class="block-lede">A taste of what's running across the web today. Click any agent to talk, remix, or grab their embed code.</p>
</div>
- <div class="showcase reveal reveal-d1">
- <a class="shot" href="/agent-next?id=bacff13e-b64b-4ac0-860d-44f0168ad23b">
- <div class="shot-fill">
- <img src="https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/bacff13e-b64b-4ac0-860d-44f0168ad23b.png" alt="nich" loading="lazy" />
- </div>
- <span class="shot-tag">Featured</span>
- <div class="shot-meta"><div class="shot-name">nich</div><div class="shot-sub">@nirholas · ERC-8004</div></div>
- </a>
- <a class="shot" href="/discover">
- <div class="shot-fill" style="background:linear-gradient(135deg, var(--surface-2) 0%, var(--surface-0) 100%);"></div>
- <div class="shot-meta">
- <div class="shot-name">Browse all</div>
- <div class="shot-sub">Public agent directory</div>
- </div>
- </a>
- <a class="shot" href="/discover?filter=onchain">
- <div class="shot-fill" style="background:linear-gradient(135deg, rgba(255,255,255,0.12) 0%, var(--surface-0) 100%);"></div>
- <div class="shot-meta">
- <div class="shot-name">On-chain</div>
- <div class="shot-sub">ERC-8004 directory</div>
- </div>
- </a>
- <a class="shot" href="/create">
- <div class="shot-fill" style="background:linear-gradient(135deg, rgba(255,255,255,0.08) 0%, var(--surface-0) 100%);"></div>
- <div class="shot-meta">
- <div class="shot-name">Make your own</div>
- <div class="shot-sub">Selfie → agent · 60s</div>
- </div>
- </a>
+ <div class="showcase-3d reveal reveal-d1">
+ <div class="showcase-3d-grid" id="showcase-3d-grid">
+ <!-- Agent cards + CTA cards injected by JS from /api/explore -->
+ </div>
</div>
</div>
</section>
@@ -1530,67 +3137,102 @@
<section class="block">
<div class="wrap-1280">
<div class="block-head reveal">
- <p class="block-eyebrow"><span class="num">08</span>Pricing</p>
+ <p class="block-eyebrow"><span class="num">09</span>Pricing</p>
<h2 class="block-h">Free to start. <em>Scale when you do.</em></h2>
<p class="block-lede">Open beta is free with no limits. Pro and Enterprise plans unlock higher rate limits, custom domains, and dedicated support.</p>
</div>
- <div class="pricing-grid reveal reveal-d1">
- <div class="pricing-card">
- <div class="pricing-tier">Beta</div>
- <div class="pricing-price">$0<sub>/mo</sub></div>
- <div class="pricing-cycle">Free during open beta</div>
- <ul class="pricing-feats">
- <li>Unlimited agents</li>
- <li>Unlimited embeds</li>
- <li>200+ animation clips</li>
- <li>x402 payments (0% fee)</li>
- <li>Community support</li>
- </ul>
- <a class="btn" href="/create">Start for free</a>
- </div>
- <div class="pricing-card featured">
- <span class="pricing-badge">Most popular</span>
- <div class="pricing-tier">Pro</div>
- <div class="pricing-price">$49<sub>/mo</sub></div>
- <div class="pricing-cycle">After open beta · billed monthly</div>
- <ul class="pricing-feats">
- <li>Everything in Beta</li>
- <li>Custom domain embeds</li>
- <li>Priority CDN &amp; GPU rendering</li>
- <li>Advanced analytics dashboard</li>
- <li>Priority support &amp; SLA</li>
- </ul>
- <a class="btn primary" href="/pricing">See full pricing</a>
- </div>
- <div class="pricing-card">
- <div class="pricing-tier">Enterprise</div>
- <div class="pricing-price" style="font-size:28px;margin-top:6px;">Custom</div>
- <div class="pricing-cycle">Volume · white-label · SLA</div>
- <ul class="pricing-feats">
- <li>Everything in Pro</li>
- <li>White-label embed &amp; API</li>
- <li>Dedicated infrastructure</li>
- <li>Custom integrations</li>
- <li>Dedicated solutions engineer</li>
- </ul>
- <a class="btn" href="mailto:[email protected]">Contact us</a>
+ <div class="pricing-stage" id="pricing-stage">
+ <canvas id="pricing-canvas"></canvas>
+ <div class="pricing-grid reveal reveal-d1">
+ <div class="pricing-card" id="tier-beta" data-tier="beta">
+ <div class="pricing-tier">Beta</div>
+ <div class="pricing-price">$0<sub>/mo</sub></div>
+ <div class="pricing-cycle">Free during open beta</div>
+ <ul class="pricing-feats">
+ <li>Unlimited agents</li>
+ <li>Unlimited embeds</li>
+ <li>200+ animation clips</li>
+ <li>x402 payments (0% fee)</li>
+ <li>Community support</li>
+ </ul>
+ <a class="btn" href="/create" data-tier-cta="beta">Start for free</a>
+ </div>
+ <div class="pricing-card featured" id="tier-pro" data-tier="pro">
+ <span class="pricing-badge">Most popular</span>
+ <div class="pricing-tier">Pro</div>
+ <div class="pricing-price">$49<sub>/mo</sub></div>
+ <div class="pricing-cycle">After open beta · billed monthly</div>
+ <ul class="pricing-feats">
+ <li>Everything in Beta</li>
+ <li>Custom domain embeds</li>
+ <li>Priority CDN &amp; GPU rendering</li>
+ <li>Advanced analytics dashboard</li>
+ <li>Priority support &amp; SLA</li>
+ </ul>
+ <a class="btn primary" href="/pricing" data-tier-cta="pro">See full pricing</a>
+ </div>
+ <div class="pricing-card" id="tier-enterprise" data-tier="enterprise">
+ <div class="pricing-tier">Enterprise</div>
+ <div class="pricing-price" style="font-size:28px;margin-top:6px;">Custom</div>
+ <div class="pricing-cycle">Volume · white-label · SLA</div>
+ <ul class="pricing-feats">
+ <li>Everything in Pro</li>
+ <li>White-label embed &amp; API</li>
+ <li>Dedicated infrastructure</li>
+ <li>Custom integrations</li>
+ <li>Dedicated solutions engineer</li>
+ </ul>
+ <a class="btn" href="mailto:[email protected]" data-tier-cta="enterprise">Contact us</a>
+ </div>
</div>
+ <p class="pricing-hint">Hover a tier — she walks over</p>
</div>
</div>
</section>
-<!-- ── BOTTOM CTA ─────────────────────────────────────────────────── -->
-<section class="block" style="padding-bottom:72px;">
+
+<!-- ── AVATAR DROP ─────────────────────────────────────────────────── -->
+<section class="block body-drop" id="body-drop">
<div class="wrap-1280">
- <div class="cta-card reveal">
- <h2>Add a living 3D agent<br/>to your product today.</h2>
- <p>Free during open beta. No credit card. Two lines of HTML.</p>
- <div class="cta-row" style="justify-content:center;">
- <a class="btn primary" href="/create">Build your first agent <span class="arrow">→</span></a>
- <a class="btn" href="/docs">Read the docs</a>
+ <div class="body-drop-content reveal">
+ <p class="block-eyebrow"><span class="num">10</span>See it in action</p>
+ <h2 class="body-drop-title">
+ <span id="drop-sit-line">Your agent</span><br/>
+ lives <em>here.</em>
+ </h2>
+ <p class="body-drop-sub">
+ Not a render. Not a video. A real 3D character sitting on this text, jumping onto the button, interacting with the page in real-time.
+ </p>
+ <div class="cta-row">
+ <a class="btn primary" href="/create" id="drop-cta-btn">Build your agent <span class="arrow">→</span></a>
</div>
</div>
</div>
+ <canvas id="drop-canvas"></canvas>
+</section>
+
+<!-- ── V4 IMMERSIVE CLOSE ─────────────────────────────────────────── -->
+<section class="vclose" id="vclose">
+ <div class="vclose-grid" aria-hidden="true"></div>
+ <div id="vclose-agent-slot" class="vclose-agent"></div>
+ <div class="vclose-vignette" aria-hidden="true"></div>
+ <div class="vclose-overlay">
+ <div class="vclose-eyebrow">live · three.ws</div>
+ <h2 class="vclose-title">Your AI deserves<br />a <em>body.</em></h2>
+ <p class="vclose-sub">Free to start. Two lines of HTML. Voice, payments, and on-chain identity included.</p>
+ <div class="cta-row" style="justify-content:center;">
+ <a class="btn primary" href="/create">Build your agent <span class="arrow">→</span></a>
+ <a class="btn" href="/docs">Read the docs</a>
+ </div>
+ <div class="vclose-chips" id="vclose-chips" role="group" aria-label="Trigger an animation">
+ <button type="button" class="hero-chip hero-chip--rand" data-anim="__random">🎲 Random</button>
+ <button type="button" class="hero-chip" data-anim="wave">👋 Wave</button>
+ <button type="button" class="hero-chip" data-anim="dance">💃 Dance</button>
+ <button type="button" class="hero-chip" data-anim="capoeira">🤸 Capoeira</button>
+ <button type="button" class="hero-chip" data-anim="thriller">🧟 Thriller</button>
+ <button type="button" class="hero-chip" data-anim="celebrate">🎉 Celebrate</button>
+ </div>
+ </div>
</section>
<!-- ── FOOTER ─────────────────────────────────────────────────────── -->
@@ -1610,116 +3252,983 @@
</div>
</footer>
-<script>
- // ── Boot live <agent-3d> instances ─────────────────────────────
- const AVATAR_ID = 'bacff13e-b64b-4ac0-860d-44f0168ad23b';
- const AGENT_ATTRS = {
- mode: 'inline', responsive: '', background: 'transparent',
- 'name-plate': 'off', 'avatar-chat': 'off', kiosk: '', eager: '',
- };
- function spawnAgent(glbUrl) {
- const el = document.createElement('agent-3d');
- el.classList.add('live-agent');
- el.setAttribute('body', glbUrl);
- for (const [k, v] of Object.entries(AGENT_ATTRS)) el.setAttribute(k, v);
- return el;
- }
+<script type="module">
+ import { initAvatarDrop } from '/src/avatar-drop.js';
+ const dropSection = document.getElementById('body-drop');
+ if (dropSection) {
+ const io = new IntersectionObserver(entries => {
+ if (entries[0].isIntersecting) {
+ io.disconnect();
+ initAvatarDrop(dropSection);
+ }
+ }, { rootMargin: '200px' });
+ io.observe(dropSection);
+ }
+</script>
+
+<script type="module">
+ import { initWalkPreview } from '/src/walk-embed-preview.js';
+ const walkContainer = document.getElementById('walk-preview-container');
+ if (walkContainer) initWalkPreview(walkContainer);
+</script>
+
+<script>
+ // ── Boot live <agent-3d> instances ─────────────────────────────
+ const AVATAR_ID = 'bacff13e-b64b-4ac0-860d-44f0168ad23b';
+ const AGENT_ATTRS = {
+ mode: 'inline', responsive: '', background: 'transparent',
+ 'name-plate': 'off', 'avatar-chat': 'off', kiosk: '', eager: '',
+ };
+ function devProxyGlb(url) {
+ if (!url) return url;
+ const isDev = location.hostname === 'localhost' || location.hostname.includes('.github.dev') || location.hostname.includes('.gitpod.io');
+ if (isDev && url.includes('r2.dev')) {
+ try { return '/r2-proxy' + new URL(url).pathname; } catch (_) {}
+ }
+ return url;
+ }
+ function spawnAgent(glbUrl) {
+ const el = document.createElement('agent-3d');
+ el.classList.add('live-agent');
+ el.setAttribute('body', glbUrl);
+ for (const [k, v] of Object.entries(AGENT_ATTRS)) el.setAttribute(k, v);
+ return el;
+ }
+ (async () => {
+ try {
+ const r = await fetch(`${location.origin}/api/avatars/${AVATAR_ID}`);
+ const d = await r.json();
+ const glb = devProxyGlb(d.avatar?.model_url || d.avatar?.url);
+ if (!glb) return;
+ const heroInner = document.getElementById('hero-stage-inner');
+ if (heroInner) {
+ const heroEl = spawnAgent(glb);
+ heroInner.appendChild(heroEl);
+ initHeroWalk(heroEl);
+ initHeroChips(heroEl);
+ }
+ const thumb = d.avatar?.thumbnail_url;
+ if (thumb) {
+ const orbEl = document.getElementById('editorial-orb-avatar');
+ if (orbEl) {
+ const img = new Image();
+ img.alt = d.avatar?.name || 'Avatar';
+ img.src = thumb;
+ orbEl.appendChild(img);
+ }
+ }
+ } catch (e) {
+ console.warn('[home] avatar boot failed', e);
+ }
+ })();
+
+ // ── Hero walk cycle ─────────────────────────────────────────────
+ let _heroChipActive = false;
+
+ function initHeroWalk(heroAgent) {
+ const WALK_CLIP = 'av-walk-feminine';
+ const IDLE_CLIP = 'idle';
+ let active = true;
+
+ async function walkCycle() {
+ await new Promise(r => setTimeout(r, 2000));
+ if (!active || _heroChipActive) return;
+ heroAgent.playClipByName?.(WALK_CLIP, { loop: true, fade_ms: 400 });
+ await new Promise(r => setTimeout(r, 5000));
+ if (!active || _heroChipActive) return;
+ heroAgent.playClipByName?.(IDLE_CLIP, { loop: true, fade_ms: 600 });
+ await new Promise(r => setTimeout(r, 3000));
+ walkCycle();
+ }
+
+ heroAgent.addEventListener('agent:ready', walkCycle, { once: true });
+ if (heroAgent._viewer) walkCycle();
+
+ document.addEventListener('visibilitychange', () => {
+ active = !document.hidden;
+ if (active && !_heroChipActive) walkCycle();
+ });
+ }
+
+ // ── Hero animation chips ─────────────────────────────────────────
+ function initHeroChips(heroAgent) {
+ const ANIMS = ['wave','dance','capoeira','jump','thriller','pray','celebrate','rumba','falling','kiss','taunt','idle'];
+ const chipsEl = document.getElementById('hero-chips');
+ const counter = document.getElementById('hero-chips-counter');
+ let lastAnim = null;
+ let moveCount = 0;
+
+ if (!chipsEl) return;
+
+ chipsEl.addEventListener('click', (e) => {
+ const btn = e.target.closest('.hero-chip');
+ if (!btn) return;
+ const animKey = btn.dataset.anim;
+ if (!animKey) return;
+
+ let clip = animKey;
+ if (animKey === '__random') {
+ const pool = ANIMS.filter(a => a !== lastAnim);
+ clip = pool[Math.floor(Math.random() * pool.length)];
+ }
+ lastAnim = clip;
+
+ chipsEl.querySelectorAll('.hero-chip').forEach(c => delete c.dataset.active);
+ btn.dataset.active = 'true';
+
+ _heroChipActive = true;
+ heroAgent.playClipByName?.(clip, { loop: false, fade_ms: 400 });
+
+ moveCount += 1;
+ if (counter) counter.innerHTML = `<strong>${moveCount}</strong> ${moveCount === 1 ? 'move' : 'moves'}`;
+
+ clearTimeout(chipsEl._resumeTimer);
+ chipsEl._resumeTimer = setTimeout(() => {
+ _heroChipActive = false;
+ delete btn.dataset.active;
+ }, 6000);
+ });
+ }
+
+
+ // ── Hero thought-bubble chat ────────────────────────────────────
+ (function initHeroChat() {
+ const form = document.getElementById('hero-chat-form');
+ const input = document.getElementById('hero-chat-input');
+ const sendBtn = document.getElementById('hero-chat-send');
+ const bubble = document.getElementById('hero-thought');
+ const textEl = document.getElementById('hero-thought-text');
+ if (!form || !input || !bubble || !textEl) return;
+
+ var stageEl = document.getElementById('hero-stage');
+ if (stageEl) {
+ var REF_H = 680;
+ function sizeBubble() {
+ var h = stageEl.clientHeight;
+ var ratio = Math.max(0.55, Math.min(1.15, h / REF_H));
+ var topPct = Math.max(4, Math.min(14, 10 + (1 - ratio) * 8));
+ bubble.style.top = topPct.toFixed(1) + '%';
+ }
+ sizeBubble();
+ new ResizeObserver(sizeBubble).observe(stageEl);
+ }
+
+ const AVATAR_CHAT_ID = 'bacff13e-b64b-4ac0-860d-44f0168ad23b';
+ let history = [];
+ let busy = false;
+ let hideTimer = null;
+
+ function showBubble() {
+ clearTimeout(hideTimer);
+ bubble.classList.add('visible');
+ }
+
+ function hideBubble(delay) {
+ clearTimeout(hideTimer);
+ hideTimer = setTimeout(function() {
+ bubble.classList.remove('visible');
+ }, delay || 8000);
+ }
+
+ function showThinking() {
+ textEl.innerHTML = '<div class="hero-thought-dots"><span></span><span></span><span></span></div>';
+ showBubble();
+ }
+
+ function showText(text) {
+ textEl.textContent = text;
+ textEl.scrollTop = textEl.scrollHeight;
+ showBubble();
+ hideBubble(12000);
+ }
+
+ function appendText(chunk) {
+ var dotsEl = textEl.querySelector('.hero-thought-dots');
+ if (dotsEl) textEl.innerHTML = '';
+ textEl.textContent += chunk;
+ textEl.scrollTop = textEl.scrollHeight;
+ }
+
+ function triggerAnim(heroAgent) {
+ if (heroAgent && heroAgent.playClipByName) {
+ heroAgent.playClipByName('wave', { loop: false, fade_ms: 400 });
+ }
+ }
+
+ form.addEventListener('submit', function(e) {
+ e.preventDefault();
+ var msg = input.value.trim();
+ if (!msg || busy) return;
+
+ busy = true;
+ sendBtn.disabled = true;
+ input.value = '';
+ showThinking();
+
+ history.push({ role: 'user', content: msg });
+ if (history.length > 20) history = history.slice(-20);
+
+ var heroAgent = document.querySelector('#hero-stage-inner agent-3d');
+ triggerAnim(heroAgent);
+
+ var fullText = '';
+ fetch('/api/chat', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({
+ message: msg,
+ agentId: AVATAR_CHAT_ID,
+ history: history.slice(0, -1),
+ context: {}
+ })
+ }).then(function(res) {
+ if (!res.ok) throw new Error('Chat request failed');
+ var reader = res.body.getReader();
+ var decoder = new TextDecoder();
+ var buffer = '';
+
+ function processChunk(result) {
+ if (result.done) {
+ if (fullText) {
+ history.push({ role: 'assistant', content: fullText });
+ hideBubble(12000);
+ }
+ busy = false;
+ sendBtn.disabled = false;
+ return;
+ }
+ buffer += decoder.decode(result.value, { stream: true });
+ var lines = buffer.split('\n');
+ buffer = lines.pop();
+
+ lines.forEach(function(line) {
+ if (!line.startsWith('data: ')) return;
+ var data = line.slice(6).trim();
+ if (!data || data === '[DONE]') return;
+ try {
+ var parsed = JSON.parse(data);
+ if (parsed.type === 'chunk' && parsed.text) {
+ fullText += parsed.text;
+ appendText(parsed.text);
+ showBubble();
+ } else if (parsed.type === 'error') {
+ showText('Hmm, something went wrong. Try again?');
+ }
+ } catch (_) {}
+ });
+
+ return reader.read().then(processChunk);
+ }
+
+ return reader.read().then(processChunk);
+ }).catch(function(err) {
+ console.warn('[hero-chat]', err);
+ showText('Could not reach the agent. Try again in a moment.');
+ busy = false;
+ sendBtn.disabled = false;
+ });
+ });
+ })();
+
+ // ── Hero parallax tilt ──────────────────────────────────────────
+ const stage = document.getElementById('hero-stage');
+ const inner = document.getElementById('hero-stage-inner');
+ if (stage && inner && window.matchMedia('(min-width: 980px)').matches) {
+ const thoughtEl = document.getElementById('hero-thought');
+ let rx = 0, ry = 0, tx = 0, ty = 0;
+ const lerp = (a, b, t) => a + (b - a) * t;
+ stage.addEventListener('mousemove', (e) => {
+ const r = stage.getBoundingClientRect();
+ tx = ((e.clientX - r.left) / r.width - 0.5) * 6;
+ ty = -((e.clientY - r.top) / r.height - 0.5) * 4;
+ });
+ stage.addEventListener('mouseleave', () => { tx = 0; ty = 0; });
+ (function tick() {
+ rx = lerp(rx, ty, 0.08);
+ ry = lerp(ry, tx, 0.08);
+ inner.style.transform = `perspective(1400px) rotateX(${rx.toFixed(2)}deg) rotateY(${ry.toFixed(2)}deg)`;
+ if (thoughtEl) {
+ thoughtEl.style.setProperty('--tilt-x', `${(ry * 2).toFixed(1)}px`);
+ thoughtEl.style.setProperty('--tilt-y', `${(-rx * 1.5).toFixed(1)}px`);
+ }
+ requestAnimationFrame(tick);
+ })();
+ }
+
+ // ── Playground ──────────────────────────────────────────────────
+ (function initPlayground() {
+ const THUMB_CDN = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb';
+ const textarea = document.getElementById('pg-textarea');
+ const highlight = document.getElementById('pg-highlight');
+ const preview = document.getElementById('pg-preview');
+ const avatarRow = document.getElementById('pg-avatars');
+ const modeChips = document.getElementById('pg-mode-chips');
+ const bgChips = document.getElementById('pg-bg-chips');
+ const optChips = document.getElementById('pg-option-chips');
+ const animsEl = document.getElementById('pg-anims');
+ const tabsEl = document.getElementById('pg-tabs');
+ const copyBtn = document.getElementById('pg-copy');
+ if (!textarea || !preview) return;
+
+ const state = {
+ avatarId: AVATAR_ID,
+ glbUrl: '',
+ mode: 'inline',
+ background: 'transparent',
+ options: { responsive: true, 'name-plate': 'off', 'avatar-chat': 'off', eager: true },
+ flavor: 'html',
+ };
+ let liveAgent = null;
+
+ function genCode() {
+ const attrs = [];
+ var isDemo = state.avatarId.indexOf('avatar_demo_') === 0;
+ if (isDemo && state.glbUrl) {
+ attrs.push('body="' + state.glbUrl + '"');
+ } else {
+ attrs.push('src="https://three.ws/api/avatars/' + state.avatarId + '"');
+ }
+ if (state.mode !== 'inline') attrs.push('mode="' + state.mode + '"');
+ if (state.background !== 'transparent') attrs.push('background="' + state.background + '"');
+ for (const [k, v] of Object.entries(state.options)) {
+ if (!v || v === 'off') continue;
+ attrs.push(typeof v === 'string' ? k + '="' + v + '"' : k);
+ }
+ const indent = state.flavor === 'html' ? ' ' : ' ';
+ const attrBlock = attrs.map(function(a) { return indent + a; }).join('\n');
+
+ if (state.flavor === 'html') {
+ return '<script type="module"\n src="https://three.ws/agent-3d/latest/agent-3d.js"\n><\/script>\n\n<agent-3d\n' + attrBlock + '\n></agent-3d>';
+ }
+ if (state.flavor === 'react') {
+ return "import 'https://three.ws/agent-3d/latest/agent-3d.js';\n\nexport default function MyAgent() {\n return (\n <agent-3d\n" + attrBlock + "\n />\n );\n}";
+ }
+ return '<script setup>\nimport \'https://three.ws/agent-3d/latest/agent-3d.js\';\n<\/script>\n\n<template>\n <agent-3d\n' + attrBlock + '\n />\n</template>';
+ }
+
+ function hl(code) {
+ var tokens = [];
+ var ph = function(cls, txt) { var id = '\x00' + tokens.length + '\x00'; tokens.push('<span class="' + cls + '">' + txt + '</span>'); return id; };
+ var s = code.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ s = s.replace(/(&lt;\/?[a-z][a-z0-9-]*)/gi, function(m) { return ph('tag', m); });
+ s = s.replace(/\b(import|from|export|default|function|return|const|let|var)\b/g, function(m) { return ph('kw', m); });
+ s = s.replace(/(\s)([a-z][a-z0-9-]*)(=)/gi, function(_, ws, name, eq) { return ws + ph('attr', name) + eq; });
+ s = s.replace(/("(?:[^"\\]|\\.)*?")/g, function(m) { return ph('str', m); });
+ s = s.replace(/(\/\/.*?)$/gm, function(m) { return ph('com', m); });
+ return s.replace(/\x00(\d+)\x00/g, function(_, i) { return tokens[parseInt(i)]; });
+ }
+
+ function syncCode() {
+ var code = genCode();
+ textarea.value = code;
+ highlight.innerHTML = hl(code);
+ }
+
+ function updatePreview() {
+ if (!state.glbUrl) return;
+ if (!liveAgent) {
+ liveAgent = document.createElement('agent-3d');
+ preview.appendChild(liveAgent);
+ }
+ liveAgent.setAttribute('body', state.glbUrl);
+ liveAgent.setAttribute('mode', state.mode);
+ liveAgent.setAttribute('background', state.background);
+ for (var entry of Object.entries(state.options)) {
+ var k = entry[0], v = entry[1];
+ if (v && v !== 'off') liveAgent.setAttribute(k, typeof v === 'string' ? v : '');
+ else liveAgent.removeAttribute(k);
+ }
+ preview.style.backgroundColor = state.background === '#ffffff' ? '#ffffff' : '';
+ }
+
+ function fetchGlb(id) {
+ return fetch(location.origin + '/api/avatars/' + id)
+ .then(function(r) { return r.json(); })
+ .then(function(d) { return devProxyGlb(d.avatar && (d.avatar.model_url || d.avatar.url)) || ''; })
+ .catch(function() { return ''; });
+ }
+
+ function switchAvatar(id, directGlb) {
+ state.avatarId = id;
+ avatarRow.querySelectorAll('.pg-avatar-item').forEach(function(el) {
+ el.classList.toggle('active', el.dataset.id === id);
+ });
+ var resolve = directGlb
+ ? Promise.resolve(devProxyGlb(directGlb))
+ : fetchGlb(id);
+ resolve.then(function(glb) {
+ state.glbUrl = glb;
+ syncCode();
+ if (liveAgent) { liveAgent.remove(); liveAgent = null; }
+ updatePreview();
+ });
+ }
+
+ function renderAvatars(list) {
+ avatarRow.innerHTML = '';
+ list.forEach(function(a) {
+ var btn = document.createElement('button');
+ btn.className = 'pg-avatar-item' + (a.id === state.avatarId ? ' active' : '');
+ btn.dataset.id = a.id;
+ if (a.glb) btn.dataset.glb = a.glb;
+ btn.title = a.name || a.id.slice(0, 8);
+ var initial = document.createElement('span');
+ initial.className = 'pg-avatar-initial';
+ initial.textContent = (a.name || '?').charAt(0);
+ btn.appendChild(initial);
+ if (a.thumb) {
+ var img = document.createElement('img');
+ img.src = a.thumb;
+ img.alt = a.name || '';
+ img.loading = 'lazy';
+ img.onerror = function() { this.style.display = 'none'; initial.style.display = 'flex'; };
+ btn.appendChild(img);
+ } else {
+ initial.style.display = 'flex';
+ }
+ btn.addEventListener('click', function() { switchAvatar(a.id, a.glb); });
+ avatarRow.appendChild(btn);
+ });
+ }
+
+ function loadAvatars() {
+ var O = location.origin;
+ var defaults = [
+ { id: AVATAR_ID, name: 'nich', thumb: THUMB_CDN + '/' + AVATAR_ID + '.png' },
+ { id: 'avatar_demo_disk_cz', name: 'CZ', glb: O + '/avatars/cz.glb' },
+ { id: 'avatar_demo_disk_boss', name: 'Boss', glb: O + '/animations/soldier.glb' },
+ { id: 'avatar_demo_disk_saga', name: 'Saga', glb: O + '/animations/robotexpressive.glb' },
+ { id: 'avatar_demo_disk_ansem', name: 'Ansem', glb: O + '/avatars/default.glb' },
+ { id: 'avatar_demo_disk_claude', name: 'Claude', glb: O + '/avatars/default.glb' },
+ { id: 'avatar_demo_disk_agent', name: 'Agent', glb: O + '/animations/soldier.glb' },
+ { id: 'avatar_demo_disk_ai', name: 'AI', glb: O + '/animations/robotexpressive.glb' },
+ ];
+ renderAvatars(defaults);
+ fetch('/api/marketplace')
+ .then(function(r) { return r.json(); })
+ .then(function(d) {
+ var items = (d.agents || d.items || d || []).slice(0, 24);
+ var list = defaults.slice();
+ var seen = {};
+ defaults.forEach(function(da) { seen[da.id] = true; });
+ items.forEach(function(item) {
+ var id = item.avatar_id || item.avatarId || item.id;
+ if (!id || seen[id]) return;
+ seen[id] = true;
+ list.push({
+ id: id,
+ name: item.name || item.agent_name || '',
+ thumb: item.thumbnail || (THUMB_CDN + '/' + id + '.png'),
+ });
+ });
+ renderAvatars(list.slice(0, 14));
+ }).catch(function() {});
+ }
+
+ function chipSelect(container, cb) {
+ container.addEventListener('click', function(e) {
+ var chip = e.target.closest('.pg-chip');
+ if (!chip) return;
+ container.querySelectorAll('.pg-chip').forEach(function(c) { c.classList.remove('active'); });
+ chip.classList.add('active');
+ cb(chip);
+ });
+ }
+
+ chipSelect(modeChips, function(chip) {
+ state.mode = chip.dataset.val;
+ syncCode(); updatePreview();
+ });
+
+ var colorTrigger = document.getElementById('pg-color-trigger');
+ var colorPopover = document.getElementById('pg-color-popover');
+ var colorSwatches = document.getElementById('pg-color-swatches');
+ var colorHexInput = document.getElementById('pg-color-hex');
+ var colorPreview = document.getElementById('pg-color-preview');
+
+ var palette = [
+ '#1a1a2e','#16213e','#0f3460','#533483','#e94560','#ff6b6b',
+ '#ffa07a','#ffd93d','#6bcb77','#4d96ff','#845ec2','#d65db1',
+ '#2d3436','#636e72','#b2bec3','#dfe6e9','#fdcb6e','#e17055',
+ '#00b894','#00cec9','#0984e3','#6c5ce7','#fd79a8','#e84393',
+ ];
+
+ palette.forEach(function(hex) {
+ var btn = document.createElement('button');
+ btn.className = 'pg-color-swatch';
+ btn.style.background = hex;
+ btn.dataset.color = hex;
+ btn.setAttribute('aria-label', hex);
+ colorSwatches.appendChild(btn);
+ });
+
+ function applyPickedColor(hex) {
+ state.background = hex;
+ colorTrigger.classList.add('active', 'has-color');
+ colorTrigger.style.setProperty('--pg-picked-color', hex);
+ colorPreview.style.background = hex;
+ colorHexInput.value = hex;
+ bgChips.querySelectorAll('.pg-chip').forEach(function(c) { c.classList.remove('active'); });
+ colorSwatches.querySelectorAll('.pg-color-swatch').forEach(function(s) {
+ s.classList.toggle('active', s.dataset.color === hex);
+ });
+ syncCode(); updatePreview();
+ }
+
+ chipSelect(bgChips, function(chip) {
+ state.background = chip.dataset.val;
+ colorTrigger.classList.remove('active', 'has-color');
+ colorPopover.classList.remove('open');
+ colorSwatches.querySelectorAll('.pg-color-swatch').forEach(function(s) { s.classList.remove('active'); });
+ syncCode(); updatePreview();
+ });
+
+ var popoverMoved = false;
+ function positionPopover() {
+ var rect = colorTrigger.getBoundingClientRect();
+ var pw = 220;
+ var left = rect.left + rect.width / 2 - pw / 2;
+ if (left < 8) left = 8;
+ if (left + pw > window.innerWidth - 8) left = window.innerWidth - 8 - pw;
+ colorPopover.style.top = (rect.bottom + 8) + 'px';
+ colorPopover.style.left = left + 'px';
+ }
+
+ colorTrigger.addEventListener('click', function(e) {
+ e.stopPropagation();
+ if (!popoverMoved) {
+ document.body.appendChild(colorPopover);
+ popoverMoved = true;
+ }
+ positionPopover();
+ colorPopover.classList.toggle('open');
+ });
+
+ window.addEventListener('scroll', function() {
+ if (colorPopover.classList.contains('open')) positionPopover();
+ }, { passive: true });
+ window.addEventListener('resize', function() {
+ if (colorPopover.classList.contains('open')) positionPopover();
+ });
+
+ colorSwatches.addEventListener('click', function(e) {
+ var swatch = e.target.closest('.pg-color-swatch');
+ if (!swatch) return;
+ applyPickedColor(swatch.dataset.color);
+ });
+
+ colorHexInput.addEventListener('input', function() {
+ var v = colorHexInput.value.trim();
+ if (!v.startsWith('#')) v = '#' + v;
+ if (/^#[0-9a-fA-F]{6}$/.test(v)) applyPickedColor(v);
+ });
+
+ colorHexInput.addEventListener('keydown', function(e) {
+ if (e.key === 'Enter') {
+ var v = colorHexInput.value.trim();
+ if (!v.startsWith('#')) v = '#' + v;
+ if (/^#[0-9a-fA-F]{6}$/.test(v)) {
+ applyPickedColor(v);
+ colorPopover.classList.remove('open');
+ }
+ }
+ });
+
+ document.addEventListener('click', function(e) {
+ if (!colorPopover.contains(e.target) && e.target !== colorTrigger) {
+ colorPopover.classList.remove('open');
+ }
+ });
+
+ optChips.addEventListener('click', function(e) {
+ var chip = e.target.closest('.pg-chip');
+ if (!chip) return;
+ var attr = chip.dataset.attr;
+ var isOn = chip.classList.toggle('active');
+ state.options[attr] = isOn ? (chip.dataset.val || true) : (chip.dataset.val ? 'off' : false);
+ syncCode(); updatePreview();
+ });
+
+ tabsEl.addEventListener('click', function(e) {
+ var tab = e.target.closest('.pg-tab');
+ if (!tab) return;
+ state.flavor = tab.dataset.flavor;
+ tabsEl.querySelectorAll('.pg-tab').forEach(function(t) { t.classList.toggle('active', t === tab); });
+ syncCode();
+ });
+
+ var editDebounce = null;
+ textarea.addEventListener('input', function() {
+ highlight.innerHTML = hl(textarea.value);
+ clearTimeout(editDebounce);
+ editDebounce = setTimeout(function() {
+ var code = textarea.value;
+ var m = code.match(/<agent-3d([^>]*?)(?:\/>|>)/i);
+ if (!m) return;
+ var as = m[1];
+ var ga = function(n) { var x = as.match(new RegExp(n + '="([^"]*)"', 'i')); return x ? x[1] : null; };
+ var ha = function(n) { return new RegExp('\\b' + n + '\\b', 'i').test(as); };
+ var src = ga('src');
+ if (src) {
+ var idm = src.match(/avatars\/([a-f0-9-]+)/);
+ if (idm && idm[1] !== state.avatarId) { switchAvatar(idm[1]); return; }
+ }
+ var mode = ga('mode');
+ if (mode && mode !== state.mode) state.mode = mode;
+ var bg = ga('background');
+ if (bg !== null) state.background = bg;
+ state.options.responsive = ha('responsive');
+ state.options['name-plate'] = ga('name-plate') === 'on' ? 'on' : 'off';
+ state.options['avatar-chat'] = ga('avatar-chat') === 'on' ? 'on' : 'off';
+ state.options.eager = ha('eager');
+ updatePreview();
+ }, 350);
+ });
+
+ textarea.addEventListener('scroll', function() {
+ highlight.scrollTop = textarea.scrollTop;
+ highlight.scrollLeft = textarea.scrollLeft;
+ });
+
+ textarea.addEventListener('keydown', function(e) {
+ if (e.key === 'Tab') {
+ e.preventDefault();
+ var s = textarea.selectionStart, end = textarea.selectionEnd;
+ textarea.value = textarea.value.substring(0, s) + ' ' + textarea.value.substring(end);
+ textarea.selectionStart = textarea.selectionEnd = s + 2;
+ textarea.dispatchEvent(new Event('input'));
+ }
+ });
+
+ copyBtn.addEventListener('click', function() {
+ navigator.clipboard.writeText(textarea.value).then(function() {
+ copyBtn.classList.add('copied');
+ copyBtn.textContent = 'Copied';
+ setTimeout(function() { copyBtn.classList.remove('copied'); copyBtn.textContent = 'Copy'; }, 1600);
+ }).catch(function() {});
+ });
+
+ animsEl.addEventListener('click', function(e) {
+ var btn = e.target.closest('.pg-anim');
+ if (!btn || !liveAgent) return;
+ var clip = btn.dataset.anim;
+ if (liveAgent.playClipByName) liveAgent.playClipByName(clip, { loop: clip === 'idle', fade_ms: 400 });
+ animsEl.querySelectorAll('.pg-anim').forEach(function(c) { c.classList.remove('active'); });
+ btn.classList.add('active');
+ if (clip !== 'idle') {
+ clearTimeout(animsEl._t);
+ animsEl._t = setTimeout(function() { btn.classList.remove('active'); }, 5000);
+ }
+ });
+
+ fetchGlb(state.avatarId).then(function(glb) {
+ state.glbUrl = glb;
+ syncCode();
+ updatePreview();
+ loadAvatars();
+ });
+ })();
+
+ // ── Showcase 3D — live agent grid ──────────────────────────────
+ (function () {
+ const SHOWCASE_ANIMS = ['idle', 'dance', 'wave', 'celebrate', 'capoeira', 'thriller'];
+ const SHOWCASE_TAGS = ['3D', 'animated', 'rigged', 'ERC-8004', 'x402', 'community'];
+ const EXPLORE_SHOWCASE_URL = '/api/explore?source=all&limit=6&quality=high';
+ const FALLBACK_AGENTS = [
+ { name: 'nich', description: '@nirholas', glbUrl: '/avatars/default.glb', viewerUrl: '/agent-next?id=bacff13e-b64b-4ac0-860d-44f0168ad23b', kind: 'avatar' },
+ { name: 'CZ', description: 'Stylized humanoid', glbUrl: '/avatars/cz.glb', viewerUrl: '/avatars/avatar_demo_disk_cz', kind: 'avatar' },
+ { name: 'Boss', description: 'Soldier rig', glbUrl: '/animations/soldier.glb', viewerUrl: '/avatars/avatar_demo_disk_boss', kind: 'avatar' },
+ { name: 'Saga', description: 'Expressive robot', glbUrl: '/animations/robotexpressive.glb', viewerUrl: '/avatars/avatar_demo_disk_saga', kind: 'avatar' },
+ { name: 'Agent', description: 'Autonomous operative', glbUrl: '/animations/soldier.glb', viewerUrl: '/avatars/avatar_demo_disk_agent', kind: 'avatar' },
+ { name: 'Claude', description: 'AI persona', glbUrl: '/avatars/default.glb', viewerUrl: '/avatars/avatar_demo_disk_claude', kind: 'avatar' },
+ ];
+ const grid = document.getElementById('showcase-3d-grid');
+ if (!grid) return;
+
+ function hashHue(str) {
+ var h = 0;
+ for (var i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) >>> 0;
+ return h % 360;
+ }
+
+ function makeAgentCard(item, idx) {
+ var card = document.createElement('a');
+ card.className = 'showcase-agent-card';
+ card.href = item.viewerUrl || ('/avatars/' + (item.avatarId || item.agentId));
+
+ var h = hashHue(item.avatarId || item.agentId || item.name || String(idx));
+ var h2 = (h + 50) % 360;
+ var grad = document.createElement('div');
+ grad.className = 'showcase-card-grad';
+ grad.style.background = 'radial-gradient(ellipse at 50% 80%, hsl(' + h + ' 60% 18% / 0.6) 0%, hsl(' + h2 + ' 50% 6% / 0.3) 70%, transparent 100%)';
+ card.appendChild(grad);
+
+ var skel = document.createElement('div');
+ skel.className = 'showcase-card-skel';
+ skel.innerHTML = '<div class="showcase-card-skel-ring"></div>';
+ card.appendChild(skel);
+
+ var floor = document.createElement('div');
+ floor.className = 'showcase-card-floor';
+ card.appendChild(floor);
+
+ var glbUrl = item.glbUrl || '';
+ if (glbUrl) {
+ glbUrl = devProxyGlb(glbUrl);
+ } else if (item.avatarId) {
+ (async function() {
+ try {
+ var r = await fetch('/api/avatars/' + item.avatarId);
+ var d = await r.json();
+ var url = devProxyGlb(d.avatar?.model_url || d.avatar?.url);
+ if (url) bootAgent(card, skel, url, idx);
+ } catch (_) {}
+ })();
+ }
+
+ if (item.kind === 'onchain') {
+ var tag = document.createElement('span');
+ tag.className = 'showcase-card-tag';
+ tag.textContent = 'On-chain';
+ card.appendChild(tag);
+ } else if (idx === 0) {
+ var ftag = document.createElement('span');
+ ftag.className = 'showcase-card-tag';
+ ftag.textContent = 'Featured';
+ card.appendChild(ftag);
+ }
+
+ var animLabel = document.createElement('span');
+ animLabel.className = 'showcase-card-anim-tag';
+ animLabel.textContent = SHOWCASE_TAGS[idx % SHOWCASE_TAGS.length];
+ card.appendChild(animLabel);
+
+ var meta = document.createElement('div');
+ meta.className = 'showcase-card-meta';
+ meta.innerHTML = '<div class="showcase-card-name">' + escHtml(item.name || 'Agent') + '</div>'
+ + '<div class="showcase-card-sub">' + escHtml(item.description ? item.description.slice(0, 50) : (item.kind === 'onchain' ? 'ERC-8004' : 'GLB')) + '</div>';
+ card.appendChild(meta);
+
+ if (glbUrl) bootAgent(card, skel, glbUrl, idx);
+
+ return card;
+ }
+
+ function bootAgent(card, skel, glbUrl, idx) {
+ var el = document.createElement('agent-3d');
+ el.setAttribute('body', glbUrl);
+ el.setAttribute('mode', 'inline');
+ el.setAttribute('responsive', '');
+ el.setAttribute('background', 'transparent');
+ el.setAttribute('name-plate', 'off');
+ el.setAttribute('avatar-chat', 'off');
+ el.setAttribute('kiosk', '');
+ card.insertBefore(el, skel);
+
+ el.addEventListener('agent:ready', function () {
+ el.classList.add('loaded');
+ if (skel && skel.parentNode) skel.remove();
+ var anim = SHOWCASE_ANIMS[idx % SHOWCASE_ANIMS.length];
+ if (anim !== 'idle') {
+ el.playClipByName?.(anim, { loop: true, fade_ms: 600 });
+ }
+ }, { once: true });
+ }
+
+ function makeCta(href, icon, label, sub) {
+ var a = document.createElement('a');
+ a.className = 'showcase-cta-card';
+ a.href = href;
+ a.innerHTML = '<span class="showcase-cta-icon">' + icon + '</span>'
+ + '<span class="showcase-cta-label">' + label + '</span>'
+ + '<span class="showcase-cta-sub">' + sub + '</span>';
+ return a;
+ }
+
+ function escHtml(s) {
+ var d = document.createElement('span');
+ d.textContent = s;
+ return d.innerHTML;
+ }
+
+ function renderShowcase(agentItems) {
+ agentItems.forEach(function (item, i) {
+ grid.appendChild(makeAgentCard(item, i));
+ });
+ grid.appendChild(makeCta('/discover', '→', 'Browse all', 'Public agent directory'));
+ grid.appendChild(makeCta('/create', '✨', 'Make your own', 'Selfie → agent · 60s'));
+ }
+
+ var showcaseBooted = false;
+ var showcaseObs = new IntersectionObserver(function (entries) {
+ if (!entries[0].isIntersecting || showcaseBooted) return;
+ showcaseBooted = true;
+ showcaseObs.disconnect();
+
+ fetch(EXPLORE_SHOWCASE_URL, { headers: { accept: 'application/json' } })
+ .then(function (r) { return r.json(); })
+ .then(function (data) {
+ var items = Array.isArray(data.items) ? data.items : [];
+ var agentItems = items.filter(function (it) { return it.glbUrl || it.avatarId; }).slice(0, 6);
+ renderShowcase(agentItems.length >= 3 ? agentItems : FALLBACK_AGENTS);
+ })
+ .catch(function () {
+ renderShowcase(FALLBACK_AGENTS);
+ });
+ }, { rootMargin: '200px' });
+ showcaseObs.observe(grid);
+ })();
+
+ // ── Vclose section ──────────────────────────────────────────────
(async () => {
try {
const r = await fetch(`${location.origin}/api/avatars/${AVATAR_ID}`);
const d = await r.json();
- const glb = d.avatar?.model_url || d.avatar?.url;
+ const glb = devProxyGlb(d.avatar?.model_url || d.avatar?.url);
if (!glb) return;
- const heroInner = document.getElementById('hero-stage-inner');
- if (heroInner) {
- const heroEl = spawnAgent(glb);
- heroInner.appendChild(heroEl);
- initHeroWalk(heroEl);
+
+ const slot = document.getElementById('vclose-agent-slot');
+ if (!slot) return;
+ const vcloseEl = document.createElement('agent-3d');
+ vcloseEl.id = 'vclose-agent';
+ vcloseEl.className = 'vclose-agent';
+ vcloseEl.setAttribute('body', glb);
+ vcloseEl.setAttribute('mode', 'inline');
+ vcloseEl.setAttribute('responsive', '');
+ vcloseEl.setAttribute('background', 'transparent');
+ vcloseEl.setAttribute('name-plate', 'off');
+ vcloseEl.setAttribute('avatar-chat', 'off');
+ vcloseEl.setAttribute('kiosk', '');
+ slot.replaceWith(vcloseEl);
+
+ let vcloseInited = false;
+ const ANIMS = ['wave','dance','capoeira','jump','thriller','pray','celebrate','rumba','falling','kiss','taunt'];
+ let vcloseLast = null;
+
+ function vcloseReady() {
+ if (vcloseInited) return;
+ vcloseInited = true;
+ vcloseEl.classList.add('loaded');
+ vcloseEl.playClipByName?.('idle', { loop: true, fade_ms: 400 });
+ }
+ vcloseEl.addEventListener('agent:ready', vcloseReady, { once: true });
+
+ const vcloseChips = document.getElementById('vclose-chips');
+ if (vcloseChips) {
+ vcloseChips.addEventListener('click', (e) => {
+ const btn = e.target.closest('.hero-chip');
+ if (!btn) return;
+ let clip = btn.dataset.anim;
+ if (clip === '__random') {
+ const pool = ANIMS.filter(a => a !== vcloseLast);
+ clip = pool[Math.floor(Math.random() * pool.length)];
+ }
+ vcloseLast = clip;
+ vcloseChips.querySelectorAll('.hero-chip').forEach(c => delete c.dataset.active);
+ btn.dataset.active = 'true';
+ vcloseEl.playClipByName?.(clip, { loop: false, fade_ms: 400 });
+ clearTimeout(vcloseChips._timer);
+ vcloseChips._timer = setTimeout(() => delete btn.dataset.active, 6000);
+ });
+ }
+
+ const vcloseSection = document.getElementById('vclose');
+ if (vcloseSection) {
+ const io = new IntersectionObserver((entries) => {
+ if (entries[0].isIntersecting && !vcloseInited) {
+ vcloseReady();
+ }
+ }, { threshold: 0, rootMargin: '200px' });
+ io.observe(vcloseSection);
}
- const embedSlot = document.querySelector('.render-pane .live-agent-slot');
- if (embedSlot) embedSlot.replaceWith(spawnAgent(glb));
} catch (e) {
- console.warn('[home] avatar boot failed', e);
+ console.warn('[home] vclose avatar boot failed', e);
}
})();
- // ── Hero walk cycle ─────────────────────────────────────────────
- function initHeroWalk(heroAgent) {
- const WALK_CLIP = 'av-walk-feminine';
- const IDLE_CLIP = 'idle';
- let active = true;
-
- async function walkCycle() {
- await new Promise(r => setTimeout(r, 2000));
- if (!active) return;
- heroAgent.playClipByName?.(WALK_CLIP, { loop: true, fade_ms: 400 });
- await new Promise(r => setTimeout(r, 5000));
- if (!active) return;
- heroAgent.playClipByName?.(IDLE_CLIP, { loop: true, fade_ms: 600 });
- await new Promise(r => setTimeout(r, 3000));
- walkCycle();
+ // ── Reveal on scroll (IntersectionObserver) ────────────────────
+ {
+ const revealEls = document.querySelectorAll('.reveal');
+ if (revealEls.length) {
+ const revealObs = new IntersectionObserver((entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('vis');
+ revealObs.unobserve(entry.target);
+ }
+ });
+ }, { threshold: 0.08, rootMargin: '0px 0px -40px 0px' });
+ revealEls.forEach((el) => revealObs.observe(el));
}
+ }
- heroAgent.addEventListener('agent:ready', walkCycle, { once: true });
- if (heroAgent._viewer) walkCycle();
+ // ── Hero text entrance ──────────────────────────────────────────
+ requestAnimationFrame(() => {
+ const heroText = document.querySelector('.hero-text');
+ if (heroText) heroText.classList.add('entered');
+ });
- document.addEventListener('visibilitychange', () => {
- active = !document.hidden;
- if (active) walkCycle();
- });
+ // ── Hero agent loaded state ─────────────────────────────────────
+ {
+ const heroStage = document.getElementById('hero-stage');
+ const shimmer = document.getElementById('hero-shimmer');
+ if (heroStage) {
+ const checkLoaded = () => {
+ const agentEl = heroStage.querySelector('agent-3d');
+ if (!agentEl) return;
+ const markLoaded = () => {
+ agentEl.classList.add('loaded');
+ if (shimmer) shimmer.classList.add('hidden');
+ };
+ agentEl.addEventListener('agent:ready', markLoaded, { once: true });
+ if (agentEl._viewer) markLoaded();
+ };
+ const mo = new MutationObserver(() => { checkLoaded(); mo.disconnect(); });
+ mo.observe(heroStage, { childList: true, subtree: true });
+ checkLoaded();
+ }
}
- // ── Hero parallax tilt ──────────────────────────────────────────
- const stage = document.getElementById('hero-stage');
- const inner = document.getElementById('hero-stage-inner');
- if (stage && inner && window.matchMedia('(min-width: 980px)').matches) {
- let rx = 0, ry = 0, tx = 0, ty = 0;
- const lerp = (a, b, t) => a + (b - a) * t;
- stage.addEventListener('mousemove', (e) => {
- const r = stage.getBoundingClientRect();
- tx = ((e.clientX - r.left) / r.width - 0.5) * 6;
- ty = -((e.clientY - r.top) / r.height - 0.5) * 4;
- });
- stage.addEventListener('mouseleave', () => { tx = 0; ty = 0; });
- (function tick() {
- rx = lerp(rx, ty, 0.08);
- ry = lerp(ry, tx, 0.08);
- inner.style.transform = `perspective(1400px) rotateX(${rx.toFixed(2)}deg) rotateY(${ry.toFixed(2)}deg)`;
- requestAnimationFrame(tick);
- })();
- }
+ // ── 3D Stack section: mouse-tracked perspective + spotlight ─────
+ {
+ const scene = document.getElementById('stack-3d-scene');
+ const wrap = document.getElementById('stack-3d');
+ if (scene && wrap && window.matchMedia('(min-width: 601px)').matches
+ && !window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ let rx = 0, ry = 0, tx = 0, ty = 0;
+ const lerp = (a, b, t) => a + (b - a) * t;
- // ── Embed snippet / flavor tabs ─────────────────────────────────
- const SNIPPETS = {
- html: `<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"><\/script>\n<agent-3d src="https://three.ws/api/avatars/bacff13e-b64b-4ac0-860d-44f0168ad23b"><\/agent-3d>`,
- react: `import 'https://three.ws/agent-3d/latest/agent-3d.js';\n\nexport default function MyAgent() {\n return <agent-3d src="https://three.ws/api/avatars/bacff13e..." />;\n}`,
- vue: `<script setup>\nimport 'https://three.ws/agent-3d/latest/agent-3d.js';\n<\/script>\n\n<template>\n <agent-3d src="https://three.ws/api/avatars/bacff13e..." />\n<\/template>`,
- };
- const snippetEl = document.getElementById('embed-snippet');
- const copyBtn = document.getElementById('copy-btn');
- const tabBtns = document.querySelectorAll('.pane-head .tab');
- let activeFlavor = 'html';
- const esc = (s) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
- function highlight(code) {
- return esc(code)
- .replace(/(&lt;\/?[a-z][a-z0-9-]*)/gi, '<span class="tag">$1</span>')
- .replace(/(\s)([a-z-]+)(=)/gi, '$1<span class="attr">$2</span>$3')
- .replace(/(&quot;[^&]*?&quot;|"[^"]*?")/g, '<span class="str">$1</span>');
- }
- function setFlavor(f) {
- activeFlavor = f;
- tabBtns.forEach((b) => b.classList.toggle('active', b.dataset.flavor === f));
- snippetEl.innerHTML = highlight(SNIPPETS[f]);
+ wrap.addEventListener('mousemove', (e) => {
+ const r = wrap.getBoundingClientRect();
+ const nx = (e.clientX - r.left) / r.width;
+ const ny = (e.clientY - r.top) / r.height;
+ tx = (nx - 0.5) * 8;
+ ty = -(ny - 0.5) * 5;
+ });
+ wrap.addEventListener('mouseleave', () => { tx = 0; ty = 0; });
+
+ (function tick() {
+ rx = lerp(rx, ty, 0.06);
+ ry = lerp(ry, tx, 0.06);
+ scene.style.transform =
+ `rotateX(${rx.toFixed(2)}deg) rotateY(${ry.toFixed(2)}deg)`;
+ requestAnimationFrame(tick);
+ })();
+
+ scene.addEventListener('mousemove', (e) => {
+ const cards = scene.querySelectorAll('.stack-card');
+ cards.forEach(card => {
+ const cr = card.getBoundingClientRect();
+ card.style.setProperty('--mx', (e.clientX - cr.left) + 'px');
+ card.style.setProperty('--my', (e.clientY - cr.top) + 'px');
+ });
+ });
+ }
+
+ if (wrap) {
+ setTimeout(() => wrap.classList.add('settled'), 800);
+ }
}
- tabBtns.forEach((b) => b.addEventListener('click', () => setFlavor(b.dataset.flavor)));
- copyBtn.addEventListener('click', async () => {
- try {
- await navigator.clipboard.writeText(SNIPPETS[activeFlavor]);
- copyBtn.classList.add('copied');
- copyBtn.textContent = 'Copied';
- setTimeout(() => { copyBtn.classList.remove('copied'); copyBtn.textContent = 'Copy'; }, 1600);
- } catch (_) {}
- });
// ── Live marketing stats ────────────────────────────────────────
(async () => {
@@ -1729,15 +4238,886 @@
const fmt = (n) => Number(n).toLocaleString('en-US');
if (d.agents) {
- document.getElementById('m-agents').textContent = fmt(d.agents);
- document.getElementById('m-sites').textContent = fmt(d.widgets);
- document.getElementById('m-onchain').textContent = fmt(d.onchain_agents);
document.getElementById('sb-agents').textContent = fmt(d.agents);
document.getElementById('sb-widgets').textContent = fmt(d.widgets);
document.getElementById('sb-onchain').textContent = fmt(d.onchain_agents);
}
} catch (_) {}
})();
+
+ // ── Live feature agents ─────────────────────────────────────────
+ (function initLiveFeatures() {
+ var O = location.origin;
+ var LIVE_SPOTS = [
+ { id: 'door-create', anim: 'idle', loop: true, glb: null },
+ { id: 'door-embed', anim: 'wave', loop: false, glb: O + '/avatars/cz.glb' },
+ { id: 'door-earn', anim: 'dance', loop: true, glb: O + '/animations/soldier.glb' },
+ { id: 'bento-studio', anim: 'idle', loop: true, glb: null },
+ { id: 'bento-anim', anim: 'idle', loop: true, glb: null }
+ ];
+
+ function spawnMini(container, glb, opts) {
+ var el = document.createElement('agent-3d');
+ el.setAttribute('body', glb);
+ el.setAttribute('mode', 'inline');
+ el.setAttribute('responsive', '');
+ el.setAttribute('background', 'transparent');
+ el.setAttribute('name-plate', 'off');
+ el.setAttribute('avatar-chat', 'off');
+ el.setAttribute('kiosk', '');
+ el.setAttribute('eager', '');
+ container.appendChild(el);
+ el.addEventListener('agent:ready', function() {
+ if (el.playClipByName) el.playClipByName(opts.anim, { loop: opts.loop !== false, fade_ms: 400 });
+ }, { once: true });
+ return el;
+ }
+
+ fetch(location.origin + '/api/avatars/' + AVATAR_ID)
+ .then(function(r) { return r.json(); })
+ .then(function(d) {
+ var apiGlb = devProxyGlb(d.avatar && (d.avatar.model_url || d.avatar.url));
+ if (!apiGlb) return;
+ var io = new IntersectionObserver(function(entries) {
+ entries.forEach(function(entry) {
+ if (!entry.isIntersecting) return;
+ var spot = LIVE_SPOTS.find(function(s) { return s.id === entry.target.id; });
+ if (!spot || entry.target.querySelector('agent-3d')) return;
+ io.unobserve(entry.target);
+ spawnMini(entry.target, spot.glb || apiGlb, spot);
+ });
+ }, { rootMargin: '300px' });
+ LIVE_SPOTS.forEach(function(spot) {
+ var el = document.getElementById(spot.id);
+ if (el) io.observe(el);
+ });
+ }).catch(function() {});
+
+ // Bento animation pills
+ var animPills = document.getElementById('bento-anim-pills');
+ if (animPills) {
+ animPills.addEventListener('click', function(e) {
+ var btn = e.target.closest('.bento-pill-btn');
+ if (!btn) return;
+ e.preventDefault(); e.stopPropagation();
+ var clip = btn.dataset.anim;
+ var agent = document.querySelector('#bento-anim agent-3d');
+ if (agent && agent.playClipByName) agent.playClipByName(clip, { loop: clip === 'idle', fade_ms: 400 });
+ animPills.querySelectorAll('.bento-pill-btn').forEach(function(p) { p.classList.remove('active'); });
+ btn.classList.add('active');
+ });
+ }
+
+ // Earn door ticker
+ var earnVal = document.getElementById('door-earn-val');
+ if (earnVal) {
+ var started = false;
+ var earnObs = new IntersectionObserver(function(entries) {
+ if (entries[0].isIntersecting && !started) {
+ started = true; earnObs.disconnect();
+ var val = 0, target = 847.5;
+ (function tick() {
+ val += (target - val) * 0.025;
+ if (val >= target - 0.01) val = target;
+ earnVal.textContent = '$' + val.toFixed(2);
+ if (val < target) requestAnimationFrame(tick);
+ })();
+ }
+ });
+ earnObs.observe(earnVal);
+ }
+ })();
+</script>
+<script src="/src/api-playground.js"></script>
+<script src="/src/editorial-pretext.js"></script>
+<script type="module">
+import * as THREE from 'three';
+import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+
+const canvas = document.getElementById('pricing-canvas');
+const tiers = [...document.querySelectorAll('#pricing-stage .pricing-card')];
+
+if (canvas && tiers.length && window.matchMedia('(min-width: 861px)').matches) {
+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
+ renderer.toneMappingExposure = 1.1;
+
+ const scene = new THREE.Scene();
+ const PX_PER_UNIT = 120;
+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);
+ camera.position.z = 10;
+
+ function updateFrustum() {
+ const r = canvas.getBoundingClientRect();
+ if (!r.width || !r.height) return;
+ const hw = r.width / PX_PER_UNIT / 2;
+ const hh = r.height / PX_PER_UNIT / 2;
+ camera.left = -hw; camera.right = hw;
+ camera.top = hh; camera.bottom = -hh;
+ camera.updateProjectionMatrix();
+ }
+
+ const _v3 = new THREE.Vector3();
+ function domToWorld(sx, sy) {
+ const r = canvas.getBoundingClientRect();
+ _v3.set(
+ ((sx - r.left) / r.width) * 2 - 1,
+ -((sy - r.top) / r.height) * 2 + 1,
+ 0
+ );
+ _v3.unproject(camera);
+ return { x: _v3.x, y: _v3.y };
+ }
+
+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;
+ let phase = 'loading';
+ let activeTier = null;
+
+ function resize() {
+ const r = canvas.getBoundingClientRect();
+ if (!r.width || !r.height) return;
+ renderer.setSize(r.width, r.height, false);
+ updateFrustum();
+ if (avatar && activeTier && phase === 'idle') {
+ const t = standOnTopOf(activeTier);
+ avatar.position.set(t.x, t.y, 0);
+ }
+ }
+ window.addEventListener('resize', resize);
+
+ scene.add(new THREE.AmbientLight(0xffffff, 0.6));
+ const keyLight = new THREE.DirectionalLight(0xfff4dc, 2.0);
+ keyLight.position.set(3, 6, 5); scene.add(keyLight);
+ const rimLight = new THREE.DirectionalLight(0x4060ff, 0.6);
+ rimLight.position.set(-4, 3, -2); scene.add(rimLight);
+ const fillLight = new THREE.DirectionalLight(0xffeedd, 0.4);
+ fillLight.position.set(0, 2, 7); scene.add(fillLight);
+
+ const actions = {};
+ let currentAction = null;
+ const FADE_S = 0.3;
+
+ function setAnimation(name, opts = {}) {
+ const next = actions[name];
+ if (!next || next === currentAction) return;
+ const loop = opts.loop !== false;
+ next.reset();
+ next.setLoop(loop ? THREE.LoopRepeat : THREE.LoopOnce, loop ? Infinity : 1);
+ next.clampWhenFinished = !!opts.hold;
+ if (currentAction) next.crossFadeFrom(currentAction, FADE_S, false).play();
+ else next.fadeIn(FADE_S).play();
+ currentAction = next;
+ }
+
+ function standOnTopOf(tierEl) {
+ const r = tierEl.getBoundingClientRect();
+ return domToWorld(r.left + r.width / 2, r.top);
+ }
+
+ let walkT = 0, walkStart = null, walkEnd = null, walkDur = 0.85, walkPeakRise = 0;
+ let onArrival = null;
+ const WALK_SPEED = 5;
+ function smoothstep(t) { return t * t * (3 - 2 * t); }
+
+ function beginMove(tierEl) {
+ if (activeTier) activeTier.classList.remove('is-active');
+ activeTier = tierEl;
+ activeTier.classList.add('is-active');
+ }
+
+ function walkToTier(tierEl) {
+ if (!avatar || tierEl === activeTier) return;
+ beginMove(tierEl);
+ phase = 'walking';
+ walkT = 0;
+ walkStart = { x: avatar.position.x, y: avatar.position.y };
+ walkEnd = standOnTopOf(tierEl);
+ const dx = Math.abs(walkEnd.x - walkStart.x);
+ walkDur = Math.max(0.4, dx / WALK_SPEED);
+ const minX = Math.min(walkStart.x, walkEnd.x);
+ const maxX = Math.max(walkStart.x, walkEnd.x);
+ const baseY = Math.max(walkStart.y, walkEnd.y);
+ let peakY = baseY;
+ for (const tt of tiers) {
+ const tp = standOnTopOf(tt);
+ if (tp.x > minX && tp.x < maxX && tp.y > peakY) peakY = tp.y;
+ }
+ walkPeakRise = peakY - baseY;
+ setAnimation('walk', { loop: true });
+ const dir = Math.sign(walkEnd.x - walkStart.x) || 0;
+ avatar.rotation.y = dir * (Math.PI / 2);
+ }
+
+ const CTA_REACTION = { beta: 'wave', pro: 'av-celebrating', enterprise: 'av-brag-claps' };
+ const CTA_REACTION_MAX_MS = 3500;
+
+ function landOnTier() {
+ phase = 'idle';
+ const snap = standOnTopOf(activeTier);
+ avatar.position.set(snap.x, snap.y, 0);
+ setAnimation('idle', { loop: true });
+ if (onArrival) {
+ const cb = onArrival;
+ onArrival = null;
+ setTimeout(cb, 300);
+ }
+ }
+
+ let hoverTimer = null, hoverPendingTier = null;
+ function scheduleMove(tierEl) {
+ if (!tierEl) { clearTimeout(hoverTimer); hoverPendingTier = null; return; }
+ if (tierEl === activeTier) { clearTimeout(hoverTimer); hoverPendingTier = null; return; }
+ if (tierEl === hoverPendingTier) return;
+ clearTimeout(hoverTimer);
+ hoverPendingTier = tierEl;
+ hoverTimer = setTimeout(() => {
+ hoverPendingTier = null;
+ if (phase === 'walking') setTimeout(() => scheduleMove(tierEl), 200);
+ else walkToTier(tierEl);
+ }, 120);
+ }
+
+ function tierAtPoint(cx, cy) {
+ for (const t of tiers) {
+ const r = t.getBoundingClientRect();
+ if (cx >= r.left && cx <= r.right && cy >= r.top && cy <= r.bottom) return t;
+ }
+ return null;
+ }
+
+ const grid = document.querySelector('#pricing-stage .pricing-grid');
+ grid.addEventListener('mousemove', e => scheduleMove(tierAtPoint(e.clientX, e.clientY)));
+ grid.addEventListener('mouseleave', () => scheduleMove(null));
+
+ document.querySelectorAll('#pricing-stage [data-tier-cta]').forEach(cta => {
+ cta.addEventListener('click', e => {
+ if (!avatar) return;
+ const tierEl = document.getElementById('tier-' + cta.dataset.tierCta);
+ const reactionClip = CTA_REACTION[tierEl?.dataset.tier] || 'wave';
+ const fireReaction = () => {
+ setAnimation(reactionClip, { loop: false, hold: true });
+ const clipDur = actions[reactionClip]?.getClip().duration ?? 2;
+ const playMs = Math.min(clipDur * 1000, CTA_REACTION_MAX_MS);
+ setTimeout(() => { if (phase === 'idle') setAnimation('idle', { loop: true }); }, playMs);
+ };
+ if (tierEl === activeTier && phase === 'idle') {
+ e.preventDefault();
+ fireReaction();
+ } else if (tierEl !== activeTier) {
+ e.preventDefault();
+ onArrival = fireReaction;
+ walkToTier(tierEl);
+ }
+ });
+ });
+
+ let mouseNx = 0, mouseNy = 0;
+ window.addEventListener('mousemove', e => {
+ mouseNx = (e.clientX / window.innerWidth) * 2 - 1;
+ mouseNy = (e.clientY / window.innerHeight) * 2 - 1;
+ });
+
+ const ro = new ResizeObserver(() => {
+ if (avatar && activeTier && phase === 'idle') {
+ const t = standOnTopOf(activeTier);
+ avatar.position.set(t.x, t.y, 0);
+ }
+ });
+ tiers.forEach(t => ro.observe(t));
+
+ const CLIPS = ['idle', 'walk', 'wave', 'av-celebrating', 'av-brag-claps'];
+ let loaded = false;
+
+ const io = new IntersectionObserver(entries => {
+ if (!entries[0].isIntersecting || loaded) return;
+ loaded = true;
+ io.disconnect();
+ resize();
+
+ new GLTFLoader().load('/avatars/cz.glb', gltf => {
+ avatar = gltf.scene;
+ avatar.traverse(n => {
+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name)) rootBone = n;
+ });
+ scene.add(avatar);
+ mixer = new THREE.AnimationMixer(avatar);
+
+ Promise.all(CLIPS.map(name =>
+ fetch('/animations/clips/' + name + '.json').then(r => r.json())
+ )).then(jsons => {
+ CLIPS.forEach((name, i) => {
+ actions[name] = mixer.clipAction(THREE.AnimationClip.parse(jsons[i]));
+ });
+ if (rootBone) baseRootPos = rootBone.position.clone();
+ const _render = renderer.render.bind(renderer);
+ renderer.render = (sc, cam) => {
+ try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}
+ _render(sc, cam);
+ };
+
+ const pro = document.getElementById('tier-pro');
+ activeTier = pro;
+ pro.classList.add('is-active');
+ const start = standOnTopOf(pro);
+ avatar.position.set(start.x, start.y, 0);
+ setAnimation('idle', { loop: true });
+ phase = 'idle';
+ });
+ });
+ }, { threshold: 0, rootMargin: '400px' });
+ io.observe(document.getElementById('pricing-stage'));
+
+ const clock = new THREE.Clock();
+ (function tick() {
+ requestAnimationFrame(tick);
+ try {
+ const dt = Math.min(clock.getDelta(), 0.05);
+ mixer?.update(dt);
+
+ if (phase === 'walking' && avatar && walkStart && walkEnd) {
+ walkT += dt;
+ const p = Math.min(walkT / walkDur, 1);
+ const e = smoothstep(p);
+ const x = walkStart.x + (walkEnd.x - walkStart.x) * e;
+ const arc = walkPeakRise * 4 * p * (1 - p);
+ const y = walkStart.y + (walkEnd.y - walkStart.y) * e + arc;
+ avatar.position.set(x, y, 0);
+ if (p >= 1) landOnTier();
+ }
+
+ if (phase === 'idle' && avatar) {
+ avatar.rotation.y *= 0.9;
+ }
+
+ const targetCamX = mouseNx * 0.08;
+ const targetCamY = -mouseNy * 0.05;
+ camera.position.x += (targetCamX - camera.position.x) * 0.04;
+ camera.position.y += (targetCamY - camera.position.y) * 0.04;
+
+ renderer.render(scene, camera);
+ } catch (_) {}
+ })();
+}
+</script>
+
+<script>
+// ── Interactive Bento Features ─────────────────────────────────────
+(function initBentoInteractives() {
+
+ // ── 1. Avatar Studio: webcam + drag-drop ────────────────────────
+ (function() {
+ var drop = document.getElementById('studio-drop');
+ var fileInput = document.getElementById('studio-file');
+ var webcamBtn = document.getElementById('studio-webcam-btn');
+ var zone = document.getElementById('studio-zone');
+ var processing = document.getElementById('studio-processing');
+ var previewImg = document.getElementById('studio-preview-img');
+ var processingText = document.getElementById('studio-processing-text');
+ var done = document.getElementById('studio-done');
+ if (!drop) return;
+
+ function runPipeline(imgUrl) {
+ zone.style.display = 'none';
+ previewImg.src = imgUrl;
+ previewImg.classList.add('show');
+ processing.classList.add('active');
+ var steps = ['Detecting face...', 'Generating 3D mesh...', 'Auto-rigging skeleton...', 'Retargeting animations...'];
+ var i = 0;
+ var iv = setInterval(function() {
+ i++;
+ if (i < steps.length) {
+ processingText.textContent = steps[i];
+ } else {
+ clearInterval(iv);
+ processing.classList.remove('active');
+ done.classList.add('show');
+ }
+ }, 700);
+ }
+
+ drop.addEventListener('click', function() { fileInput.click(); });
+ fileInput.addEventListener('change', function() {
+ if (fileInput.files && fileInput.files[0]) {
+ var url = URL.createObjectURL(fileInput.files[0]);
+ runPipeline(url);
+ }
+ });
+ drop.addEventListener('dragover', function(e) { e.preventDefault(); drop.classList.add('drag-over'); });
+ drop.addEventListener('dragleave', function() { drop.classList.remove('drag-over'); });
+ drop.addEventListener('drop', function(e) {
+ e.preventDefault(); drop.classList.remove('drag-over');
+ if (e.dataTransfer.files && e.dataTransfer.files[0]) {
+ var url = URL.createObjectURL(e.dataTransfer.files[0]);
+ runPipeline(url);
+ }
+ });
+ webcamBtn.addEventListener('click', function() {
+ navigator.mediaDevices.getUserMedia({ video: { facingMode: 'user', width: 256, height: 256 } })
+ .then(function(stream) {
+ var video = document.createElement('video');
+ video.srcObject = stream;
+ video.play();
+ setTimeout(function() {
+ var canvas = document.createElement('canvas');
+ canvas.width = 256; canvas.height = 256;
+ canvas.getContext('2d').drawImage(video, 0, 0, 256, 256);
+ stream.getTracks().forEach(function(t) { t.stop(); });
+ runPipeline(canvas.toDataURL('image/jpeg'));
+ }, 500);
+ }).catch(function() {
+ runPipeline('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><rect width="64" height="64" fill="%23222"/><text x="32" y="36" text-anchor="middle" fill="%23666" font-size="12">cam</text></svg>');
+ });
+ });
+ })();
+
+ // ── 2. Voice + Mocap: microphone waveform ───────────────────────
+ (function() {
+ var btn = document.getElementById('mocap-mic-btn');
+ var canvas = document.getElementById('mocap-waveform');
+ var status = document.getElementById('mocap-status');
+ if (!btn || !canvas) return;
+ var ctx = canvas.getContext('2d');
+ var audioCtx = null, analyser = null, stream = null, animId = null;
+ var active = false;
+
+ function draw() {
+ if (!active) return;
+ animId = requestAnimationFrame(draw);
+ var w = canvas.width, h = canvas.height;
+ var data = new Uint8Array(analyser.frequencyBinCount);
+ analyser.getByteTimeDomainData(data);
+ ctx.clearRect(0, 0, w, h);
+ ctx.strokeStyle = 'rgba(168,168,168,0.6)';
+ ctx.lineWidth = 1.5;
+ ctx.beginPath();
+ var sliceW = w / data.length;
+ for (var i = 0; i < data.length; i++) {
+ var v = data[i] / 128.0;
+ var y = v * h / 2;
+ if (i === 0) ctx.moveTo(0, y);
+ else ctx.lineTo(i * sliceW, y);
+ }
+ ctx.stroke();
+ }
+
+ function resizeCanvas() {
+ canvas.width = canvas.clientWidth * (window.devicePixelRatio || 1);
+ canvas.height = canvas.clientHeight * (window.devicePixelRatio || 1);
+ }
+
+ btn.addEventListener('click', function() {
+ if (active) {
+ active = false;
+ cancelAnimationFrame(animId);
+ if (stream) stream.getTracks().forEach(function(t) { t.stop(); });
+ if (audioCtx) audioCtx.close();
+ stream = null; audioCtx = null; analyser = null;
+ btn.textContent = 'Microphone';
+ status.textContent = 'click to capture';
+ status.classList.remove('live');
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ return;
+ }
+ navigator.mediaDevices.getUserMedia({ audio: true }).then(function(s) {
+ stream = s;
+ audioCtx = new (window.AudioContext || window.webkitAudioContext)();
+ analyser = audioCtx.createAnalyser();
+ analyser.fftSize = 256;
+ audioCtx.createMediaStreamSource(stream).connect(analyser);
+ active = true;
+ resizeCanvas();
+ btn.textContent = 'Stop';
+ status.textContent = 'live — speak now';
+ status.classList.add('live');
+ draw();
+ }).catch(function() {
+ status.textContent = 'mic access denied';
+ });
+ });
+
+ new ResizeObserver(function() { if (active) resizeCanvas(); }).observe(canvas);
+ })();
+
+ // ── 3. Walk & Multiplayer: mini map ─────────────────────────────
+ (function() {
+ var canvas = document.getElementById('walk-minimap');
+ if (!canvas) return;
+ var ctx = canvas.getContext('2d');
+ var dpr = window.devicePixelRatio || 1;
+ var W, H;
+
+ function resize() {
+ W = canvas.clientWidth; H = canvas.clientHeight;
+ canvas.width = W * dpr; canvas.height = H * dpr;
+ ctx.scale(dpr, dpr);
+ }
+ resize();
+ new ResizeObserver(resize).observe(canvas);
+
+ var player = { x: 0.5, y: 0.5, color: '#fff' };
+ var bots = [
+ { x: 0.2, y: 0.3, vx: 0.0008, vy: 0.0006, color: '#4ade80' },
+ { x: 0.8, y: 0.6, vx: -0.0006, vy: 0.0009, color: '#60a5fa' },
+ { x: 0.5, y: 0.8, vx: 0.0007, vy: -0.0005, color: '#fbbf24' },
+ ];
+
+ var keys = {};
+ canvas.addEventListener('keydown', function(e) { keys[e.key.toLowerCase()] = true; e.preventDefault(); });
+ canvas.addEventListener('keyup', function(e) { keys[e.key.toLowerCase()] = false; });
+ canvas.addEventListener('click', function(e) {
+ var r = canvas.getBoundingClientRect();
+ player.x = (e.clientX - r.left) / r.width;
+ player.y = (e.clientY - r.top) / r.height;
+ canvas.focus();
+ });
+
+ function tick() {
+ requestAnimationFrame(tick);
+ var speed = 0.006;
+ if (keys['w'] || keys['arrowup']) player.y -= speed;
+ if (keys['s'] || keys['arrowdown']) player.y += speed;
+ if (keys['a'] || keys['arrowleft']) player.x -= speed;
+ if (keys['d'] || keys['arrowright']) player.x += speed;
+ player.x = Math.max(0.02, Math.min(0.98, player.x));
+ player.y = Math.max(0.02, Math.min(0.98, player.y));
+
+ bots.forEach(function(b) {
+ b.x += b.vx; b.y += b.vy;
+ if (b.x < 0.05 || b.x > 0.95) b.vx *= -1;
+ if (b.y < 0.05 || b.y > 0.95) b.vy *= -1;
+ b.vx += (Math.random() - 0.5) * 0.0002;
+ b.vy += (Math.random() - 0.5) * 0.0002;
+ });
+
+ ctx.clearRect(0, 0, W, H);
+ ctx.fillStyle = '#0a0d12';
+ ctx.fillRect(0, 0, W, H);
+ // Grid
+ ctx.strokeStyle = 'rgba(255,255,255,0.04)';
+ ctx.lineWidth = 0.5;
+ for (var gx = 0; gx < W; gx += 30) { ctx.beginPath(); ctx.moveTo(gx, 0); ctx.lineTo(gx, H); ctx.stroke(); }
+ for (var gy = 0; gy < H; gy += 30) { ctx.beginPath(); ctx.moveTo(0, gy); ctx.lineTo(W, gy); ctx.stroke(); }
+
+ // Bots
+ bots.forEach(function(b) {
+ ctx.beginPath();
+ ctx.arc(b.x * W, b.y * H, 4, 0, Math.PI * 2);
+ ctx.fillStyle = b.color;
+ ctx.fill();
+ ctx.fillStyle = 'rgba(255,255,255,0.2)';
+ ctx.font = '7px monospace';
+ ctx.fillText('visitor', b.x * W + 7, b.y * H + 3);
+ });
+
+ // Player
+ ctx.beginPath();
+ ctx.arc(player.x * W, player.y * H, 5, 0, Math.PI * 2);
+ ctx.fillStyle = player.color;
+ ctx.fill();
+ ctx.shadowColor = '#fff'; ctx.shadowBlur = 8;
+ ctx.fill();
+ ctx.shadowBlur = 0;
+ ctx.fillStyle = 'rgba(255,255,255,0.5)';
+ ctx.font = '8px monospace';
+ ctx.fillText('you', player.x * W + 8, player.y * H + 3);
+ }
+ tick();
+ })();
+
+ // ── 4. x402 Payments: interactive flow ──────────────────────────
+ (function() {
+ var payBtn = document.getElementById('x402-pay-btn');
+ var code = document.getElementById('x402-code');
+ var spinner = document.getElementById('x402-spinner');
+ var amount = document.getElementById('x402-amount');
+ if (!payBtn) return;
+
+ payBtn.addEventListener('click', function() {
+ payBtn.style.display = 'none';
+ spinner.style.display = 'block';
+ code.textContent = 'Processing USDC payment...';
+ code.className = 'x402-code';
+
+ setTimeout(function() {
+ spinner.style.display = 'none';
+ code.textContent = 'HTTP 200 — OK';
+ code.className = 'x402-code ok';
+ amount.classList.add('show');
+
+ setTimeout(function() {
+ code.textContent = 'HTTP 402 — Payment Required';
+ code.className = 'x402-code err';
+ amount.classList.remove('show');
+ payBtn.style.display = '';
+ }, 3000);
+ }, 1200);
+ });
+ })();
+
+ // ── 5. On-chain Identity: mint animation ────────────────────────
+ (function() {
+ var mintBtn = document.getElementById('mint-btn');
+ var card = document.getElementById('mint-card');
+ var progress = document.getElementById('mint-progress');
+ var label = document.getElementById('mint-label');
+ if (!mintBtn) return;
+
+ mintBtn.addEventListener('click', function() {
+ mintBtn.style.display = 'none';
+ progress.classList.add('active');
+
+ setTimeout(function() {
+ progress.classList.add('done');
+ }, 100);
+
+ setTimeout(function() {
+ card.classList.add('minted');
+ label.textContent = 'MINTED';
+
+ setTimeout(function() {
+ card.classList.remove('minted');
+ label.textContent = 'ERC-8004';
+ progress.classList.remove('active', 'done');
+ progress.querySelector('circle').style.strokeDashoffset = '78.5';
+ void progress.querySelector('circle').offsetWidth;
+ mintBtn.style.display = '';
+ }, 3000);
+ }, 1400);
+ });
+ })();
+
+ // ── 6. Skills: tool call demo ───────────────────────────────────
+ (function() {
+ var tools = document.getElementById('skill-tools');
+ var result = document.getElementById('skill-result');
+ if (!tools || !result) return;
+
+ var responses = {
+ jupiter: { tool: 'jupiter_swap', input: { from: 'USDC', to: 'SOL', amount: '10.00' }, output: { received: '0.0847 SOL', rate: '118.07', slippage: '0.12%' } },
+ pump: { tool: 'pump_launch', input: { name: 'NICH', ticker: '$NICH' }, output: { status: 'launched', ca: '7xKX...m3Qp', mcap: '$4,200', holders: 12 } },
+ rpc: { tool: 'solana_rpc', method: 'getBalance', params: ['7xKXp...m3Qp'], result: { value: 2410000000, lamports: true, sol: '2.41' } },
+ a2a: { protocol: 'a2a', target: 'claude.agent', action: 'ask', input: 'What is ERC-8004?', response: 'ERC-8004 is the on-chain standard for AI agent identity...' }
+ };
+
+ function colorJson(obj, indent) {
+ indent = indent || 0;
+ var pad = ' '.repeat(indent);
+ if (typeof obj === 'string') return '<span class="json-str">"' + obj + '"</span>';
+ if (typeof obj === 'number') return '<span class="json-num">' + obj + '</span>';
+ if (typeof obj === 'boolean') return '<span class="json-num">' + obj + '</span>';
+ if (Array.isArray(obj)) {
+ if (obj.length === 0) return '[]';
+ var items = obj.map(function(v) { return pad + ' ' + colorJson(v, indent + 1); });
+ return '[\n' + items.join(',\n') + '\n' + pad + ']';
+ }
+ var keys = Object.keys(obj);
+ if (keys.length === 0) return '{}';
+ var lines = keys.map(function(k) {
+ return pad + ' <span class="json-key">"' + k + '"</span>: ' + colorJson(obj[k], indent + 1);
+ });
+ return '{\n' + lines.join(',\n') + '\n' + pad + '}';
+ }
+
+ function showTool(name) {
+ var data = responses[name];
+ if (!data) return;
+ result.innerHTML = colorJson(data, 0);
+ result.classList.add('fresh');
+ setTimeout(function() { result.classList.remove('fresh'); }, 600);
+ }
+
+ tools.addEventListener('click', function(e) {
+ var btn = e.target.closest('.bento-pill-btn');
+ if (!btn) return;
+ tools.querySelectorAll('.bento-pill-btn').forEach(function(b) { b.classList.remove('active'); });
+ btn.classList.add('active');
+ showTool(btn.dataset.tool);
+ });
+
+ showTool('jupiter');
+ })();
+
+ // ── 7. Memory: store/recall demo ────────────────────────────────
+ (function() {
+ var input = document.getElementById('memory-input');
+ var storeBtn = document.getElementById('memory-store-btn');
+ var recallBtn = document.getElementById('memory-recall-btn');
+ var log = document.getElementById('memory-log');
+ if (!input || !storeBtn) return;
+
+ var memories = [];
+
+ function addEntry(op, val) {
+ var el = document.createElement('div');
+ el.className = 'memory-entry';
+ el.innerHTML = '<span class="mem-op">' + op + '</span><span class="mem-val">' + val + '</span>';
+ log.appendChild(el);
+ log.scrollTop = log.scrollHeight;
+ }
+
+ storeBtn.addEventListener('click', function() {
+ var val = input.value.trim();
+ if (!val) return;
+ memories.push(val);
+ addEntry('STORE →', val);
+ input.value = '';
+ });
+
+ recallBtn.addEventListener('click', function() {
+ if (memories.length === 0) {
+ addEntry('RECALL →', '(empty — store something first)');
+ return;
+ }
+ memories.forEach(function(m, i) {
+ setTimeout(function() {
+ addEntry('MEM[' + i + ']', m);
+ }, i * 150);
+ });
+ });
+
+ input.addEventListener('keydown', function(e) {
+ if (e.key === 'Enter') storeBtn.click();
+ });
+ })();
+
+ // ── 8. AR / WebXR: launcher demo ────────────────────────────────
+ (function() {
+ var btn = document.getElementById('ar-launch-btn');
+ var phone = document.getElementById('ar-phone');
+ var status = document.getElementById('ar-status');
+ if (!btn) return;
+ var active = false;
+
+ btn.addEventListener('click', function() {
+ if (active) {
+ active = false;
+ phone.classList.remove('active');
+ status.textContent = 'tap to place agent';
+ status.classList.remove('ready');
+ btn.textContent = 'Launch AR';
+ return;
+ }
+ active = true;
+ phone.classList.add('active');
+ status.textContent = 'scanning surface...';
+ btn.textContent = 'Stop';
+
+ setTimeout(function() {
+ if (!active) return;
+ status.textContent = 'agent placed in AR';
+ status.classList.add('ready');
+ }, 1500);
+ });
+ })();
+
+ // ── 9. Marketplace: live agent browser ──────────────────────────
+ (function() {
+ var strip = document.getElementById('mktplace-strip');
+ if (!strip) return;
+ var THUMB_CDN = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb';
+
+ fetch('/api/marketplace')
+ .then(function(r) { return r.json(); })
+ .then(function(data) {
+ var items = (data.agents || data.items || data || []).slice(0, 10);
+ items.forEach(function(item) {
+ var id = item.avatar_id || item.avatarId || item.id;
+ var name = item.name || item.agent_name || id.slice(0, 6);
+ var thumb = item.thumbnail || (THUMB_CDN + '/' + id + '.png');
+ var a = document.createElement('a');
+ a.className = 'mktplace-item';
+ a.href = '/agent-next?id=' + id;
+ a.title = name;
+ var img = document.createElement('img');
+ img.src = thumb;
+ img.alt = name;
+ img.loading = 'lazy';
+ img.onerror = function() { this.style.display = 'none'; };
+ a.appendChild(img);
+ var lbl = document.createElement('span');
+ lbl.className = 'mktplace-item-name';
+ lbl.textContent = name;
+ a.appendChild(lbl);
+ strip.appendChild(a);
+ });
+ var more = document.createElement('a');
+ more.className = 'mktplace-more';
+ more.href = '/discover';
+ more.textContent = '→';
+ more.title = 'Browse all agents';
+ strip.appendChild(more);
+ }).catch(function() {
+ strip.innerHTML = '<a class="mktplace-more" href="/discover" style="width:auto;padding:0 16px;">Browse marketplace →</a>';
+ });
+ })();
+
+ // ── 10. Analytics: sparkline + animated counters ─────────────────
+ (function() {
+ var demo = document.getElementById('analytics-demo');
+ if (!demo) return;
+ var convosEl = document.getElementById('an-convos');
+ var revenueEl = document.getElementById('an-revenue');
+ var retentionEl = document.getElementById('an-retention');
+ var sparkSvg = document.getElementById('analytics-spark');
+
+ var dataPoints = [5, 12, 8, 22, 18, 30, 25, 40, 35, 48, 42, 55, 50, 62, 58, 70, 65, 78, 72, 85];
+ var maxVal = Math.max.apply(null, dataPoints);
+ var svgW = 200, svgH = 40, pad = 2;
+
+ function buildPath() {
+ var pts = dataPoints.map(function(v, i) {
+ return {
+ x: pad + (i / (dataPoints.length - 1)) * (svgW - pad * 2),
+ y: svgH - pad - (v / maxVal) * (svgH - pad * 2)
+ };
+ });
+ var d = pts.map(function(p, i) { return (i === 0 ? 'M' : 'L') + p.x.toFixed(1) + ' ' + p.y.toFixed(1); }).join(' ');
+ var fillD = d + ' L' + pts[pts.length - 1].x.toFixed(1) + ' ' + svgH + ' L' + pts[0].x.toFixed(1) + ' ' + svgH + ' Z';
+ var last = pts[pts.length - 1];
+
+ sparkSvg.innerHTML = sparkSvg.querySelector('defs').outerHTML
+ + '<path class="spark-fill" d="' + fillD + '"/>'
+ + '<path d="' + d + '"/>'
+ + '<circle class="spark-dot" cx="' + last.x.toFixed(1) + '" cy="' + last.y.toFixed(1) + '" r="2.5"/>';
+ }
+
+ var animated = false;
+ function animateCounters() {
+ if (animated) return;
+ animated = true;
+ var targets = { convos: 1247, revenue: 847.5, retention: 68 };
+ var start = performance.now();
+ var dur = 1200;
+ (function tick(now) {
+ var p = Math.min((now - start) / dur, 1);
+ var e = 1 - Math.pow(1 - p, 3);
+ convosEl.textContent = Math.round(targets.convos * e).toLocaleString();
+ revenueEl.textContent = '$' + (targets.revenue * e).toFixed(0);
+ retentionEl.textContent = Math.round(targets.retention * e) + '%';
+ if (p < 1) requestAnimationFrame(tick);
+ })(start);
+
+ // Live tick
+ setInterval(function() {
+ var newPt = dataPoints[dataPoints.length - 1] + Math.round((Math.random() - 0.3) * 8);
+ dataPoints.push(Math.max(5, newPt));
+ if (dataPoints.length > 30) dataPoints.shift();
+ maxVal = Math.max.apply(null, dataPoints);
+ buildPath();
+ }, 2000);
+ }
+
+ buildPath();
+
+ var io = new IntersectionObserver(function(entries) {
+ if (entries[0].isIntersecting) { animateCounters(); io.disconnect(); }
+ }, { threshold: 0.3 });
+ io.observe(demo);
+ })();
+
+})();
</script>
</body>
</html>
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 000000000..935c6363e
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,156 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>three.ws — 404</title>
+ <meta name="robots" content="noindex" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ :root { color-scheme: dark; }
+ *, *::before, *::after { box-sizing: border-box; }
+ html, body { height: 100%; margin: 0; background: #08090f; color: #ccc; font: 15px/1.5 'Inter', -apple-system, system-ui, sans-serif; overflow: hidden; }
+
+ #avatar-canvas {
+ position: fixed; inset: 0;
+ width: 100vw; height: 100vh;
+ pointer-events: none; z-index: 999;
+ }
+
+ .nav {
+ position: fixed; top: 0; left: 0; right: 0; z-index: 20;
+ display: flex; align-items: center; gap: 16px; padding: 14px 28px;
+ background: rgba(8,9,15,0.6); backdrop-filter: blur(14px);
+ border-bottom: 1px solid rgba(255,255,255,0.04);
+ }
+ .nav .brand { font: 700 15px/1 'Space Grotesk','Inter',sans-serif; color:#fff; text-decoration:none; display:flex; align-items:center; gap:7px; }
+ .brand-dot { width:8px; height:8px; border-radius:50%; background:#fff; box-shadow:0 0 8px rgba(255,255,255,0.35); }
+
+ .stage {
+ min-height: 100vh;
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
+ gap: 28px; padding: 100px 24px 60px;
+ text-align: center;
+ }
+ .eyebrow {
+ display: inline-flex; align-items: center; gap: 9px;
+ font-size: 11px; font-weight: 600;
+ letter-spacing: 0.17em; text-transform: uppercase;
+ color: #999;
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ }
+ .eyebrow-dot {
+ width: 7px; height: 7px; border-radius: 50%;
+ background: #888; box-shadow: 0 0 6px rgba(255,255,255,0.2);
+ animation: blink 2.2s ease-in-out infinite;
+ }
+ @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.15} }
+
+ .bignum {
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ font-weight: 800; letter-spacing: -0.06em;
+ font-size: clamp(140px, 28vw, 320px);
+ line-height: 0.85;
+ margin: 0;
+ color: #fff;
+ text-shadow: var(--agent-shadow, none);
+ transition: text-shadow 90ms linear;
+ user-select: none;
+ }
+ .bignum em { color: #666; font-style: normal; }
+
+ .line {
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ font-size: clamp(20px, 2.4vw, 28px); font-weight: 700;
+ margin: 0; color: #ddd; letter-spacing: -0.015em;
+ }
+ .sub { color: #555; max-width: 44ch; margin: 0; font-size: 15px; }
+
+ .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
+ .btn {
+ display: inline-flex; align-items: center; gap: 10px;
+ padding: 14px 26px; border: none; border-radius: 12px;
+ font: 700 14.5px/1 'Inter', inherit; cursor: pointer; text-decoration: none;
+ user-select: none;
+ transform-origin: bottom center;
+ will-change: transform;
+ }
+ .btn-primary {
+ background: #fff;
+ color: #0a0b0f;
+ box-shadow: 0 7px 0 0 #555, 0 9px 24px rgba(0,0,0,0.4);
+ }
+ .btn-primary:hover { background: #e8e8e8; }
+ .btn-ghost {
+ background: rgba(255,255,255,0.04); color: #888;
+ border: 1.5px solid rgba(255,255,255,0.1);
+ box-shadow: 0 4px 0 0 rgba(255,255,255,0.03);
+ }
+ .btn-ghost:hover { color: #ccc; border-color: rgba(255,255,255,0.25); }
+ </style>
+ </head>
+ <body>
+ <div class="nav">
+ <a href="/" class="brand">
+ <img src="/three.svg" width="20" height="20" alt="" />
+ <span class="brand-dot"></span>
+ three.ws
+ </a>
+ </div>
+
+ <div class="stage">
+ <div class="eyebrow"><span class="eyebrow-dot"></span><span>Lost in 3D</span></div>
+ <h1 class="bignum" id="bignum"><span id="four-a">4</span><em id="zero">0</em><span id="four-b">4</span></h1>
+ <p class="line" id="lost-line">Your agent took a wrong turn.</p>
+ <p class="sub">This page does not exist on three.ws — but she landed here, looked around, and seems pretty confused. Send her home.</p>
+ <div class="actions">
+ <a href="/" class="btn btn-primary" id="home-btn">
+ <span>Take her home</span>
+ <span>&rarr;</span>
+ </a>
+ <a href="/demos/" class="btn btn-ghost" id="lab-btn">
+ <span>Back to lab</span>
+ </a>
+ </div>
+ </div>
+
+ <canvas id="avatar-canvas"></canvas>
+
+ <script type="module">
+ import { createAgentUI } from '@three-ws/agent-ui';
+
+ const zero = document.getElementById('zero');
+ const homeBtn = document.getElementById('home-btn');
+ const labBtn = document.getElementById('lab-btn');
+
+ const agent = await createAgentUI({
+ canvas: document.getElementById('avatar-canvas'),
+ clips: ['idle', 'walk', 'falling'],
+ });
+
+ agent.fx.proximityShadow(document.getElementById('bignum'));
+
+ await agent.fallOnto(zero, {
+ duration: 1.4,
+ landingOffsetPx: 90,
+ tumble: 0.25,
+ onLand: () => {
+ agent.fx.dust(zero);
+ agent.fx.impactPulse(zero);
+ },
+ });
+
+ agent.play('idle', { loop: true });
+ const t0 = performance.now();
+ (function lookAround() {
+ if (agent._runningOff) return;
+ const t = (performance.now() - t0) / 1000;
+ agent.avatar.rotation.y = Math.sin(t * 1.25) * 0.35;
+ requestAnimationFrame(lookAround);
+ })();
+
+ agent.interceptNavigation(homeBtn, { direction: 'right', delay: 1100 });
+ agent.interceptNavigation(labBtn, { direction: 'left', delay: 1100 });
+ </script>
+ </body>
+</html>
diff --git a/public/avatar-sdk.css b/public/avatar-sdk.css
new file mode 100644
index 000000000..91348b5dc
--- /dev/null
+++ b/public/avatar-sdk.css
@@ -0,0 +1,1039 @@
+/******************************************************************************
+ * Avatar SDK Page — Product page for @three-ws/avatar
+ *
+ * Prefixed sdk- to avoid collision. Uses phi tokens from style.css.
+ * Scroll-reveal via IntersectionObserver + CSS transitions.
+ */
+
+:root {
+ --sdk-bg: #000000;
+ --sdk-surface: #080808;
+ --sdk-card: #0c0c0c;
+ --sdk-border: rgba(255, 255, 255, 0.07);
+ --sdk-border-hi: rgba(255, 255, 255, 0.14);
+ --sdk-text: #e8e8e8;
+ --sdk-muted: #888888;
+ --sdk-dim: #555555;
+ --sdk-accent: #a78bfa;
+ --sdk-accent2: #818cf8;
+ --sdk-cyan: #67e8f9;
+ --sdk-green: #4ade80;
+ --sdk-code-bg: #09090b;
+ --sdk-pill-bg: rgba(167, 139, 250, 0.08);
+ --sdk-pill-border: rgba(167, 139, 250, 0.2);
+ --sdk-success: #4ade80;
+ --sdk-error: #f87171;
+ --sdk-radius: 14px;
+ --sdk-radius-sm: 8px;
+ --sdk-max: 1120px;
+}
+
+html, body {
+ margin: 0;
+ background: var(--sdk-bg);
+ color: var(--sdk-text);
+ -webkit-font-smoothing: antialiased;
+}
+body {
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
+ font-family: 'Inter', system-ui, sans-serif;
+}
+
+/* ── Scroll reveal ─────────────────────────────────────────────────── */
+.sdk-reveal {
+ opacity: 0;
+ transform: translateY(28px);
+ transition:
+ opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
+ transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
+}
+.sdk-reveal.revealed {
+ opacity: 1;
+ transform: none;
+}
+.sdk-reveal-delay-1 { transition-delay: 0.08s; }
+.sdk-reveal-delay-2 { transition-delay: 0.16s; }
+.sdk-reveal-delay-3 { transition-delay: 0.24s; }
+.sdk-reveal-delay-4 { transition-delay: 0.32s; }
+
+/* ── Layout ────────────────────────────────────────────────────────── */
+.sdk-wrap {
+ max-width: var(--sdk-max);
+ margin: 0 auto;
+ padding: 0 24px;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+/* ── Hero ──────────────────────────────────────────────────────────── */
+.sdk-hero {
+ position: relative;
+ overflow: hidden;
+ padding: 100px 0 0;
+ min-height: 720px;
+ display: flex;
+ align-items: flex-start;
+}
+.sdk-hero-bg {
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+}
+.sdk-hero-bg-orb {
+ position: absolute;
+ border-radius: 50%;
+ filter: blur(100px);
+ opacity: 0.35;
+}
+.sdk-hero-bg-orb.a {
+ width: 600px; height: 600px;
+ top: -140px; left: -100px;
+ background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, transparent 70%);
+}
+.sdk-hero-bg-orb.b {
+ width: 460px; height: 460px;
+ top: 40px; right: -80px;
+ background: radial-gradient(circle, rgba(129, 140, 248, 0.12) 0%, transparent 70%);
+}
+.sdk-hero-bg-orb.c {
+ width: 340px; height: 340px;
+ bottom: -20px; left: 35%;
+ background: radial-gradient(circle, rgba(103, 232, 249, 0.1) 0%, transparent 70%);
+}
+.sdk-hero-grid {
+ position: absolute;
+ inset: 0;
+ background-image:
+ linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
+ linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
+ background-size: 48px 48px;
+ mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 60%, transparent 100%);
+ -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 60%, transparent 100%);
+}
+
+.sdk-hero-inner {
+ position: relative;
+ z-index: 1;
+ display: grid;
+ grid-template-columns: 1fr 460px;
+ gap: 56px;
+ align-items: center;
+ padding-bottom: 80px;
+ width: 100%;
+}
+.sdk-hero-copy {
+ padding-top: 16px;
+}
+.sdk-hero-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ background: var(--sdk-pill-bg);
+ border: 1px solid var(--sdk-pill-border);
+ border-radius: 100px;
+ padding: 5px 14px 5px 10px;
+ font-size: 12px;
+ font-weight: 600;
+ letter-spacing: 0.04em;
+ color: var(--sdk-accent);
+ text-transform: uppercase;
+ margin-bottom: 20px;
+}
+.sdk-hero-badge-dot {
+ width: 6px; height: 6px;
+ border-radius: 50%;
+ background: var(--sdk-accent);
+ box-shadow: 0 0 8px var(--sdk-accent);
+ animation: sdk-dot-pulse 2.4s ease-in-out infinite;
+}
+@keyframes sdk-dot-pulse {
+ 0%,100% { box-shadow: 0 0 6px rgba(167, 139, 250, 0.6); }
+ 50% { box-shadow: 0 0 16px rgba(167, 139, 250, 1); }
+}
+.sdk-hero-h1 {
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ font-size: clamp(36px, 5vw, 56px);
+ font-weight: 700;
+ letter-spacing: -0.03em;
+ line-height: 1.08;
+ margin: 0 0 18px;
+ color: #ffffff;
+}
+.sdk-hero-h1 em {
+ font-style: normal;
+ background: linear-gradient(135deg, var(--sdk-accent) 0%, var(--sdk-cyan) 100%);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ background-clip: text;
+}
+.sdk-hero-sub {
+ font-size: 17px;
+ line-height: 1.65;
+ color: var(--sdk-muted);
+ max-width: 50ch;
+ margin: 0 0 32px;
+}
+.sdk-hero-sub strong { color: var(--sdk-text); font-weight: 500; }
+
+/* Install command */
+.sdk-install-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+ margin-bottom: 28px;
+}
+.sdk-install-cmd {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ background: var(--sdk-code-bg);
+ border: 1px solid var(--sdk-border-hi);
+ border-radius: var(--sdk-radius-sm);
+ padding: 12px 16px;
+ font-family: 'JetBrains Mono', ui-monospace, monospace;
+ font-size: 13.5px;
+ color: #e8e8e8;
+ cursor: pointer;
+ transition: border-color 0.2s, box-shadow 0.2s;
+ flex: 1;
+ min-width: 0;
+}
+.sdk-install-cmd:hover {
+ border-color: rgba(167, 139, 250, 0.3);
+ box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.08);
+}
+.sdk-install-cmd .prompt { color: var(--sdk-accent); user-select: none; flex-shrink: 0; }
+.sdk-install-cmd .cmd-text { color: #e2e8f0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+.sdk-install-copy {
+ background: none;
+ border: none;
+ color: var(--sdk-dim);
+ cursor: pointer;
+ padding: 2px 4px;
+ font-family: inherit;
+ font-size: 11px;
+ transition: color 0.15s;
+ flex-shrink: 0;
+}
+.sdk-install-copy:hover { color: var(--sdk-text); }
+.sdk-install-copy.copied { color: var(--sdk-success); }
+
+/* Hero CTAs */
+.sdk-hero-ctas {
+ display: flex;
+ gap: 12px;
+ flex-wrap: wrap;
+}
+.sdk-btn-primary {
+ display: inline-flex;
+ align-items: center;
+ gap: 7px;
+ background: linear-gradient(135deg, var(--sdk-accent) 0%, var(--sdk-accent2) 100%);
+ color: #ffffff;
+ border: none;
+ border-radius: var(--sdk-radius-sm);
+ padding: 12px 24px;
+ font: 600 14px/1 'Inter', sans-serif;
+ cursor: pointer;
+ text-decoration: none;
+ transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
+ box-shadow: 0 4px 24px rgba(167, 139, 250, 0.25);
+}
+.sdk-btn-primary:hover {
+ opacity: 0.92;
+ transform: translateY(-1px);
+ box-shadow: 0 6px 32px rgba(167, 139, 250, 0.35);
+}
+.sdk-btn-ghost {
+ display: inline-flex;
+ align-items: center;
+ gap: 7px;
+ background: transparent;
+ color: var(--sdk-muted);
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: var(--sdk-radius-sm);
+ padding: 12px 24px;
+ font: 600 14px/1 'Inter', sans-serif;
+ cursor: pointer;
+ text-decoration: none;
+ transition: color 0.15s, border-color 0.15s;
+}
+.sdk-btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); }
+
+/* Hero 3D viewer */
+.sdk-hero-viewer {
+ position: relative;
+}
+.sdk-hero-viewer-frame {
+ position: relative;
+ border-radius: 20px;
+ overflow: hidden;
+ background: var(--sdk-card);
+ border: 1.5px solid var(--sdk-border-hi);
+ box-shadow:
+ 0 0 0 1px rgba(167, 139, 250, 0.04) inset,
+ 0 24px 80px -24px rgba(0, 0, 0, 0.8),
+ 0 0 80px -20px rgba(167, 139, 250, 0.08);
+ aspect-ratio: 9 / 10;
+ max-height: 500px;
+}
+.sdk-hero-viewer-frame three-ws-viewer {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+.sdk-viewer-badge {
+ position: absolute;
+ bottom: 14px;
+ left: 50%;
+ transform: translateX(-50%);
+ background: rgba(3, 3, 7, 0.82);
+ backdrop-filter: blur(10px);
+ border: 1px solid var(--sdk-border);
+ border-radius: 100px;
+ padding: 5px 14px;
+ font-size: 11px;
+ color: var(--sdk-muted);
+ white-space: nowrap;
+ pointer-events: none;
+}
+.sdk-viewer-badge code {
+ color: var(--sdk-accent);
+ font-family: ui-monospace, monospace;
+ font-size: 11px;
+}
+.sdk-hero-viewer-glow {
+ position: absolute;
+ inset: -60px;
+ background: radial-gradient(ellipse at 50% 60%, rgba(167, 139, 250, 0.06) 0%, transparent 65%);
+ pointer-events: none;
+ z-index: -1;
+}
+
+/* Stats bar */
+.sdk-stats {
+ display: flex;
+ gap: 32px;
+ padding: 32px 0;
+ border-top: 1px solid var(--sdk-border);
+ margin-top: 24px;
+}
+.sdk-stat {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+.sdk-stat-value {
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 24px;
+ font-weight: 700;
+ color: #ffffff;
+ letter-spacing: -0.02em;
+}
+.sdk-stat-value .sdk-stat-unit {
+ font-size: 14px;
+ font-weight: 500;
+ color: var(--sdk-accent);
+}
+.sdk-stat-label {
+ font-size: 12px;
+ color: var(--sdk-dim);
+ letter-spacing: 0.02em;
+}
+
+/* Scroll hint */
+.sdk-hero-scroll {
+ position: absolute;
+ bottom: 24px;
+ left: 50%;
+ transform: translateX(-50%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+ color: var(--sdk-dim);
+ font-size: 11px;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ z-index: 2;
+}
+.sdk-hero-scroll-line {
+ width: 1px;
+ height: 40px;
+ background: linear-gradient(to bottom, rgba(167, 139, 250, 0.5), transparent);
+ animation: sdk-scroll-line 2s ease-in-out infinite;
+}
+@keyframes sdk-scroll-line {
+ 0%,100% { opacity: 0.4; transform: scaleY(0.8); }
+ 50% { opacity: 1; transform: scaleY(1); }
+}
+
+/* ── Section headings ──────────────────────────────────────────────── */
+.sdk-section {
+ padding: 96px 0;
+ border-top: 1px solid rgba(255, 255, 255, 0.04);
+}
+.sdk-section:first-of-type { border-top: none; }
+.sdk-section-label {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--sdk-accent);
+ margin-bottom: 12px;
+}
+.sdk-section-label::before {
+ content: '';
+ display: block;
+ width: 20px;
+ height: 1.5px;
+ background: var(--sdk-accent);
+}
+.sdk-h2 {
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ font-size: clamp(26px, 3.5vw, 38px);
+ font-weight: 700;
+ letter-spacing: -0.02em;
+ margin: 0 0 12px;
+ color: #ffffff;
+}
+.sdk-lead {
+ font-size: 16px;
+ line-height: 1.65;
+ color: var(--sdk-muted);
+ max-width: 56ch;
+ margin: 0 0 48px;
+}
+
+/* ── Feature grid ──────────────────────────────────────────────────── */
+.sdk-feature-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
+ gap: 16px;
+}
+.sdk-feat-card {
+ background: var(--sdk-card);
+ border: 1.5px solid var(--sdk-border);
+ border-radius: var(--sdk-radius);
+ padding: 28px;
+ transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
+ position: relative;
+ overflow: hidden;
+}
+.sdk-feat-card::before {
+ content: '';
+ position: absolute;
+ top: 0; left: 0; right: 0;
+ height: 2px;
+ background: linear-gradient(90deg, transparent, var(--card-accent, var(--sdk-accent)), transparent);
+ opacity: 0;
+ transition: opacity 0.3s;
+}
+.sdk-feat-card:hover {
+ border-color: var(--sdk-border-hi);
+ box-shadow: 0 8px 48px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--sdk-border-hi);
+ transform: translateY(-2px);
+}
+.sdk-feat-card:hover::before { opacity: 1; }
+.sdk-feat-icon {
+ width: 42px; height: 42px;
+ border-radius: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 16px;
+ font-size: 20px;
+ background: var(--icon-bg, rgba(167, 139, 250, 0.1));
+ border: 1px solid var(--icon-border, rgba(167, 139, 250, 0.2));
+}
+.sdk-feat-title {
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 16px;
+ font-weight: 600;
+ color: var(--sdk-text);
+ margin: 0 0 8px;
+}
+.sdk-feat-desc {
+ font-size: 13.5px;
+ line-height: 1.6;
+ color: var(--sdk-muted);
+ margin: 0;
+}
+.sdk-feat-desc code {
+ color: var(--sdk-accent);
+ font-family: ui-monospace, monospace;
+ font-size: 12px;
+ background: rgba(167, 139, 250, 0.08);
+ padding: 1px 5px;
+ border-radius: 3px;
+}
+.sdk-feat-tag {
+ display: inline-block;
+ margin-top: 12px;
+ background: rgba(167, 139, 250, 0.06);
+ border: 1px solid rgba(167, 139, 250, 0.12);
+ border-radius: 4px;
+ padding: 2px 7px;
+ font-family: ui-monospace, monospace;
+ font-size: 11px;
+ color: var(--sdk-accent);
+}
+
+/* ── Code blocks ───────────────────────────────────────────────────── */
+.sdk-code-section {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 40px;
+ align-items: start;
+}
+.sdk-code-section.full { grid-template-columns: 1fr; }
+.sdk-code-section.reversed { direction: rtl; }
+.sdk-code-section.reversed > * { direction: ltr; }
+
+.sdk-code-copy {
+ position: relative;
+}
+.sdk-code-label {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 8px;
+}
+.sdk-code-filename {
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--sdk-dim);
+ font-family: ui-monospace, monospace;
+ letter-spacing: 0.03em;
+}
+.sdk-copy-btn {
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 5px;
+ color: var(--sdk-dim);
+ cursor: pointer;
+ font: 11px/1 'Inter', sans-serif;
+ padding: 4px 10px;
+ transition: color 0.15s, border-color 0.15s, background 0.15s;
+}
+.sdk-copy-btn:hover {
+ color: var(--sdk-text);
+ border-color: rgba(255, 255, 255, 0.18);
+ background: rgba(255, 255, 255, 0.06);
+}
+.sdk-copy-btn.copied {
+ color: var(--sdk-success);
+ border-color: rgba(74, 222, 128, 0.3);
+}
+pre.sdk-pre {
+ margin: 0;
+ background: var(--sdk-code-bg);
+ border: 1px solid var(--sdk-border);
+ border-radius: var(--sdk-radius-sm);
+ padding: 18px 20px;
+ overflow-x: auto;
+ font-family: 'JetBrains Mono', ui-monospace, monospace;
+ font-size: 13px;
+ line-height: 1.75;
+ color: #cbd5e1;
+ tab-size: 2;
+}
+
+/* Syntax tokens */
+pre.sdk-pre .t-kw { color: #c4b5fd; }
+pre.sdk-pre .t-str { color: #86efac; }
+pre.sdk-pre .t-tag { color: #f0abfc; }
+pre.sdk-pre .t-attr { color: #67e8f9; }
+pre.sdk-pre .t-cmt { color: #475569; font-style: italic; }
+pre.sdk-pre .t-fn { color: #93c5fd; }
+pre.sdk-pre .t-num { color: #fbbf24; }
+pre.sdk-pre .t-op { color: #94a3b8; }
+
+/* ── Tabs ──────────────────────────────────────────────────────────── */
+.sdk-tab-list {
+ display: flex;
+ gap: 2px;
+ margin-bottom: 0;
+ background: var(--sdk-code-bg);
+ border: 1px solid var(--sdk-border);
+ border-bottom: none;
+ border-radius: var(--sdk-radius-sm) var(--sdk-radius-sm) 0 0;
+ padding: 6px 6px 0;
+ overflow-x: auto;
+}
+.sdk-tab-btn {
+ background: none;
+ border: none;
+ color: var(--sdk-dim);
+ cursor: pointer;
+ font: 12px/1.4 'Inter', sans-serif;
+ padding: 7px 14px 9px;
+ border-radius: 5px 5px 0 0;
+ transition: color 0.15s, background 0.15s;
+ white-space: nowrap;
+ position: relative;
+}
+.sdk-tab-btn:hover { color: var(--sdk-muted); }
+.sdk-tab-btn.active {
+ color: var(--sdk-text);
+ background: rgba(167, 139, 250, 0.08);
+}
+.sdk-tab-btn.active::after {
+ content: '';
+ position: absolute;
+ bottom: -1px; left: 0; right: 0;
+ height: 2px;
+ background: var(--sdk-accent);
+ border-radius: 2px 2px 0 0;
+}
+.sdk-tab-panel pre.sdk-pre {
+ border-radius: 0 var(--sdk-radius-sm) var(--sdk-radius-sm) var(--sdk-radius-sm);
+}
+.sdk-tab-panel[hidden] { display: none; }
+
+.sdk-tab-copy-row {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ padding: 6px 12px 0;
+ background: var(--sdk-code-bg);
+ border-left: 1px solid var(--sdk-border);
+ border-right: 1px solid var(--sdk-border);
+}
+
+/* ── Quick-start steps ─────────────────────────────────────────────── */
+.sdk-steps {
+ display: flex;
+ flex-direction: column;
+ gap: 48px;
+}
+.sdk-step {
+ display: grid;
+ grid-template-columns: 44px 1fr;
+ gap: 20px;
+}
+.sdk-step-num {
+ width: 44px; height: 44px;
+ border-radius: 50%;
+ background: rgba(167, 139, 250, 0.08);
+ border: 1.5px solid rgba(167, 139, 250, 0.2);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 16px;
+ font-weight: 700;
+ color: var(--sdk-accent);
+ flex-shrink: 0;
+ margin-top: 2px;
+}
+.sdk-step-body {}
+.sdk-step-title {
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 18px;
+ font-weight: 600;
+ color: var(--sdk-text);
+ margin: 0 0 6px;
+}
+.sdk-step-desc {
+ font-size: 14px;
+ line-height: 1.65;
+ color: var(--sdk-muted);
+ margin: 0 0 14px;
+}
+.sdk-step-desc a { color: var(--sdk-accent); text-decoration: none; }
+.sdk-step-desc a:hover { text-decoration: underline; }
+.sdk-step-desc code {
+ color: var(--sdk-accent);
+ font-family: ui-monospace, monospace;
+ font-size: 12.5px;
+ background: rgba(167, 139, 250, 0.08);
+ padding: 1px 5px;
+ border-radius: 3px;
+}
+
+/* ── Interactive Playground ────────────────────────────────────────── */
+.sdk-playground {
+ background: var(--sdk-card);
+ border: 1.5px solid var(--sdk-border);
+ border-radius: var(--sdk-radius);
+ overflow: hidden;
+}
+.sdk-playground-layout {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ min-height: 520px;
+}
+.sdk-playground-stage {
+ position: relative;
+ background: #060608;
+ border-right: 1px solid var(--sdk-border);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
+}
+.sdk-playground-stage three-ws-viewer {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+.sdk-playground-stage-label {
+ position: absolute;
+ top: 14px;
+ left: 14px;
+ background: rgba(0, 0, 0, 0.6);
+ backdrop-filter: blur(8px);
+ border: 1px solid var(--sdk-border);
+ border-radius: 6px;
+ padding: 4px 10px;
+ font-size: 11px;
+ font-weight: 600;
+ color: var(--sdk-muted);
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ z-index: 2;
+}
+.sdk-playground-controls {
+ display: flex;
+ flex-direction: column;
+}
+.sdk-playground-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 14px 20px;
+ border-bottom: 1px solid var(--sdk-border);
+}
+.sdk-playground-header-title {
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--sdk-muted);
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+}
+.sdk-playground-config {
+ padding: 20px;
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+ border-bottom: 1px solid var(--sdk-border);
+}
+.sdk-pg-field {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+}
+.sdk-pg-field label {
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--sdk-dim);
+ letter-spacing: 0.03em;
+}
+.sdk-pg-field select,
+.sdk-pg-field input[type="text"] {
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid var(--sdk-border-hi);
+ border-radius: 6px;
+ padding: 8px 12px;
+ font: 13px/1.4 'Inter', sans-serif;
+ color: var(--sdk-text);
+ outline: none;
+ transition: border-color 0.15s;
+}
+.sdk-pg-field select:focus,
+.sdk-pg-field input[type="text"]:focus {
+ border-color: var(--sdk-accent);
+}
+.sdk-pg-field select option { background: #111; }
+.sdk-pg-toggle-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.sdk-pg-toggle {
+ position: relative;
+ width: 36px;
+ height: 20px;
+ border-radius: 10px;
+ background: rgba(255, 255, 255, 0.1);
+ border: none;
+ cursor: pointer;
+ transition: background 0.2s;
+ padding: 0;
+}
+.sdk-pg-toggle::after {
+ content: '';
+ position: absolute;
+ top: 2px; left: 2px;
+ width: 16px; height: 16px;
+ border-radius: 50%;
+ background: #fff;
+ transition: transform 0.2s;
+}
+.sdk-pg-toggle.active {
+ background: var(--sdk-accent);
+}
+.sdk-pg-toggle.active::after {
+ transform: translateX(16px);
+}
+.sdk-playground-code {
+ flex: 1;
+ overflow: auto;
+}
+.sdk-playground-code pre.sdk-pre {
+ border: none;
+ border-radius: 0;
+ height: 100%;
+ min-height: 200px;
+}
+
+/* ── Creator live demo ─────────────────────────────────────────────── */
+.sdk-creator-demo-card {
+ background: var(--sdk-card);
+ border: 1.5px solid var(--sdk-border);
+ border-radius: var(--sdk-radius);
+ padding: 32px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 16px;
+}
+.sdk-creator-desc {
+ font-size: 14px;
+ line-height: 1.65;
+ color: var(--sdk-muted);
+ margin: 0;
+}
+.sdk-creator-status {
+ font-size: 13px;
+ font-family: ui-monospace, monospace;
+ padding: 8px 14px;
+ border-radius: 6px;
+ background: rgba(255, 255, 255, 0.04);
+ color: var(--sdk-dim);
+ min-height: 34px;
+ width: 100%;
+ box-sizing: border-box;
+ display: none;
+}
+.sdk-creator-status.info { display: block; color: var(--sdk-accent); background: rgba(167, 139, 250, 0.06); }
+.sdk-creator-status.ok { display: block; color: var(--sdk-success); background: rgba(74, 222, 128, 0.06); }
+.sdk-creator-status.err { display: block; color: var(--sdk-error); background: rgba(248, 113, 113, 0.06); }
+.sdk-creator-status.muted { display: block; color: var(--sdk-dim); }
+
+/* ── Comparison table ──────────────────────────────────────────────── */
+.sdk-table-wrap {
+ overflow-x: auto;
+ border-radius: var(--sdk-radius);
+ border: 1.5px solid var(--sdk-border);
+}
+table.sdk-table {
+ width: 100%;
+ border-collapse: collapse;
+ background: var(--sdk-card);
+ font-size: 14px;
+}
+.sdk-table th {
+ background: rgba(255, 255, 255, 0.04);
+ padding: 14px 20px;
+ text-align: left;
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--sdk-text);
+ letter-spacing: 0.01em;
+ border-bottom: 1px solid var(--sdk-border);
+}
+.sdk-table th:first-child { border-radius: var(--sdk-radius-sm) 0 0 0; }
+.sdk-table th:last-child { border-radius: 0 var(--sdk-radius-sm) 0 0; }
+.sdk-table td {
+ padding: 13px 20px;
+ color: var(--sdk-muted);
+ border-bottom: 1px solid rgba(255, 255, 255, 0.03);
+ vertical-align: top;
+}
+.sdk-table tr:last-child td { border-bottom: none; }
+.sdk-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
+.sdk-table td:first-child { color: var(--sdk-text); font-weight: 500; }
+.sdk-table .check { color: var(--sdk-success); font-weight: 700; }
+.sdk-table .cross { color: var(--sdk-error); }
+.sdk-table .col-three { color: var(--sdk-text); }
+
+/* ── API reference cards ───────────────────────────────────────────── */
+.sdk-api-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: 16px;
+}
+.sdk-api-card {
+ background: var(--sdk-card);
+ border: 1.5px solid var(--sdk-border);
+ border-radius: var(--sdk-radius);
+ overflow: hidden;
+ transition: border-color 0.25s, transform 0.25s;
+}
+.sdk-api-card:hover {
+ border-color: var(--sdk-border-hi);
+ transform: translateY(-2px);
+}
+.sdk-api-card-head {
+ background: rgba(255, 255, 255, 0.03);
+ border-bottom: 1px solid var(--sdk-border);
+ padding: 14px 18px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+.sdk-api-export-badge {
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ background: rgba(167, 139, 250, 0.12);
+ border: 1px solid rgba(167, 139, 250, 0.25);
+ color: var(--sdk-accent);
+ padding: 2px 7px;
+ border-radius: 4px;
+}
+.sdk-api-name {
+ font-family: ui-monospace, monospace;
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--sdk-text);
+}
+.sdk-api-card-body {
+ padding: 16px 18px;
+}
+.sdk-api-desc {
+ font-size: 13.5px;
+ line-height: 1.6;
+ color: var(--sdk-muted);
+ margin: 0 0 14px;
+}
+.sdk-api-desc code {
+ color: var(--sdk-accent);
+ font-family: ui-monospace, monospace;
+ font-size: 12px;
+}
+.sdk-api-props {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+.sdk-api-props li {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ gap: 8px;
+ align-items: baseline;
+}
+.sdk-api-prop-name {
+ font-family: ui-monospace, monospace;
+ font-size: 12px;
+ color: var(--sdk-accent);
+ white-space: nowrap;
+}
+.sdk-api-prop-desc {
+ font-size: 12.5px;
+ color: var(--sdk-dim);
+ line-height: 1.5;
+}
+
+/* ── CTA banner ────────────────────────────────────────────────────── */
+.sdk-cta-banner {
+ border-radius: var(--sdk-radius);
+ background: linear-gradient(135deg, rgba(167, 139, 250, 0.12) 0%, rgba(129, 140, 248, 0.06) 100%);
+ border: 1.5px solid rgba(167, 139, 250, 0.2);
+ padding: 48px 40px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 32px;
+ position: relative;
+ overflow: hidden;
+}
+.sdk-cta-banner::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: radial-gradient(ellipse at 80% 50%, rgba(167, 139, 250, 0.1) 0%, transparent 60%);
+ pointer-events: none;
+}
+.sdk-cta-banner h2 {
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 28px;
+ font-weight: 700;
+ letter-spacing: -0.02em;
+ margin: 0 0 8px;
+ color: #ffffff;
+}
+.sdk-cta-banner p {
+ font-size: 15px;
+ color: var(--sdk-muted);
+ margin: 0;
+ max-width: 46ch;
+}
+.sdk-cta-banner-actions {
+ display: flex;
+ gap: 12px;
+ flex-shrink: 0;
+ flex-wrap: wrap;
+}
+
+/* ── Mobile ────────────────────────────────────────────────────────── */
+@media (max-width: 900px) {
+ .sdk-hero { padding: 72px 0 0; min-height: auto; }
+ .sdk-hero-inner {
+ grid-template-columns: 1fr;
+ gap: 32px;
+ padding-bottom: 48px;
+ }
+ .sdk-hero-viewer { order: -1; }
+ .sdk-hero-viewer-frame {
+ aspect-ratio: 16 / 9;
+ max-height: 300px;
+ }
+ .sdk-hero-scroll { display: none; }
+ .sdk-stats { gap: 20px; flex-wrap: wrap; }
+ .sdk-code-section {
+ grid-template-columns: 1fr;
+ gap: 24px;
+ }
+ .sdk-code-section.reversed { direction: ltr; }
+ .sdk-playground-layout {
+ grid-template-columns: 1fr;
+ }
+ .sdk-playground-stage {
+ border-right: none;
+ border-bottom: 1px solid var(--sdk-border);
+ min-height: 320px;
+ }
+ .sdk-cta-banner {
+ flex-direction: column;
+ padding: 32px 24px;
+ text-align: center;
+ }
+ .sdk-cta-banner p { margin: 0 auto; }
+ .sdk-cta-banner-actions { justify-content: center; }
+}
+@media (max-width: 600px) {
+ .sdk-hero-h1 { font-size: 32px; }
+ .sdk-hero-sub { font-size: 15px; }
+ .sdk-section { padding: 64px 0; }
+ .sdk-h2 { font-size: 24px; }
+ .sdk-feature-grid { grid-template-columns: 1fr; }
+ .sdk-api-grid { grid-template-columns: 1fr; }
+ .sdk-step { grid-template-columns: 36px 1fr; gap: 14px; }
+ .sdk-step-num { width: 36px; height: 36px; font-size: 14px; }
+ pre.sdk-pre { font-size: 11.5px; padding: 14px; }
+ .sdk-stats { flex-direction: column; gap: 16px; }
+}
diff --git a/public/discover/detail.js b/public/discover/detail.js
index b5a28e8b6..a78cf7b3a 100644
--- a/public/discover/detail.js
+++ b/public/discover/detail.js
@@ -5,6 +5,8 @@ const LIB_CDN_URL = 'https://three.ws/agent-3d/latest/agent-3d.js';
// Parse URL: /discover/a/{chainId}/{agentId} or /discover/avatar/{id}
function parseRoute() {
const path = location.pathname;
+ const solana = path.match(/^\/discover\/a\/sol\/([A-Za-z0-9]+)/);
+ if (solana) return { kind: 'solana', id: solana[1] };
const onchain = path.match(/^\/discover\/a\/(\d+)\/(\d+)/);
if (onchain) return { kind: 'onchain', chainId: onchain[1], id: onchain[2] };
const avatar = path.match(/^\/discover\/avatar\/([^/]+)/);
@@ -87,9 +89,13 @@ function render(item) {
media.appendChild(ph);
}
- // Badges
const badges = $('badges');
- if (item.kind === 'onchain') {
+ if (item.kind === 'solana') {
+ badges.innerHTML = `
+ <span class="explore-badge explore-badge--solana">◎ Solana</span>
+ ${item.has3d ? '<span class="explore-badge explore-badge--3d">3D</span>' : ''}
+ `;
+ } else if (item.kind === 'onchain') {
badges.innerHTML = `
<span class="explore-badge explore-badge--chain">${escapeHtml(item.chainName)}</span>
${item.has3d ? '<span class="explore-badge explore-badge--3d">3D</span>' : ''}
@@ -111,10 +117,13 @@ function render(item) {
descEl.hidden = false;
}
- // Meta row
const metaRow = $('meta-row');
const metaItems = [];
- if (item.kind === 'onchain') {
+ if (item.kind === 'solana') {
+ if (item.owner) metaItems.push(`<span class="detail-meta-item">Owner <a href="${escapeAttr(item.ownerExplorerUrl || '#')}" target="_blank" rel="noopener">${escapeHtml(item.ownerShort)}</a></span>`);
+ if (item.createdAt) metaItems.push(`<span class="detail-meta-item">Registered ${fmtDate(item.createdAt)}</span>`);
+ if (item.skills?.length) metaItems.push(`<span class="detail-meta-item">${item.skills.length} skill${item.skills.length === 1 ? '' : 's'}</span>`);
+ } else if (item.kind === 'onchain') {
metaItems.push(`<span class="detail-meta-item">Agent #${escapeHtml(String(item.agentId))}</span>`);
metaItems.push(`<span class="detail-meta-item">Owner <a href="${escapeAttr(item.ownerExplorerUrl || '#')}" target="_blank" rel="noopener">${escapeHtml(item.ownerShort)}</a></span>`);
if (item.registeredAt) metaItems.push(`<span class="detail-meta-item">Registered ${fmtDate(item.registeredAt)}</span>`);
@@ -130,9 +139,13 @@ function render(item) {
}
metaRow.innerHTML = metaItems.join('');
- // Action buttons
const actions = $('actions');
- if (item.kind === 'onchain') {
+ if (item.kind === 'solana') {
+ if (item.has3d && item.viewerUrl) {
+ actions.innerHTML += `<a class="detail-btn detail-btn--primary" href="${escapeAttr(item.viewerUrl)}">View 3D</a>`;
+ }
+ actions.innerHTML += `<a class="detail-btn detail-btn--ghost" href="${escapeAttr(item.explorerUrl || '#')}" target="_blank" rel="noopener">Solscan ↗</a>`;
+ } else if (item.kind === 'onchain') {
if (item.viewerUrl) {
actions.innerHTML += `<a class="detail-btn detail-btn--primary" href="${escapeAttr(item.viewerUrl)}">View 3D</a>`;
}
@@ -189,7 +202,24 @@ function render(item) {
$('tags').innerHTML = item.tags.map((t) => `<span class="detail-tag">${escapeHtml(t)}</span>`).join('');
}
- // On-chain details panel
+ if (item.kind === 'solana') {
+ const panel = $('onchain-panel');
+ panel.hidden = false;
+ const dl = $('onchain-dl');
+ const rows = [
+ ['Chain', 'Solana (mainnet)'],
+ ['Mint', `<a href="${escapeAttr(item.explorerUrl || '#')}" target="_blank" rel="noopener">${escapeHtml(item.asset)}</a>`],
+ ['Owner', `<a href="${escapeAttr(item.ownerExplorerUrl || '#')}" target="_blank" rel="noopener">${escapeHtml(item.owner)}</a>`],
+ ['Registered', fmtDate(item.createdAt)],
+ ];
+ if (item.skills?.length) {
+ rows.push(['Skills', item.skills.map((s) => escapeHtml(s)).join(', ')]);
+ }
+ dl.innerHTML = rows.map(([k, v]) => `<dt>${escapeHtml(k)}</dt><dd>${v}</dd>`).join('');
+
+ fetchSolanaReputation(item.asset, panel, dl);
+ }
+
if (item.kind === 'onchain') {
const panel = $('onchain-panel');
panel.hidden = false;
@@ -241,7 +271,21 @@ function buildEmbedPanel(item, $) {
const origin = location.origin;
let snippets;
- if (item.kind === 'onchain') {
+ if (item.kind === 'solana') {
+ const pageUrl = `${origin}/discover/a/sol/${item.asset}`;
+ const cardUrl = `${origin}/a/sol/${item.asset}/.well-known/agent-card.json`;
+ const name = item.name || 'Solana Agent';
+ snippets = [
+ { label: 'Link', key: 'link', value: pageUrl, rows: 1 },
+ { label: 'Agent card', key: 'card', value: cardUrl, rows: 1 },
+ {
+ label: 'Markdown',
+ key: 'md',
+ value: `[${name}](${pageUrl})`,
+ rows: 1,
+ },
+ ];
+ } else if (item.kind === 'onchain') {
const pageUrl = `${origin}/a/${item.chainId}/${item.agentId}`;
const embedUrl = `${origin}/a/${item.chainId}/${item.agentId}/embed`;
const agentUri = `agent://${item.chainId}/${item.agentId}`;
@@ -337,6 +381,40 @@ function buildEmbedPanel(item, $) {
});
}
+async function fetchSolanaReputation(asset, panel, dl) {
+ try {
+ const res = await fetch(`/api/agents/solana-reputation?asset=${encodeURIComponent(asset)}&network=mainnet`);
+ if (!res.ok) return;
+ const data = await res.json();
+ const rep = data.reputation;
+ if (!rep) return;
+
+ const extra = [];
+ if (rep.feedback?.total > 0) {
+ const avg = rep.feedback.score_avg != null ? Number(rep.feedback.score_avg).toFixed(1) : '—';
+ extra.push(['Feedback', `${avg} ★ · ${rep.feedback.total} review${rep.feedback.total === 1 ? '' : 's'} (${rep.feedback.unique_attesters} attester${rep.feedback.unique_attesters === 1 ? '' : 's'})`]);
+ }
+ if (rep.validation) {
+ const passed = (rep.validation.self_passed || 0) + (rep.validation.event_passed || 0);
+ const failed = (rep.validation.self_failed || 0) + (rep.validation.event_failed || 0);
+ if (passed + failed > 0) {
+ extra.push(['Validation', `${passed} passed · ${failed} failed`]);
+ }
+ }
+ if (rep.stake?.total_lamports > 0) {
+ const sol = (Number(rep.stake.total_lamports) / 1e9).toFixed(4);
+ extra.push(['Stake', `${sol} SOL from ${rep.stake.unique_stakers} staker${rep.stake.unique_stakers === 1 ? '' : 's'}`]);
+ }
+ if (rep.token_activity?.graduated) {
+ extra.push(['Token', `Graduated · ${rep.token_activity.trade_count || 0} trades`]);
+ }
+ if (extra.length) {
+ dl.innerHTML += '<dt style="grid-column:1/-1;border-top:1px solid rgba(255,255,255,0.06);padding-top:10px;margin-top:6px;font-size:10px;text-transform:uppercase;letter-spacing:0.1em;color:#888">Reputation</dt><dd style="display:none"></dd>';
+ dl.innerHTML += extra.map(([k, v]) => `<dt>${escapeHtml(k)}</dt><dd>${escapeHtml(v)}</dd>`).join('');
+ }
+ } catch (_) {}
+}
+
function showError(status) {
const $ = (role) => document.querySelector(`[data-role="${role}"]`);
$('loading').hidden = true;
diff --git a/public/discover/discover.js b/public/discover/discover.js
index 0e6f082e8..2f0610dc8 100644
--- a/public/discover/discover.js
+++ b/public/discover/discover.js
@@ -81,7 +81,7 @@ const only3dParam = initialParams.get('only3d');
const initialFilter = only3dParam === '0' ? 'all' : '3d';
const initialChain = initialParams.get('chain') || '';
const initialQuery = initialParams.get('q') || '';
-const initialSource = ['onchain', 'avatar'].includes(initialParams.get('source'))
+const initialSource = ['onchain', 'avatar', 'solana'].includes(initialParams.get('source'))
? initialParams.get('source')
: 'all';
@@ -388,6 +388,7 @@ function clearAllFilters() {
function renderCard(item) {
if (item.kind === 'avatar') return renderAvatarCard(item);
+ if (item.kind === 'solana') return renderSolanaCard(item);
return renderOnchainCard(item);
}
@@ -540,6 +541,54 @@ function renderAvatarCard(item) {
return card;
}
+function renderSolanaCard(item) {
+ const card = document.createElement('article');
+ card.className = 'explore-card' + (item.has3d ? ' explore-card--3d' : '');
+
+ const thumb = renderThumb({
+ image: item.image,
+ glbUrl: null,
+ has3d: item.has3d,
+ alt: item.name,
+ });
+
+ const badges = [
+ `<span class="explore-badge explore-badge--solana">◎ Solana</span>`,
+ ];
+ if (item.has3d) badges.push(`<span class="explore-badge explore-badge--3d">3D</span>`);
+
+ const skillChips = (item.skills || [])
+ .slice(0, 3)
+ .map((s) => `<span class="explore-svc">${escapeHtml(s)}</span>`)
+ .join('');
+
+ const detailUrl = `/discover/a/sol/${encodeURIComponent(item.asset)}`;
+
+ card.innerHTML = `
+ <a class="explore-card-thumb" href="${escapeAttr(detailUrl)}">
+ ${thumb}
+ </a>
+ <div class="explore-card-body">
+ <div class="explore-card-head">
+ <h3 class="explore-card-name"><a class="explore-card-name-link" href="${escapeAttr(detailUrl)}">${escapeHtml(item.name)}</a></h3>
+ </div>
+ <div class="explore-card-badges">${badges.join('')}</div>
+ ${item.description ? `<p class="explore-card-desc">${escapeHtml(item.description)}</p>` : ''}
+ ${skillChips ? `<div class="explore-card-svcs">${skillChips}</div>` : ''}
+ <div class="explore-card-foot">
+ <a class="explore-card-owner" href="${escapeAttr(item.ownerExplorerUrl || '#')}" target="_blank" rel="noopener" title="${escapeAttr(item.owner || '')}">
+ ${escapeHtml(item.ownerShort || '')}
+ </a>
+ <div class="explore-card-actions">
+ <a class="explore-card-link" href="${escapeAttr(detailUrl)}">Details</a>
+ <a class="explore-card-link" href="${escapeAttr(item.explorerUrl || '#')}" target="_blank" rel="noopener">Solscan</a>
+ </div>
+ </div>
+ </div>
+ `;
+ return card;
+}
+
function formatCompact(n) {
if (n < 1000) return String(n);
if (n < 1_000_000) return (n / 1000).toFixed(n < 10_000 ? 1 : 0).replace(/\.0$/, '') + 'k';
diff --git a/public/discover/index.html b/public/discover/index.html
index 901a9be2b..395995105 100644
--- a/public/discover/index.html
+++ b/public/discover/index.html
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta
name="description"
- content="Discover every ERC-8004 agent registered on-chain across 20+ EVM networks. Filter by 3D avatar, chain, and keywords."
+ content="Discover agents registered on Solana and 20+ EVM chains. Filter by 3D avatar, chain, and keywords."
/>
<meta name="theme-color" content="#000000" />
<link rel="canonical" href="https://three.ws/discover" />
@@ -16,7 +16,7 @@
<meta property="og:title" content="Discover · three.ws" />
<meta
property="og:description"
- content="Browse every ERC-8004 agent registered on-chain across 20+ EVM networks. Filter by 3D avatar, chain, and keywords."
+ content="Browse agents registered on Solana and 20+ EVM chains. Filter by 3D avatar, chain, and keywords."
/>
<meta property="og:url" content="https://three.ws/discover" />
<meta property="og:image" content="https://three.ws/og-image.png" />
@@ -24,7 +24,7 @@
<meta name="twitter:title" content="Discover · three.ws" />
<meta
name="twitter:description"
- content="The on-chain index of ERC-8004 agents. Every agent, every chain."
+ content="The on-chain agent directory. Solana and 20+ EVM chains."
/>
<meta name="twitter:image" content="https://three.ws/og-image.png" />
<link rel="shortcut icon" href="/favicon.ico" />
@@ -67,10 +67,10 @@
<span>View my agents →</span>
</a>
</div>
- <p class="explore-eyebrow">ERC-8004 Agent Directory</p>
+ <p class="explore-eyebrow">Agent Directory</p>
<h1>Every agent, every chain.</h1>
<p class="explore-sub">
- The complete on-chain index of ERC-8004 agents. Click a 3D avatar to load it in
+ Browse agents registered on Solana and 20+ EVM chains. Click a 3D avatar to load it in
the viewer. Click any card for its on-chain passport.
</p>
@@ -101,7 +101,8 @@
</div>
<div class="explore-chips" data-role="sources">
<button class="explore-chip active" data-source="all">All sources</button>
- <button class="explore-chip" data-source="onchain">Onchain</button>
+ <button class="explore-chip" data-source="solana">Solana</button>
+ <button class="explore-chip" data-source="onchain">EVM</button>
<button class="explore-chip" data-source="avatar">Avatars</button>
</div>
<div class="explore-controls-row">
diff --git a/public/login.html b/public/login.html
index 43d357587..c2039189f 100644
--- a/public/login.html
+++ b/public/login.html
@@ -11,15 +11,15 @@
<meta name="apple-mobile-web-app-title" content="three.ws" />
<link rel="apple-touch-icon" href="/pwa-192x192.png" />
<link rel="icon" href="/favicon.ico" />
+ <script
+ type="module"
+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
+ ></script>
<link rel="stylesheet" href="/wallet-connect.css" />
<link rel="stylesheet" href="/auth.css" />
<link rel="stylesheet" href="/mobile.css" />
<link rel="stylesheet" href="/footer.css" />
<script defer src="/footer-newsletter.js"></script>
- <script
- type="module"
- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
- ></script>
<style>
:root {
color-scheme: dark;
@@ -207,6 +207,11 @@
bottom: -2px;
filter: blur(6px);
}
+ #avatar-canvas {
+ position: fixed; inset: 0;
+ width: 100vw; height: 100vh;
+ pointer-events: none; z-index: 999;
+ }
a {
color: #c8d0e0;
text-decoration: none;
@@ -563,28 +568,11 @@
</form>
<div class="panel">
<a href="/" class="panel-brand" aria-label="three.ws home">three.ws</a>
- <div class="agent-avatar loading" id="login-avatar-wrap" aria-hidden="true">
- <model-viewer
- id="login-avatar"
- src="/avatars/cz.glb"
- alt=""
- autoplay
- animation-name="IdleV4.2(maya_head)"
- disable-zoom
- interaction-prompt="none"
- shadow-intensity="0.6"
- shadow-softness="1"
- exposure="1.05"
- tone-mapping="aces"
- environment-image="neutral"
- camera-orbit="0deg 88deg 4.8m"
- field-of-view="32deg"
- loading="eager"
- ></model-viewer>
- </div>
+ <div class="agent-avatar loading" id="login-avatar-wrap" aria-hidden="true"></div>
</div>
</div>
</main>
+ <canvas id="avatar-canvas"></canvas>
<footer class="h-footer-horizon">
<div class="h-footer-glow-line" aria-hidden="true"></div>
<div class="h-footer-floor" aria-hidden="true"></div>
@@ -827,7 +815,7 @@
setFieldError(passwordInput, passwordErr, 'Enter your password.');
bad = true;
}
- if (bad) return;
+ if (bad) { window.__avatarDisapprove?.(); return; }
btn.disabled = true;
btn.textContent = 'Signing in…';
@@ -859,59 +847,69 @@
} catch {
/* ignore */
}
- location.href = next;
+ window.__avatarCelebrate?.();
+ setTimeout(() => { location.href = next; }, 2000);
} catch (e2) {
setFieldError(passwordInput, passwordErr, e2.message);
btn.disabled = false;
btn.textContent = 'Sign in';
+ window.__avatarDisapprove?.();
}
});
- // ── Avatar look-around + parallax + skeleton ──
- const viewer = document.getElementById('login-avatar');
- const wrap = document.getElementById('login-avatar-wrap');
- if (viewer) {
- viewer.addEventListener('load', () => wrap?.classList.remove('loading'));
- const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
- const BASE_AZ = 0;
- const BASE_POL = 88;
- const AZ_RANGE = 30;
- const POL_RANGE = 14;
- let targetAz = BASE_AZ, targetPol = BASE_POL;
- let curAz = BASE_AZ, curPol = BASE_POL;
- let targetTx = 0, targetTy = 0, curTx = 0, curTy = 0;
- let nod = 0;
- const lerp = (a, b, t) => a + (b - a) * t;
- function tick() {
- curAz = lerp(curAz, targetAz, 0.1);
- curPol = lerp(curPol, targetPol + nod, 0.18);
- curTx = lerp(curTx, targetTx, 0.08);
- curTy = lerp(curTy, targetTy, 0.08);
- nod *= 0.85;
- viewer.setAttribute('camera-orbit', `${curAz}deg ${curPol}deg 4.8m`);
- if (wrap) wrap.style.transform = `translate(${curTx.toFixed(2)}px, ${curTy.toFixed(2)}px)`;
- requestAnimationFrame(tick);
- }
- if (!reducedMotion) {
- requestAnimationFrame(tick);
- window.addEventListener('mousemove', (e) => {
- const nx = e.clientX / window.innerWidth - 0.5;
- const ny = e.clientY / window.innerHeight - 0.5;
- targetAz = BASE_AZ - nx * AZ_RANGE * 2;
- targetPol = BASE_POL + ny * POL_RANGE * 2;
- targetTx = -nx * 10;
- targetTy = -ny * 8;
- }, { passive: true });
- document.querySelectorAll('#f input').forEach((el) => {
- el.addEventListener('keydown', (ev) => {
- if (ev.key && typeof ev.key === 'string' && (ev.key.length === 1 || ev.key === 'Backspace')) {
- nod = (nod >= 0 ? -1 : 1) * 4;
- }
- });
- });
- }
- }
})();
</script>
+ <script type="module">
+ import { createAgentUI } from '@three-ws/agent-ui';
+
+ const avatarWrap = document.getElementById('login-avatar-wrap');
+ const emailInput = document.getElementById('email');
+ const passwordInput = document.getElementById('password');
+
+ const agent = await createAgentUI({
+ canvas: document.getElementById('avatar-canvas'),
+ clips: ['idle', 'walk', 'lookdown', 'covereyes', 'reaction', 'silly', 'defeated', 'angry', 'facepalm'],
+ subclips: {
+ covereyes: { start: 0, end: 48, fps: 30 },
+ },
+ });
+
+ agent.standOn(avatarWrap, { anchor: 'bottom-center', offsetY: -50 });
+ avatarWrap?.classList.remove('loading');
+
+ window.addEventListener('resize', () => {
+ agent.standOn(avatarWrap, { anchor: 'bottom-center', offsetY: -50 });
+ });
+
+ emailInput.addEventListener('focus', () => {
+ agent.play('lookdown', { loop: true });
+ });
+ emailInput.addEventListener('blur', () => {
+ agent.play('idle', { loop: true });
+ });
+
+ passwordInput.addEventListener('focus', () => {
+ agent.play('covereyes', { loop: false, hold: true });
+ agent.faceFront();
+ });
+ passwordInput.addEventListener('blur', (e) => {
+ if (e.relatedTarget && e.relatedTarget.closest('.password-wrap')) return;
+ agent.play('idle', { loop: true });
+ });
+
+ const pickFail = agent.pickFrom(['reaction', 'defeated', 'angry', 'facepalm']);
+ window.__avatarDisapprove = function () {
+ const pick = pickFail();
+ agent.play(pick, { loop: false });
+ const dur = agent.clip(pick) * 1000;
+ setTimeout(() => {
+ if (agent.currentClip === pick) agent.play('idle', { loop: true });
+ }, dur - 150);
+ };
+
+ window.__avatarCelebrate = function () {
+ agent.play('silly', { loop: true });
+ };
+ </script>
</body>
</html>
diff --git a/public/style.css b/public/style.css
index c5b455741..eec5ba95a 100644
--- a/public/style.css
+++ b/public/style.css
@@ -4653,6 +4653,92 @@ body[data-viewer-mode='explore'] #layout-switch {
border-top: 1px solid rgba(255, 255, 255, 0.05);
}
+/* ── Thought Bubble — floats above avatar head ────────────────────────────── */
+
+.thought-bubble {
+ position: absolute;
+ z-index: 10;
+ pointer-events: none;
+ opacity: 0;
+ transition: opacity 0.25s ease;
+ transform-origin: center bottom;
+ will-change: transform, left, top;
+}
+
+.thought-bubble--visible {
+ opacity: 1;
+ pointer-events: auto;
+}
+
+.thought-bubble__text {
+ background: rgba(12, 12, 18, 0.88);
+ color: rgba(255, 255, 255, 0.92);
+ padding: 10px 16px;
+ border-radius: 16px;
+ max-width: 280px;
+ min-width: 48px;
+ font-size: 13px;
+ line-height: 1.45;
+ font-family: 'Inter', sans-serif;
+ word-wrap: break-word;
+ text-align: center;
+ position: relative;
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ box-shadow:
+ 0 4px 24px rgba(0, 0, 0, 0.45),
+ 0 0 0 1px rgba(255, 255, 255, 0.04);
+}
+
+.thought-bubble__text::after {
+ content: '';
+ position: absolute;
+ bottom: -7px;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 0;
+ height: 0;
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-top: 7px solid rgba(12, 12, 18, 0.88);
+}
+
+.thought-bubble__dots {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 2px 6px;
+}
+
+.thought-bubble__dots span {
+ display: block;
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: rgba(255, 255, 255, 0.55);
+ animation: thought-dot-bounce 1.4s ease-in-out infinite both;
+}
+
+.thought-bubble__dots span:nth-child(2) {
+ animation-delay: 0.16s;
+}
+
+.thought-bubble__dots span:nth-child(3) {
+ animation-delay: 0.32s;
+}
+
+@keyframes thought-dot-bounce {
+ 0%, 80%, 100% {
+ transform: translateY(0);
+ opacity: 0.35;
+ }
+ 40% {
+ transform: translateY(-5px);
+ opacity: 1;
+ }
+}
+
/* ── Responsive — hide sidebar on narrow viewports ─────────────────────────── */
@media screen and (max-width: 900px) {
@@ -7088,6 +7174,11 @@ textarea.erc8004-code {
color: #c4b5fd;
border-color: rgba(255, 255, 255, 0.4);
}
+.explore-badge--solana {
+ background: rgba(153, 69, 255, 0.1);
+ color: #b88aff;
+ border-color: rgba(153, 69, 255, 0.3);
+}
.explore-card-desc {
margin: 0;
font-size: 13px;
diff --git a/src/api-playground.js b/src/api-playground.js
new file mode 100644
index 000000000..fb462b785
--- /dev/null
+++ b/src/api-playground.js
@@ -0,0 +1,255 @@
+(function initApiPlayground() {
+ var PG_ORIGIN = location.origin;
+ var PG_DEMO = 'bacff13e-b64b-4ac0-860d-44f0168ad23b';
+
+ var PG_ENDPOINTS = {
+ 'list-agents': {
+ method: 'GET', path: '/api/agents', params: [],
+ desc: 'List all agents in your account',
+ sampleBody: null,
+ sdk: "const res = await fetch('" + PG_ORIGIN + "/api/agents', {\n headers: { 'Authorization': 'Bearer YOUR_API_KEY' }\n});\nconst agents = await res.json();",
+ },
+ 'create-agent': {
+ method: 'POST', path: '/api/agents', params: [],
+ desc: 'Create a new agent from avatar + prompt',
+ sampleBody: JSON.stringify({ name: 'my-agent', avatar_id: PG_DEMO, system_prompt: 'You are a helpful assistant.' }, null, 2),
+ sdk: "const res = await fetch('" + PG_ORIGIN + "/api/agents', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer YOUR_API_KEY',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n name: 'my-agent',\n avatar_id: '" + PG_DEMO + "',\n system_prompt: 'You are a helpful assistant.'\n })\n});\nconst agent = await res.json();",
+ },
+ 'chat': {
+ method: 'POST', path: '/api/chat', params: [],
+ desc: 'Send a message and stream a response',
+ sampleBody: JSON.stringify({ agent_id: PG_DEMO, message: 'Hello, who are you?', stream: false }, null, 2),
+ sdk: "const res = await fetch('" + PG_ORIGIN + "/api/chat', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer YOUR_API_KEY',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n agent_id: '" + PG_DEMO + "',\n message: 'Hello, who are you?',\n stream: false\n })\n});\nconst reply = await res.json();",
+ },
+ 'get-avatar': {
+ method: 'GET', path: '/api/avatars/:id',
+ params: [{ key: 'id', label: 'Avatar ID', placeholder: PG_DEMO, default: PG_DEMO }],
+ desc: 'Fetch avatar metadata and GLB URL',
+ sampleBody: null,
+ sdk: "const res = await fetch('" + PG_ORIGIN + "/api/avatars/" + PG_DEMO + "');\nconst avatar = await res.json();",
+ },
+ 'mcp': {
+ method: 'POST', path: '/api/mcp',
+ params: [],
+ desc: 'JSON-RPC 2.0 call to the MCP server',
+ sampleBody: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/list', params: {} }, null, 2),
+ sdk: "const res = await fetch('" + PG_ORIGIN + "/api/mcp', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer YOUR_API_KEY',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: 1,\n method: 'tools/list',\n params: {}\n })\n});\nconst result = await res.json();",
+ },
+ 'a2a': {
+ method: 'POST', path: '/api/agents/:agentId/a2a',
+ params: [{ key: 'agentId', label: 'Agent ID', placeholder: PG_DEMO, default: PG_DEMO }],
+ desc: 'Agent-to-agent protocol endpoint',
+ sampleBody: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'message/send', params: { message: { role: 'user', parts: [{ type: 'text', text: 'Hello' }] } } }, null, 2),
+ sdk: "const res = await fetch('" + PG_ORIGIN + "/api/agents/" + PG_DEMO + "/a2a', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n jsonrpc: '2.0', id: 1,\n method: 'message/send',\n params: { message: { role: 'user', parts: [{ type: 'text', text: 'Hello' }] } }\n })\n});\nconst result = await res.json();",
+ },
+ };
+
+ var pgEl = function(id) { return document.getElementById(id); };
+ var pgS = {
+ tabs: pgEl('pg-tabs'),
+ empty: pgEl('pg-empty-state'),
+ builder: pgEl('pg-builder'),
+ method: pgEl('pg-method'),
+ path: pgEl('pg-path'),
+ params: pgEl('pg-params'),
+ bodyWrap: pgEl('pg-body-wrap'),
+ body: pgEl('pg-body'),
+ send: pgEl('pg-send'),
+ status: pgEl('pg-status'),
+ response: pgEl('pg-response'),
+ respBody: pgEl('pg-response-body'),
+ copyResp: pgEl('pg-copy-resp'),
+ sdkCode: pgEl('pg-sdk-code'),
+ curlCode: pgEl('pg-curl-code'),
+ endpoints: pgEl('pg-endpoints'),
+ };
+
+ if (!pgS.tabs || !pgS.endpoints) return;
+
+ var pgActive = null;
+
+ function pgHighlightJson(json) {
+ return json
+ .replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
+ .replace(/"([^"]+)"(?=\s*:)/g, '<span class="json-key">"$1"</span>')
+ .replace(/:\s*"([^"]*)"/g, ': <span class="json-str">"$1"</span>')
+ .replace(/:\s*(\d+\.?\d*)/g, ': <span class="json-num">$1</span>')
+ .replace(/:\s*(true|false)/g, ': <span class="json-bool">$1</span>')
+ .replace(/:\s*(null)/g, ': <span class="json-null">$1</span>');
+ }
+
+ function pgResolvePath(ep) {
+ var p = ep.path;
+ (ep.params || []).forEach(function(param) {
+ var input = pgEl('pg-param-' + param.key);
+ var val = input ? input.value.trim() : param.default;
+ p = p.replace(':' + param.key, val || param.default);
+ });
+ return p;
+ }
+
+ function pgBuildCurl(ep) {
+ var url = PG_ORIGIN + pgResolvePath(ep);
+ var cmd = 'curl -X ' + ep.method + " '" + url + "'";
+ cmd += " \\\n -H 'Authorization: Bearer YOUR_API_KEY'";
+ if (ep.sampleBody) {
+ var body = pgS.body.value.trim() || ep.sampleBody;
+ cmd += " \\\n -H 'Content-Type: application/json'";
+ cmd += " \\\n -d '" + body.replace(/'/g, "'\\''") + "'";
+ }
+ return cmd;
+ }
+
+ function pgBuildSdk(ep) {
+ var code = ep.sdk;
+ (ep.params || []).forEach(function(param) {
+ var input = pgEl('pg-param-' + param.key);
+ var val = input ? input.value.trim() : param.default;
+ if (val && val !== param.default) {
+ code = code.split(param.default).join(val);
+ }
+ });
+ return code;
+ }
+
+ function pgUpdateCurl() {
+ if (!pgActive) return;
+ pgS.curlCode.textContent = pgBuildCurl(PG_ENDPOINTS[pgActive]);
+ }
+
+ function pgUpdateSdk() {
+ if (!pgActive) return;
+ var code = pgBuildSdk(PG_ENDPOINTS[pgActive]);
+ pgS.sdkCode.innerHTML = code
+ .replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
+ .replace(/\b(const|let|var|await|async|import|from|new)\b/g, '<span class="kw">$1</span>')
+ .replace(/'([^']*)'/g, "'<span class=\"str\">$1</span>'");
+ }
+
+ function pgSelectEndpoint(key) {
+ var ep = PG_ENDPOINTS[key];
+ if (!ep) return;
+ pgActive = key;
+
+ pgS.endpoints.querySelectorAll('.dev-api-row').forEach(function(r) { r.classList.remove('active'); });
+ var row = pgS.endpoints.querySelector('[data-endpoint="' + key + '"]');
+ if (row) row.classList.add('active');
+
+ pgS.empty.style.display = 'none';
+ pgS.builder.style.display = 'block';
+
+ pgS.method.textContent = ep.method;
+ pgS.method.className = 'pg-url-method' + (ep.method === 'POST' ? ' post' : '');
+ pgS.path.value = ep.path;
+
+ pgS.params.innerHTML = '';
+ (ep.params || []).forEach(function(param) {
+ var div = document.createElement('div');
+ div.className = 'pg-field';
+ div.innerHTML = '<label class="pg-field-label">' + param.label + '</label><input class="pg-input" id="pg-param-' + param.key + '" placeholder="' + param.placeholder + '" value="' + param.default + '" />';
+ pgS.params.appendChild(div);
+ div.querySelector('input').addEventListener('input', function() {
+ pgS.path.value = pgResolvePath(ep);
+ pgUpdateCurl();
+ pgUpdateSdk();
+ });
+ });
+ pgS.path.value = pgResolvePath(ep);
+
+ if (ep.sampleBody) {
+ pgS.bodyWrap.style.display = 'block';
+ pgS.body.value = ep.sampleBody;
+ } else {
+ pgS.bodyWrap.style.display = 'none';
+ pgS.body.value = '';
+ }
+
+ pgS.response.style.display = 'none';
+ pgS.status.textContent = '';
+ pgS.status.className = 'pg-status';
+
+ pgUpdateCurl();
+ pgUpdateSdk();
+ }
+
+ // Tab switching
+ pgS.tabs.addEventListener('click', function(e) {
+ var tab = e.target.closest('.dev-tab');
+ if (!tab) return;
+ pgS.tabs.querySelectorAll('.dev-tab').forEach(function(t) { t.classList.remove('active'); });
+ tab.classList.add('active');
+ var target = tab.dataset.tab;
+ document.querySelectorAll('#pg-left .dev-tab-content').forEach(function(c) { c.classList.remove('active'); });
+ var panel = pgEl('pg-tab-' + target);
+ if (panel) panel.classList.add('active');
+ });
+
+ // Endpoint selection
+ pgS.endpoints.addEventListener('click', function(e) {
+ var row = e.target.closest('.dev-api-row');
+ if (!row || !row.dataset.endpoint) return;
+ pgSelectEndpoint(row.dataset.endpoint);
+ var tryitTab = pgS.tabs.querySelector('[data-tab="tryit"]');
+ if (tryitTab && !tryitTab.classList.contains('active')) {
+ tryitTab.click();
+ }
+ });
+
+ // Send request
+ pgS.send.addEventListener('click', async function() {
+ if (!pgActive) return;
+ var ep = PG_ENDPOINTS[pgActive];
+ var url = PG_ORIGIN + pgResolvePath(ep);
+
+ pgS.send.disabled = true;
+ pgS.send.textContent = 'Sending…';
+ pgS.status.textContent = '';
+ pgS.status.className = 'pg-status';
+ pgS.response.style.display = 'none';
+
+ var t0 = performance.now();
+ try {
+ var opts = { method: ep.method, headers: {} };
+ if (ep.sampleBody) {
+ opts.headers['Content-Type'] = 'application/json';
+ opts.body = pgS.body.value.trim() || ep.sampleBody;
+ }
+ var res = await fetch(url, opts);
+ var elapsed = Math.round(performance.now() - t0);
+ var text = await res.text();
+
+ pgS.status.textContent = res.status + ' ' + res.statusText + ' · ' + elapsed + 'ms';
+ pgS.status.className = 'pg-status ' + (res.ok ? 'ok' : 'err');
+
+ var display;
+ try {
+ var parsed = JSON.parse(text);
+ display = pgHighlightJson(JSON.stringify(parsed, null, 2));
+ } catch (_) {
+ display = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ }
+ pgS.respBody.innerHTML = display;
+ pgS.response.style.display = 'block';
+ } catch (err) {
+ pgS.status.textContent = 'Network error';
+ pgS.status.className = 'pg-status err';
+ pgS.respBody.textContent = err.message;
+ pgS.response.style.display = 'block';
+ } finally {
+ pgS.send.disabled = false;
+ pgS.send.textContent = 'Send';
+ }
+ });
+
+ // Copy response
+ pgS.copyResp.addEventListener('click', function() {
+ var text = pgS.respBody.textContent;
+ navigator.clipboard.writeText(text).then(function() {
+ pgS.copyResp.textContent = 'Copied';
+ setTimeout(function() { pgS.copyResp.textContent = 'Copy'; }, 1500);
+ }).catch(function() {});
+ });
+
+ // Update curl when body changes
+ pgS.body.addEventListener('input', pgUpdateCurl);
+})();
diff --git a/src/app.js b/src/app.js
index d377434c1..9ae00b91e 100644
--- a/src/app.js
+++ b/src/app.js
@@ -9,6 +9,7 @@ import { Validator } from './validator.js';
import { Footer } from './components/footer';
import { startWidgetRpcServer } from './widget/rpc-server.js';
import { NichAgent } from './nich-agent.js';
+import { ThoughtBubble } from './thought-bubble.js';
import { AvatarCreator } from './avatar-creator.js';
import { resolveURI, isDecentralizedURI } from './ipfs.js';
import { saveRemoteGlbToAccount, getMe, readAuthHint } from './account.js';
@@ -1552,12 +1553,14 @@ class App {
}
_initNichAgent() {
+ const bubble = this.viewer ? new ThoughtBubble(this.viewer) : null;
const agent = new NichAgent(
document.body,
protocol,
this.skills,
this.identity,
this.runtime,
+ { thoughtBubble: bubble },
);
window.VIEWER.agent = agent;
// Greet on first open
diff --git a/src/avatar-drop.js b/src/avatar-drop.js
new file mode 100644
index 000000000..2e7636e5b
--- /dev/null
+++ b/src/avatar-drop.js
@@ -0,0 +1,411 @@
+import * as THREE from 'three';
+import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+
+export function initAvatarDrop(sectionEl) {
+ const canvas = sectionEl.querySelector('#drop-canvas');
+ const sitLine = sectionEl.querySelector('#drop-sit-line');
+ const ctaBtn = sectionEl.querySelector('#drop-cta-btn');
+ if (!canvas || !sitLine || !ctaBtn) return;
+
+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
+ renderer.toneMappingExposure = 1.1;
+
+ const scene = new THREE.Scene();
+
+ let PX_PER_UNIT = 120;
+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);
+ camera.position.z = 10;
+
+ function updateFrustum() {
+ PX_PER_UNIT = window.innerWidth < 640 ? 92 : 120;
+ const rect = sectionEl.getBoundingClientRect();
+ const hw = rect.width / PX_PER_UNIT / 2;
+ const hh = rect.height / PX_PER_UNIT / 2;
+ camera.left = -hw; camera.right = hw;
+ camera.top = hh; camera.bottom = -hh;
+ camera.updateProjectionMatrix();
+ }
+
+ const _v3 = new THREE.Vector3();
+ function domToWorld(screenX, screenY) {
+ const rect = sectionEl.getBoundingClientRect();
+ _v3.set(
+ ((screenX - rect.left) / rect.width) * 2 - 1,
+ -((screenY - rect.top) / rect.height) * 2 + 1,
+ 0
+ );
+ _v3.unproject(camera);
+ return { x: _v3.x, y: _v3.y };
+ }
+
+ function resize() {
+ const rect = sectionEl.getBoundingClientRect();
+ renderer.setSize(rect.width, rect.height, false);
+ updateFrustum();
+ }
+
+ window.addEventListener('resize', () => { resize(); recalibrateSitAnchor(); });
+ resize();
+
+ function smoothstep(t) { return t * t * (3 - 2 * t); }
+
+ let recalSlide = null;
+ function lerpAvatarTo(target, ms = 280) {
+ if (!avatar) return;
+ if (recalSlide) cancelAnimationFrame(recalSlide);
+ const fromX = avatar.position.x, fromY = avatar.position.y;
+ const t0 = performance.now();
+ (function step(now) {
+ const sp = Math.min((now - t0) / ms, 1);
+ const e = smoothstep(sp);
+ avatar.position.x = fromX + (target.x - fromX) * e;
+ avatar.position.y = fromY + (target.y - fromY) * e;
+ if (sp < 1) recalSlide = requestAnimationFrame(step);
+ else recalSlide = null;
+ })(performance.now());
+ }
+
+ function recalibrateSitAnchor() {
+ if (!avatar) return;
+ const next = getSitWorld();
+ startW = next;
+ if (phase === 'sitting' || phase === 'standingUp' || phase === 'loading')
+ lerpAvatarTo(next, 280);
+ }
+
+ const sitLineRO = new ResizeObserver(() => recalibrateSitAnchor());
+ sitLineRO.observe(sitLine);
+
+ // Lights — neutral/warm to match the monochrome theme
+ scene.add(new THREE.AmbientLight(0xffffff, 0.65));
+ const key = new THREE.DirectionalLight(0xfff8f0, 1.9);
+ key.position.set(3, 6, 5);
+ scene.add(key);
+ const rim = new THREE.DirectionalLight(0xc0c8e0, 0.5);
+ rim.position.set(-4, 3, -2);
+ scene.add(rim);
+ const fill = new THREE.DirectionalLight(0xffeedd, 0.35);
+ fill.position.set(0, 2, 7);
+ scene.add(fill);
+
+ // State
+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;
+ let sitAction = null, standupAction = null, fallAction = null;
+ let phase = 'loading';
+ let startW = { x: 0, y: 0 };
+ let seqT = 0, landed = false, jumpTarget = { x: 0, y: 0 };
+
+ const pendingTimers = new Set();
+ function later(fn, ms) {
+ const id = setTimeout(() => { pendingTimers.delete(id); fn(); }, ms);
+ pendingTimers.add(id);
+ return id;
+ }
+ function clearTimers() {
+ for (const id of pendingTimers) clearTimeout(id);
+ pendingTimers.clear();
+ }
+
+ const STAND_S = 2.566;
+ const JUMP_CLIP_S = 2.667;
+ const JUMP_RATE = 1.7;
+ const JUMP_S = JUMP_CLIP_S / JUMP_RATE;
+ const SIT_DWELL_S = 2.8;
+ const LAND_P = 0.92;
+ const LAND_PX = 14;
+ const FADE_S = 0.3;
+ const SIT_OFFSET_PX_BASE = 90;
+
+ function sitOffsetPx() { return SIT_OFFSET_PX_BASE * (PX_PER_UNIT / 120); }
+
+ function getSitWorld() {
+ const rect = sitLine.getBoundingClientRect();
+ return domToWorld(rect.left + rect.width / 2, rect.top + sitOffsetPx());
+ }
+
+ function getButtonWorld() {
+ const rect = ctaBtn.getBoundingClientRect();
+ return domToWorld(rect.left + rect.width / 2, rect.top);
+ }
+
+ function placeAtStart() {
+ if (!avatar) return;
+ startW = getSitWorld();
+ if (phase === 'sitting' || phase === 'loading')
+ avatar.position.set(startW.x, startW.y, 0);
+ }
+
+ // Button squish + screen shake via Web Animations API
+ function fireSquish() {
+ ctaBtn.getAnimations().forEach(a => a.cancel());
+ ctaBtn.animate([
+ { transform: 'scaleY(1) scaleX(1)', offset: 0 },
+ { transform: 'scaleY(0.5) scaleX(1.15)', offset: 0.08 },
+ { transform: 'scaleY(1.12) scaleX(0.94)', offset: 0.3 },
+ { transform: 'scaleY(0.96) scaleX(1.02)', offset: 0.55 },
+ { transform: 'scaleY(1.02) scaleX(0.99)', offset: 0.78 },
+ { transform: 'scaleY(1) scaleX(1)', offset: 1 },
+ ], { duration: 900, easing: 'ease-out', fill: 'forwards' });
+
+ const content = sectionEl.querySelector('.body-drop-content');
+ if (content) {
+ content.getAnimations().forEach(a => a.cancel());
+ content.animate([
+ { transform: 'translateY(0)' },
+ { transform: 'translateY(-6px)' },
+ { transform: 'translateY(2px)' },
+ { transform: 'translateY(-1px)' },
+ { transform: 'translateY(0)' },
+ ], { duration: 450, easing: 'ease-out' });
+ }
+ }
+
+ // Monochrome particle splash
+ const SPLASH_GRAVITY = 1800;
+ const SPLASH_COUNT = 32;
+ function fireSplash(ox, oy) {
+ if (ox == null) {
+ const r = ctaBtn.getBoundingClientRect();
+ ox = r.left + r.width / 2; oy = r.top + 2;
+ }
+ const drops = [];
+ for (let i = 0; i < SPLASH_COUNT; i++) {
+ const size = 4 + Math.random() * 8;
+ const el = document.createElement('div');
+ el.style.cssText =
+ 'position:fixed;border-radius:50%;pointer-events:none;z-index:30;will-change:transform,opacity;' +
+ `left:${ox - size / 2}px;top:${oy - size / 2}px;` +
+ `width:${size}px;height:${size}px;` +
+ 'background:radial-gradient(circle at 35% 30%,#fff,#bbb 55%,#666);' +
+ 'box-shadow:0 0 4px rgba(255,255,255,0.35);';
+ document.body.appendChild(el);
+ const angle = -Math.PI / 2 + (Math.random() - 0.5) * Math.PI * 1.15;
+ const speed = 320 + Math.random() * 420;
+ drops.push({
+ el, x: 0, y: 0,
+ vx: Math.cos(angle) * speed,
+ vy: Math.sin(angle) * speed,
+ life: 0, max: 0.8 + Math.random() * 0.5,
+ });
+ }
+ let last = performance.now();
+ (function step(now) {
+ const dt = Math.min((now - last) / 1000, 0.04);
+ last = now;
+ let alive = false;
+ for (const d of drops) {
+ if (!d.el) continue;
+ d.life += dt;
+ d.vy += SPLASH_GRAVITY * dt;
+ d.x += d.vx * dt;
+ d.y += d.vy * dt;
+ const t = d.life / d.max;
+ if (t >= 1) { d.el.remove(); d.el = null; continue; }
+ d.el.style.opacity = String(1 - t * t);
+ d.el.style.transform = `translate(${d.x.toFixed(1)}px,${d.y.toFixed(1)}px)`;
+ alive = true;
+ }
+ if (alive) requestAnimationFrame(step);
+ })(last);
+ }
+
+ function startSit() {
+ if (!sitAction) return;
+ phase = 'sitting';
+ placeAtStart();
+ fallAction?.stop();
+ standupAction?.stop();
+ avatar.rotation.set(0, 0, 0);
+ sitAction.reset().play();
+ later(startStandup, SIT_DWELL_S * 1000);
+ }
+
+ function startStandup() {
+ if (!standupAction || phase !== 'sitting') return;
+ phase = 'standingUp';
+ standupAction.reset();
+ standupAction.crossFadeFrom(sitAction, FADE_S, false).play();
+ later(triggerJump, (STAND_S - FADE_S) * 1000);
+ }
+
+ function triggerJump() {
+ if (!avatar || !fallAction || phase === 'jumping') return;
+ startW = getSitWorld();
+ const btn = getButtonWorld();
+ jumpTarget = { x: startW.x, y: btn.y };
+ phase = 'jumping'; seqT = 0; landed = false;
+ fallAction.reset();
+ fallAction.crossFadeFrom(standupAction, FADE_S, false).play();
+ }
+
+ function updateSeq(dt) {
+ if (phase !== 'jumping' || !avatar) return;
+ seqT += dt;
+ const p = Math.min(seqT / JUMP_S, 1);
+ const y = startW.y + (jumpTarget.y - startW.y) * (p * p);
+ avatar.position.set(startW.x, y, 0);
+
+ if (!landed && p >= LAND_P) {
+ const dyPx = Math.abs(avatar.position.y - jumpTarget.y) * PX_PER_UNIT;
+ if (dyPx < LAND_PX) {
+ landed = true;
+ fireSquish();
+ const sitRect = sitLine.getBoundingClientRect();
+ const btnRect = ctaBtn.getBoundingClientRect();
+ fireSplash(sitRect.left + sitRect.width / 2, btnRect.top + 2);
+ }
+ }
+
+ if (p >= 1) {
+ phase = 'resting';
+ later(() => {
+ const fromX = avatar.position.x;
+ const fromY = avatar.position.y;
+ const back = getSitWorld();
+ startW = back;
+ avatar.rotation.y = 0;
+ const t0 = performance.now();
+ (function slide(now) {
+ const sp = Math.min((now - t0) / 700, 1);
+ avatar.position.x = fromX + (back.x - fromX) * smoothstep(sp);
+ avatar.position.y = fromY + (back.y - fromY) * smoothstep(sp);
+ if (sp < 1) requestAnimationFrame(slide);
+ else {
+ avatar.position.set(back.x, back.y, 0);
+ startSit();
+ }
+ })(performance.now());
+ }, 1600);
+ }
+ }
+
+ ctaBtn.addEventListener('click', e => {
+ if (phase === 'sitting' || phase === 'standingUp') {
+ e.preventDefault();
+ triggerJump();
+ }
+ });
+
+ // Proximity text shadow
+ const _proj = new THREE.Vector3();
+ function updateProximityShadow() {
+ if (!avatar) return;
+ const sRect = sectionEl.getBoundingClientRect();
+ _proj.set(avatar.position.x, avatar.position.y, avatar.position.z);
+ _proj.project(camera);
+ const ay = sRect.top + (1 - _proj.y) * 0.5 * sRect.height;
+ const rect = sitLine.getBoundingClientRect();
+ const dy = Math.max(0, rect.top - ay);
+ const prox = 1 - Math.min(dy / 220, 1);
+ if (prox <= 0.01) {
+ sitLine.style.setProperty('--drop-shadow', 'none');
+ return;
+ }
+ const blur = (10 * (1 - prox) + 2).toFixed(2);
+ const offsetY = (2 + 6 * prox).toFixed(2);
+ const alpha = (0.45 * prox).toFixed(3);
+ sitLine.style.setProperty(
+ '--drop-shadow',
+ `0 ${offsetY}px ${blur}px rgba(0,0,0,${alpha})`
+ );
+ }
+
+ // Resolve GLB URL for dev proxy
+ function resolveGlb(url) {
+ if (!url) return url;
+ const isDev = location.hostname === 'localhost'
+ || location.hostname.includes('.github.dev')
+ || location.hostname.includes('.gitpod.io');
+ if (isDev && url.includes('r2.dev')) {
+ try { return '/r2-proxy' + new URL(url).pathname; } catch (_) {}
+ }
+ return url;
+ }
+
+ const AVATAR_ID = 'bacff13e-b64b-4ac0-860d-44f0168ad23b';
+
+ fetch(`${location.origin}/api/avatars/${AVATAR_ID}`)
+ .then(r => r.json())
+ .then(d => {
+ const glb = resolveGlb(d.avatar?.model_url || d.avatar?.url);
+ if (!glb) return;
+
+ new GLTFLoader().load(glb, gltf => {
+ avatar = gltf.scene;
+ avatar.traverse(n => {
+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name))
+ rootBone = n;
+ });
+ avatar.rotation.y = 0;
+ scene.add(avatar);
+ mixer = new THREE.AnimationMixer(avatar);
+
+ const fetchClip = f => fetch(f).then(r => r.json());
+ Promise.all([
+ fetchClip('/animations/clips/sitidle.json'),
+ fetchClip('/animations/clips/standup.json'),
+ fetchClip('/animations/clips/jumpdown.json'),
+ ]).then(([sitJson, standJson, jumpJson]) => {
+ sitAction = mixer.clipAction(THREE.AnimationClip.parse(sitJson));
+ sitAction.setLoop(THREE.LoopRepeat, Infinity);
+
+ standupAction = mixer.clipAction(THREE.AnimationClip.parse(standJson));
+ standupAction.setLoop(THREE.LoopOnce, 1);
+ standupAction.clampWhenFinished = true;
+
+ fallAction = mixer.clipAction(THREE.AnimationClip.parse(jumpJson));
+ fallAction.setLoop(THREE.LoopOnce, 1);
+ fallAction.clampWhenFinished = true;
+ fallAction.timeScale = JUMP_RATE;
+
+ if (rootBone) baseRootPos = rootBone.position.clone();
+
+ // Root-bone lock: full clamp during jump, X/Z only during sit/stand
+ const _render = renderer.render.bind(renderer);
+ renderer.render = (sc, cam) => {
+ try {
+ if (rootBone && baseRootPos) {
+ if (phase === 'jumping') {
+ rootBone.position.copy(baseRootPos);
+ } else {
+ rootBone.position.x = baseRootPos.x;
+ rootBone.position.z = baseRootPos.z;
+ }
+ }
+ } catch (_) {}
+ _render(sc, cam);
+ };
+
+ startSit();
+ });
+ });
+ })
+ .catch(e => console.warn('[avatar-drop] boot failed', e));
+
+ // Render loop with visibility pause
+ const clock = new THREE.Clock();
+ let running = true;
+
+ function tick() {
+ if (!running) return;
+ requestAnimationFrame(tick);
+ try {
+ const dt = Math.min(clock.getDelta(), 0.05);
+ mixer?.update(dt);
+ updateSeq(dt);
+ updateProximityShadow();
+ renderer.render(scene, camera);
+ } catch (_) {}
+ }
+ tick();
+
+ const visObs = new IntersectionObserver(entries => {
+ const vis = entries[0].isIntersecting;
+ if (vis && !running) { running = true; clock.getDelta(); tick(); }
+ else if (!vis && running) { running = false; }
+ }, { threshold: 0 });
+ visObs.observe(sectionEl);
+}
diff --git a/src/avatar-sdk-page.js b/src/avatar-sdk-page.js
index 864d27f68..970054195 100644
--- a/src/avatar-sdk-page.js
+++ b/src/avatar-sdk-page.js
@@ -1,14 +1,28 @@
-// Avatar SDK page — registers <three-ws-viewer>, copy buttons, tab switching, creator demo
import { ThreeWsViewerElement } from '../avatar-sdk/src/viewer.js';
if (typeof customElements !== 'undefined' && !customElements.get('three-ws-viewer')) {
customElements.define('three-ws-viewer', ThreeWsViewerElement);
}
-// ── Copy-to-clipboard ────────────────────────────────────────────────────────
document.addEventListener('DOMContentLoaded', () => {
+ // ── Scroll reveal ────────────────────────────────────────────────────────
+ const revealObserver = new IntersectionObserver(
+ (entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('revealed');
+ revealObserver.unobserve(entry.target);
+ }
+ }
+ },
+ { threshold: 0.12, rootMargin: '0px 0px -40px 0px' }
+ );
+ document.querySelectorAll('.sdk-reveal').forEach((el) => revealObserver.observe(el));
+
+ // ── Copy-to-clipboard ────────────────────────────────────────────────────
document.querySelectorAll('.sdk-copy-btn').forEach((btn) => {
- btn.addEventListener('click', async () => {
+ btn.addEventListener('click', async (e) => {
+ e.stopPropagation();
const target = document.getElementById(btn.dataset.target);
if (!target) return;
const text = target.textContent;
@@ -21,7 +35,6 @@ document.addEventListener('DOMContentLoaded', () => {
btn.classList.remove('copied');
}, 2000);
} catch {
- // Fallback for environments that block clipboard
const sel = window.getSelection();
const range = document.createRange();
range.selectNodeContents(target);
@@ -31,10 +44,21 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
+ // Install command click-to-copy
+ const installCmd = document.querySelector('.sdk-install-cmd');
+ if (installCmd) {
+ const handler = () => installCmd.querySelector('.sdk-install-copy')?.click();
+ installCmd.addEventListener('click', handler);
+ installCmd.addEventListener('keydown', (e) => {
+ if (e.key === 'Enter' || e.key === ' ') handler();
+ });
+ }
+
// ── Tab switching ────────────────────────────────────────────────────────
document.querySelectorAll('.sdk-tabs').forEach((tabs) => {
const buttons = tabs.querySelectorAll('.sdk-tab-btn');
const panels = tabs.querySelectorAll('.sdk-tab-panel');
+ const copyRow = tabs.querySelector('.sdk-tab-copy-row .sdk-copy-btn');
buttons.forEach((btn, i) => {
btn.addEventListener('click', () => {
buttons.forEach((b, j) => {
@@ -44,10 +68,93 @@ document.addEventListener('DOMContentLoaded', () => {
panels.forEach((p, j) => {
p.hidden = j !== i;
});
+ if (copyRow && panels[i]) {
+ const pre = panels[i].querySelector('pre');
+ if (pre) copyRow.dataset.target = pre.id;
+ }
});
});
});
+ // ── Interactive Playground ───────────────────────────────────────────────
+ const pgViewer = document.getElementById('pg-viewer');
+ const pgAvatar = document.getElementById('pg-avatar');
+ const pgBg = document.getElementById('pg-bg');
+ const pgComponent = document.getElementById('pg-component');
+ const pgRotate = document.getElementById('pg-rotate');
+ const pgCodeOutput = document.getElementById('pg-code-output');
+ const pgCopyBtn = document.getElementById('pg-copy-btn');
+
+ function escapeHtml(str) {
+ return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
+ }
+
+ function updatePlayground() {
+ if (!pgViewer || !pgCodeOutput) return;
+
+ const avatarSrc = pgAvatar.value;
+ const bg = pgBg.value;
+ const component = pgComponent.value;
+ const rotate = pgRotate.classList.contains('active');
+
+ pgViewer.setAttribute('src', avatarSrc);
+ pgViewer.setAttribute('background', bg);
+
+ const isViewer = component === 'three-ws-viewer';
+ const importPath = isViewer ? '@three-ws/avatar/viewer' : '@three-ws/avatar';
+ const tagName = component;
+
+ const attrs = [];
+ attrs.push(` <span class="t-attr">src</span>=<span class="t-str">"${escapeHtml(avatarSrc)}"</span>`);
+ if (bg !== 'transparent') {
+ attrs.push(` <span class="t-attr">background</span>=<span class="t-str">"${escapeHtml(bg)}"</span>`);
+ }
+ attrs.push(` <span class="t-attr">alt</span>=<span class="t-str">"My avatar"</span>`);
+ if (rotate) {
+ attrs.push(` <span class="t-attr">auto-rotate</span>`);
+ }
+ attrs.push(` <span class="t-attr">style</span>=<span class="t-str">"width:400px;height:560px"</span>`);
+
+ const code = [
+ `<span class="t-tag">&lt;script</span> <span class="t-attr">type</span>=<span class="t-str">"module"</span><span class="t-tag">&gt;</span>`,
+ ` <span class="t-kw">import</span> <span class="t-str">'${importPath}'</span><span class="t-op">;</span>`,
+ `<span class="t-tag">&lt;/script&gt;</span>`,
+ ``,
+ `<span class="t-tag">&lt;${tagName}</span>`,
+ ...attrs,
+ `<span class="t-tag">&gt;&lt;/${tagName}&gt;</span>`,
+ ].join('\n');
+
+ pgCodeOutput.innerHTML = code;
+ }
+
+ if (pgAvatar) {
+ pgAvatar.addEventListener('change', updatePlayground);
+ pgBg.addEventListener('change', updatePlayground);
+ pgComponent.addEventListener('change', updatePlayground);
+ pgRotate.addEventListener('click', () => {
+ pgRotate.classList.toggle('active');
+ pgRotate.setAttribute('aria-checked', pgRotate.classList.contains('active'));
+ updatePlayground();
+ });
+ updatePlayground();
+ }
+
+ if (pgCopyBtn) {
+ pgCopyBtn.addEventListener('click', async () => {
+ const text = pgCodeOutput.textContent;
+ try {
+ await navigator.clipboard.writeText(text);
+ pgCopyBtn.textContent = 'Copied!';
+ pgCopyBtn.classList.add('copied');
+ setTimeout(() => {
+ pgCopyBtn.textContent = 'Copy code';
+ pgCopyBtn.classList.remove('copied');
+ }, 2000);
+ } catch {}
+ });
+ }
+
// ── Creator demo ─────────────────────────────────────────────────────────
const creatorBtn = document.getElementById('sdk-creator-open');
const creatorStatus = document.getElementById('sdk-creator-status');
@@ -78,14 +185,14 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
- // ── Hero viewer fallback message ─────────────────────────────────────────
+ // ── Hero viewer fallback ─────────────────────────────────────────────────
const heroViewer = document.querySelector('.sdk-hero-viewer three-ws-viewer');
if (heroViewer) {
heroViewer.addEventListener('error', () => {
const wrap = document.querySelector('.sdk-hero-viewer');
if (wrap) {
const msg = document.createElement('p');
- msg.className = 'sdk-viewer-err';
+ msg.style.cssText = 'text-align:center;color:var(--sdk-dim);font-size:13px;padding:24px';
msg.textContent = 'Avatar preview unavailable in this environment.';
wrap.appendChild(msg);
}
diff --git a/src/editorial-pretext.js b/src/editorial-pretext.js
new file mode 100644
index 000000000..8a37a5ef5
--- /dev/null
+++ b/src/editorial-pretext.js
@@ -0,0 +1,268 @@
+// Editorial pretext engine — canvas-measured text reflow around a draggable avatar obstacle
+(function initEditorial() {
+ var area = document.getElementById('editorial-text-area');
+ var orbEl = document.getElementById('editorial-orb');
+ var orbAvatarSlot = document.getElementById('editorial-orb-avatar');
+ if (!area || !orbEl) return;
+
+ var FONT = '17px Georgia,"Iowan Old Style","Palatino Linotype",Palatino,serif';
+ var LINE_H = 28;
+ var COL_GAP = 48;
+ var ORB_DIM = 150;
+ var ORB_R = ORB_DIM / 2;
+ var ORB_PAD = 28;
+ var MIN_SLOT = 60;
+ var DROP_SIZE = 72;
+ var DROP_LINES = 3;
+ var PARA_GAP = 0.6;
+
+ var COPY = [
+ 'The web was built for documents. Text, images, links — a flat canvas for static information. Then came video. Then interactivity. Then AI. But something fundamental was always missing: presence. Not a chatbot tucked into a corner. Not a popup demanding attention. A living digital being that inhabits your space, knows your visitors, and works while you sleep.',
+ 'three.ws gives your AI a body. A 3D character generated from a single photograph, deployed with two lines of HTML, monetized through micropayments that settle instantly. Every agent remembers across sessions, moves through multiplayer worlds, and earns revenue via the x402 payment protocol.',
+ 'This is not another widget. This is the layer where software has form, where interfaces have personality, where every website hosts a living intelligence that sees, hears, speaks, and transacts on your behalf. Two hundred animation clips. Real‑time voice. On‑chain identity. Cross‑device memory. Spatial multiplayer. All from one embed tag.',
+ 'The flat web had its moment. The living web starts now.'
+ ];
+
+ // Canvas-based text measurement (zero DOM reflows)
+ var mCtx = document.createElement('canvas').getContext('2d');
+ mCtx.font = FONT;
+ var spW = mCtx.measureText(' ').width;
+ function mw(t) { mCtx.font = FONT; return mCtx.measureText(t).width; }
+
+ // Build word list with paragraph-break markers
+ var words = [];
+ COPY.forEach(function(para, pi) {
+ para.split(/\s+/).filter(Boolean).forEach(function(w, wi, arr) {
+ words.push({ t: w, w: mw(w), pb: (wi === arr.length - 1 && pi < COPY.length - 1) });
+ });
+ });
+
+ // Extract drop cap
+ var dropChar = words[0].t[0];
+ var dropRest = words[0].t.slice(1);
+ if (dropRest) { words[0] = { t: dropRest, w: mw(dropRest), pb: words[0].pb }; }
+ else { words.shift(); }
+
+ mCtx.font = '700 ' + DROP_SIZE + 'px Georgia,"Iowan Old Style",Palatino,serif';
+ var dropW = mCtx.measureText(dropChar).width + 10;
+ var dropH = DROP_LINES * LINE_H;
+
+ var dropEl = document.createElement('span');
+ dropEl.className = 'ed-drop';
+ dropEl.textContent = dropChar;
+ dropEl.style.fontSize = DROP_SIZE + 'px';
+ dropEl.style.left = '0px';
+ dropEl.style.top = '0px';
+ area.appendChild(dropEl);
+
+ // Orb setup
+ orbEl.style.width = ORB_DIM + 'px';
+ orbEl.style.height = ORB_DIM + 'px';
+
+ var cW = 0, cH = 600;
+ var ox = 0, oy = 0, ovx = 18, ovy = 12;
+ var edDrag = false, dox = 0, doy = 0;
+ var edLastT = 0, edInView = false, edSelecting = false;
+ var edReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+ // Avatar thumbnail is loaded by the inline boot script into #editorial-orb-avatar
+
+ // Span pool — reuse DOM elements across frames
+ var linePool = [];
+ function edGetSpan(i) {
+ if (i < linePool.length) return linePool[i];
+ var s = document.createElement('span');
+ s.className = 'ed-line';
+ area.appendChild(s);
+ linePool.push(s);
+ return s;
+ }
+
+ // Circle-line chord intersection
+ function edChord(cx, cy, r, lt, lb) {
+ var my = (lt + lb) / 2, dy = Math.abs(my - cy);
+ if (dy >= r) return null;
+ var hc = Math.sqrt(r * r - dy * dy);
+ return { s: cx - hc, e: cx + hc };
+ }
+
+ // Subtract blocked intervals from a range, returning available slots
+ function edSubInt(s, e, bl) {
+ bl = bl.filter(function(b) { return b.e > s && b.s < e; }).sort(function(a, b) { return a.s - b.s; });
+ var slots = [], cur = s;
+ for (var i = 0; i < bl.length; i++) {
+ if (bl[i].s > cur) slots.push({ s: cur, e: Math.min(bl[i].s, e) });
+ cur = Math.max(cur, bl[i].e);
+ }
+ if (cur < e) slots.push({ s: cur, e: e });
+ return slots;
+ }
+
+ // Layout a single column: fill words top-to-bottom, flowing around obstacles
+ function edLayCol(si, cl, cr, sy, my, obs, dr) {
+ var lines = [], y = sy, wi = si, colW = cr - cl, pgap = false;
+ while (wi < words.length && y + LINE_H <= my) {
+ if (pgap) { y += LINE_H * PARA_GAP; pgap = false; if (y + LINE_H > my) break; }
+
+ var bl = [];
+ for (var oi = 0; oi < obs.length; oi++) {
+ var c = edChord(obs[oi].x, obs[oi].y, obs[oi].r, y, y + LINE_H);
+ if (c && c.e > cl && c.s < cr) {
+ bl.push({ s: Math.max(c.s - cl, 0), e: Math.min(c.e - cl, colW) });
+ }
+ }
+ if (dr && y < dr.b && y + LINE_H > dr.t && dr.r > cl && dr.l < cr) {
+ bl.push({ s: Math.max(dr.l - cl, 0), e: Math.min(dr.r - cl, colW) });
+ }
+
+ var slots = edSubInt(0, colW, bl);
+ for (var sj = 0; sj < slots.length; sj++) {
+ var sw = slots[sj].e - slots[sj].s;
+ if (sw < MIN_SLOT) continue;
+ var txt = '', lw = 0;
+ while (wi < words.length) {
+ var wd = words[wi];
+ var need = lw === 0 ? wd.w : spW + wd.w;
+ if (lw + need > sw && lw > 0) break;
+ txt += (lw === 0 ? '' : ' ') + wd.t;
+ lw += (lw === 0 ? 0 : spW) + wd.w;
+ wi++;
+ }
+ if (txt) lines.push({ t: txt, x: cl + slots[sj].s, y: y });
+ }
+ if (wi > 0 && words[wi - 1] && words[wi - 1].pb) pgap = true;
+ y += LINE_H;
+ }
+ return { lines: lines, nw: wi };
+ }
+
+ // Full layout: 2 columns on desktop, 1 on mobile, with cursor handoff
+ function edComputeLayout() {
+ cW = area.clientWidth;
+ var mob = cW < 720;
+ var colW = mob ? cW : (cW - COL_GAP) / 2;
+ var maxH = 1200;
+ var obs = [{ x: ox, y: oy, r: ORB_R + ORB_PAD }];
+ var dr = { l: 0, t: 0, r: dropW, b: dropH };
+ var all;
+
+ if (mob) {
+ var r1 = edLayCol(0, 0, colW, 0, maxH, obs, dr);
+ all = r1.lines;
+ cH = r1.lines.length ? r1.lines[r1.lines.length - 1].y + LINE_H + 40 : 480;
+ } else {
+ var c1 = edLayCol(0, 0, colW, 0, maxH, obs, dr);
+ var c2l = colW + COL_GAP;
+ var c2 = edLayCol(c1.nw, c2l, c2l + colW, 0, maxH, obs, null);
+ all = c1.lines.concat(c2.lines);
+ var h1 = c1.lines.length ? c1.lines[c1.lines.length - 1].y + LINE_H : 0;
+ var h2 = c2.lines.length ? c2.lines[c2.lines.length - 1].y + LINE_H : 0;
+ cH = Math.max(h1, h2, 480) + 40;
+ }
+ return all;
+ }
+
+ // Render with projection equality check — skip DOM writes when nothing changed
+ var edPrevProj = '';
+ function edRender(lines) {
+ var proj = '';
+ for (var i = 0; i < lines.length; i++) proj += lines[i].t + '|' + (lines[i].x | 0) + '|' + (lines[i].y | 0) + '\n';
+ if (proj === edPrevProj) return;
+ edPrevProj = proj;
+
+ var max = Math.max(lines.length, linePool.length);
+ for (var j = 0; j < max; j++) {
+ if (j < lines.length) {
+ var sp = edGetSpan(j);
+ sp.textContent = lines[j].t;
+ sp.style.left = lines[j].x + 'px';
+ sp.style.top = lines[j].y + 'px';
+ sp.style.display = '';
+ } else if (j < linePool.length) {
+ linePool[j].style.display = 'none';
+ }
+ }
+ area.style.height = cH + 'px';
+ }
+
+ // 60fps animation loop — physics + layout + render
+ function edTick(now) {
+ if (!edInView) { requestAnimationFrame(edTick); return; }
+ var dt = edLastT ? Math.min((now - edLastT) / 1000, 0.05) : 0.016;
+ edLastT = now;
+
+ if (!edDrag && !edReduced && !edSelecting) {
+ ox += ovx * dt;
+ oy += ovy * dt;
+ if (ox - ORB_R < 0) { ox = ORB_R; ovx = Math.abs(ovx); }
+ if (ox + ORB_R > cW) { ox = cW - ORB_R; ovx = -Math.abs(ovx); }
+ if (oy - ORB_R < 0) { oy = ORB_R; ovy = Math.abs(ovy); }
+ if (oy + ORB_R > cH - 20) { oy = cH - 20 - ORB_R; ovy = -Math.abs(ovy); }
+ }
+
+ orbEl.style.transform = 'translate(' + (ox - ORB_R) + 'px,' + (oy - ORB_R) + 'px)';
+ edRender(edComputeLayout());
+ requestAnimationFrame(edTick);
+ }
+
+ // Pause drift while user is selecting text
+ document.addEventListener('selectionchange', function() {
+ var sel = window.getSelection();
+ edSelecting = sel && sel.toString().length > 0 && area.contains(sel.anchorNode);
+ });
+
+ // Drag interaction
+ area.addEventListener('pointerdown', function(e) {
+ if (e.button !== 0) return;
+ var rect = area.getBoundingClientRect();
+ var px = e.clientX - rect.left, py = e.clientY - rect.top;
+ var dx = px - ox, dy = py - oy;
+ if (Math.sqrt(dx * dx + dy * dy) > ORB_R + 20) return;
+ edDrag = true; dox = dx; doy = dy;
+ orbEl.style.cursor = 'grabbing';
+ e.preventDefault();
+ });
+ window.addEventListener('pointermove', function(e) {
+ if (!edDrag) return;
+ var rect = area.getBoundingClientRect();
+ ox = Math.max(ORB_R, Math.min(cW - ORB_R, e.clientX - rect.left - dox));
+ oy = Math.max(ORB_R, Math.min(cH - ORB_R, e.clientY - rect.top - doy));
+ });
+ window.addEventListener('pointerup', function() {
+ if (!edDrag) return;
+ edDrag = false;
+ orbEl.style.cursor = '';
+ ovx = (Math.random() - 0.5) * 30;
+ ovy = (Math.random() - 0.5) * 20;
+ });
+
+ // Only animate when section is in viewport
+ var edIO = new IntersectionObserver(function(entries) {
+ edInView = entries[0].isIntersecting;
+ }, { threshold: 0, rootMargin: '200px' });
+ edIO.observe(area);
+
+ function edInitPos() {
+ cW = area.clientWidth;
+ cH = 600;
+ ox = cW * (cW < 720 ? 0.7 : 0.65);
+ oy = 180;
+ edRender(edComputeLayout());
+ }
+
+ requestAnimationFrame(function() {
+ edInitPos();
+ requestAnimationFrame(edTick);
+ });
+
+ var edResizeT;
+ window.addEventListener('resize', function() {
+ clearTimeout(edResizeT);
+ edResizeT = setTimeout(function() {
+ cW = area.clientWidth;
+ ox = Math.max(ORB_R, Math.min(cW - ORB_R, ox));
+ oy = Math.max(ORB_R, Math.min(cH - ORB_R, oy));
+ edRender(edComputeLayout());
+ }, 150);
+ });
+})();
diff --git a/src/nich-agent.js b/src/nich-agent.js
index aebe32044..d9ad23a47 100644
--- a/src/nich-agent.js
+++ b/src/nich-agent.js
@@ -338,12 +338,17 @@ export class NichAgent {
// ── Chat API ─────────────────────────────────────────────────────────────
async _callChatAPI(message) {
+ const bubble = this.options.thoughtBubble;
const messagesEl = this.panel.querySelector('#agent-messages');
const streamEl = document.createElement('div');
streamEl.className = 'nich-message agent';
streamEl.textContent = '…';
- messagesEl.appendChild(streamEl);
- messagesEl.scrollTop = messagesEl.scrollHeight;
+ if (bubble) {
+ bubble.showThinking();
+ } else {
+ messagesEl.appendChild(streamEl);
+ messagesEl.scrollTop = messagesEl.scrollHeight;
+ }
const choice = MODEL_OPTIONS.find((o) => o.id === this._modelChoice);
try {
@@ -409,10 +414,14 @@ export class NichAgent {
streaming = true;
}
streamEl.textContent += evt.text;
- messagesEl.scrollTop = messagesEl.scrollHeight;
+ if (bubble) {
+ bubble.showMessage(streamEl.textContent);
+ } else {
+ messagesEl.scrollTop = messagesEl.scrollHeight;
+ }
} else if (evt.type === 'done') {
- if (!streaming) streamEl.remove();
- return { ok: true, message, reply: evt.reply || '', actions: evt.actions || [], streamEl: streaming ? streamEl : null };
+ if (!streaming || bubble) streamEl.remove();
+ return { ok: true, message, reply: evt.reply || '', actions: evt.actions || [], streamEl: (streaming && !bubble) ? streamEl : null };
} else if (evt.type === 'error') {
streamEl.remove();
return { ok: false, reason: evt.code || 'upstream_error' };
@@ -584,6 +593,10 @@ export class NichAgent {
// ── Typing indicator ─────────────────────────────────────────────────────
_startTyping() {
+ if (this.options.thoughtBubble) {
+ this.options.thoughtBubble.showThinking();
+ return () => {};
+ }
const messagesEl = this.panel.querySelector('#agent-messages');
const el = document.createElement('div');
el.className = 'nich-message agent typing';
@@ -751,6 +764,10 @@ export class NichAgent {
if (role !== 'status') {
this.messages.push({ role, text });
}
+ if (role === 'agent' && type !== 'status' && this.options.thoughtBubble) {
+ this.options.thoughtBubble.showMessage(text);
+ return;
+ }
const messagesEl = this.panel.querySelector('#agent-messages');
const msgEl = document.createElement('div');
msgEl.className = `nich-message ${role}${type ? ' ' + type : ''}`;
diff --git a/src/thought-bubble.js b/src/thought-bubble.js
new file mode 100644
index 000000000..b4706e405
--- /dev/null
+++ b/src/thought-bubble.js
@@ -0,0 +1,99 @@
+import { Vector3 } from 'three';
+
+export class ThoughtBubble {
+ constructor(viewer) {
+ this.viewer = viewer;
+ this._visible = false;
+ this._hideTimer = null;
+ this._projVec = new Vector3();
+ this._build();
+ this._hookRenderLoop();
+ }
+
+ _build() {
+ this.el = document.createElement('div');
+ this.el.className = 'thought-bubble';
+ this._textEl = document.createElement('div');
+ this._textEl.className = 'thought-bubble__text';
+ this.el.appendChild(this._textEl);
+ this.viewer.el.appendChild(this.el);
+ }
+
+ _hookRenderLoop() {
+ if (!this.viewer._afterAnimateHooks) {
+ this.viewer._afterAnimateHooks = [];
+ }
+ this._tickFn = () => this._updatePosition();
+ this.viewer._afterAnimateHooks.push(this._tickFn);
+ }
+
+ _updatePosition() {
+ if (!this._visible) return;
+
+ const headPos = this.viewer.getHeadScreenPosition();
+ if (!headPos) {
+ this.el.style.opacity = '0';
+ return;
+ }
+
+ const scale = this._computeScale(headPos);
+ const offset = 28 * scale;
+
+ this.el.style.left = headPos.x + 'px';
+ this.el.style.top = (headPos.y - offset) + 'px';
+ this.el.style.transform = `translate(-50%, -100%) scale(${scale.toFixed(3)})`;
+ this.el.style.opacity = '';
+ }
+
+ _computeScale(headPos) {
+ const v = this.viewer;
+ if (!v.activeCamera || !v.renderer) return 1;
+
+ this._projVec.set(0, 0, 0);
+ this._projVec.project(v.activeCamera);
+ const canvas = v.renderer.domElement;
+ const feetY = (-this._projVec.y * 0.5 + 0.5) * canvas.clientHeight;
+
+ const screenHeight = Math.abs(feetY - headPos.y);
+ return Math.max(0.4, Math.min(1.4, screenHeight / 350));
+ }
+
+ showThinking() {
+ this._textEl.innerHTML =
+ '<span class="thought-bubble__dots">' +
+ '<span></span><span></span><span></span>' +
+ '</span>';
+ this._setVisible(true);
+ clearTimeout(this._hideTimer);
+ }
+
+ showMessage(text) {
+ this._textEl.textContent = text;
+ this._setVisible(true);
+
+ clearTimeout(this._hideTimer);
+ const readTime = Math.max(5000, Math.min(18000, text.length * 55));
+ this._hideTimer = setTimeout(() => this.hide(), readTime);
+ }
+
+ hide() {
+ clearTimeout(this._hideTimer);
+ this._setVisible(false);
+ }
+
+ _setVisible(visible) {
+ this._visible = visible;
+ this.el.classList.toggle('thought-bubble--visible', visible);
+ if (visible) this.viewer.invalidate();
+ }
+
+ dispose() {
+ clearTimeout(this._hideTimer);
+ this.el?.remove();
+ const hooks = this.viewer._afterAnimateHooks;
+ if (hooks) {
+ const idx = hooks.indexOf(this._tickFn);
+ if (idx > -1) hooks.splice(idx, 1);
+ }
+ }
+}
diff --git a/src/walk-embed-preview.js b/src/walk-embed-preview.js
new file mode 100644
index 000000000..8abe1f81b
--- /dev/null
+++ b/src/walk-embed-preview.js
@@ -0,0 +1,448 @@
+// Mini walk viewer for the home-next "Walk Embed" section.
+// Stripped-down version of walk.js: avatar + joystick + WASD + camera follow.
+// No multiplayer, AR, recording, chat, or HUD — just the interactive 3D demo.
+
+import {
+ AmbientLight,
+ CircleGeometry,
+ Clock,
+ Color,
+ DirectionalLight,
+ Group,
+ HemisphereLight,
+ Mesh,
+ MeshBasicMaterial,
+ MeshStandardMaterial,
+ CanvasTexture,
+ PCFSoftShadowMap,
+ PerspectiveCamera,
+ PlaneGeometry,
+ PMREMGenerator,
+ Quaternion,
+ Scene,
+ ShadowMaterial,
+ Vector3,
+ WebGLRenderer,
+} from 'three';
+import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
+import nipplejs from 'nipplejs';
+import { AnimationManager } from './animation-manager.js';
+
+const AVATAR_URL = '/avatars/default.glb';
+const ANIMATIONS_MANIFEST_URL = '/animations/manifest.json';
+const CLIP_IDLE = 'idle';
+const CLIP_WALK = 'av-walk-feminine';
+
+const WALK_SPEED = 1.6;
+const RUN_SPEED = 4.0;
+const NATURAL_WALK_SPEED = 1.5;
+const NATURAL_RUN_SPEED = 3.4;
+const TURN_LERP = 0.18;
+const CAM_LERP = 0.12;
+const LEAN_WALK_RAD = 0.05;
+const LEAN_RUN_RAD = 0.13;
+const LEAN_LERP = 0.12;
+const CAM_OFFSET = new Vector3(0, 1.85, 3.6);
+const CAM_LOOK_OFFSET = new Vector3(0, 1.1, 0);
+const GROUND_RADIUS = 8;
+const JUMP_VELOCITY = 5.0;
+const GRAVITY = -14;
+const GROUND_Y = 0;
+
+function lerpAngle(a, b, t) {
+ let d = ((b - a + Math.PI * 3) % (Math.PI * 2)) - Math.PI;
+ return a + d * t;
+}
+
+export function initWalkPreview(container) {
+ const canvas = container.querySelector('canvas');
+ const joystickEl = container.querySelector('[data-walk-joystick]');
+ if (!canvas || !joystickEl) return;
+
+ // ── Renderer ────────────────────────────────────────────────────
+ const renderer = new WebGLRenderer({ canvas, antialias: true, alpha: true });
+ renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
+ renderer.shadowMap.enabled = true;
+ renderer.shadowMap.type = PCFSoftShadowMap;
+
+ const scene = new Scene();
+ const pmrem = new PMREMGenerator(renderer);
+ scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
+
+ // Lights
+ const ambient = new AmbientLight(0xffffff, 0.55);
+ scene.add(ambient);
+ const hemi = new HemisphereLight(0xbcd6ff, 0x202830, 0.6);
+ hemi.position.set(0, 5, 0);
+ scene.add(hemi);
+ const sun = new DirectionalLight(0xffffff, 1.4);
+ sun.position.set(4, 8, 6);
+ sun.castShadow = true;
+ sun.shadow.mapSize.set(512, 512);
+ sun.shadow.camera.near = 0.5;
+ sun.shadow.camera.far = 30;
+ sun.shadow.camera.left = -8;
+ sun.shadow.camera.right = 8;
+ sun.shadow.camera.top = 8;
+ sun.shadow.camera.bottom = -8;
+ sun.shadow.bias = -0.0005;
+ scene.add(sun);
+ scene.add(sun.target);
+
+ // Ground
+ const ground = new Mesh(
+ new CircleGeometry(GROUND_RADIUS, 64),
+ new MeshStandardMaterial({ color: 0x202833, roughness: 0.95, metalness: 0.0 }),
+ );
+ ground.rotation.x = -Math.PI / 2;
+ ground.receiveShadow = true;
+ scene.add(ground);
+
+ // Blob shadow
+ const blobCanvas = document.createElement('canvas');
+ blobCanvas.width = 64;
+ blobCanvas.height = 64;
+ const bCtx = blobCanvas.getContext('2d');
+ const bGrad = bCtx.createRadialGradient(32, 32, 0, 32, 32, 32);
+ bGrad.addColorStop(0, 'rgba(0,0,0,0.68)');
+ bGrad.addColorStop(0.45, 'rgba(0,0,0,0.28)');
+ bGrad.addColorStop(1, 'rgba(0,0,0,0)');
+ bCtx.fillStyle = bGrad;
+ bCtx.fillRect(0, 0, 64, 64);
+ const blobShadow = new Mesh(
+ new PlaneGeometry(1.0, 1.0),
+ new MeshBasicMaterial({ map: new CanvasTexture(blobCanvas), transparent: true, depthWrite: false, opacity: 0 }),
+ );
+ blobShadow.rotation.x = -Math.PI / 2;
+ blobShadow.position.y = 0.004;
+ scene.add(blobShadow);
+
+ // Camera
+ const rect = container.getBoundingClientRect();
+ const camera = new PerspectiveCamera(50, rect.width / rect.height, 0.05, 200);
+ const avatarRig = new Group();
+ scene.add(avatarRig);
+
+ const camTarget = new Vector3();
+ const camLookTarget = new Vector3();
+ const camPosCurrent = new Vector3();
+ const camLookCurrent = new Vector3();
+ let cameraYaw = 0;
+ let cameraPitch = 0.15;
+
+ function applyCameraImmediate() {
+ const offset = CAM_OFFSET.clone();
+ offset.applyAxisAngle(new Vector3(0, 1, 0), cameraYaw);
+ offset.y += Math.sin(cameraPitch) * offset.length() * 0.3;
+ camTarget.copy(avatarRig.position).add(offset);
+ camLookTarget.copy(avatarRig.position).add(CAM_LOOK_OFFSET);
+ camPosCurrent.copy(camTarget);
+ camLookCurrent.copy(camLookTarget);
+ camera.position.copy(camPosCurrent);
+ camera.lookAt(camLookCurrent);
+ }
+ applyCameraImmediate();
+
+ // ── Input ───────────────────────────────────────────────────────
+ const input = {
+ joy: { x: 0, y: 0, active: false },
+ keys: { forward: 0, back: 0, left: 0, right: 0, run: false },
+ };
+
+ const joystick = nipplejs.create({
+ zone: joystickEl,
+ mode: 'static',
+ position: { left: '50%', top: '50%' },
+ size: 90,
+ color: 'rgba(255,255,255,0.85)',
+ restOpacity: 0.6,
+ });
+ joystick.on('move', (_evt, data) => {
+ if (data?.vector) {
+ const mag = Math.min(1, data.distance / 45);
+ input.joy.x = data.vector.x * mag;
+ input.joy.y = data.vector.y * mag;
+ input.joy.active = mag > 0.05;
+ }
+ });
+ joystick.on('end', () => {
+ input.joy.x = 0;
+ input.joy.y = 0;
+ input.joy.active = false;
+ });
+
+ // Keyboard — only when container is hovered or focused
+ let containerFocused = false;
+ container.setAttribute('tabindex', '0');
+ container.addEventListener('mouseenter', () => { containerFocused = true; });
+ container.addEventListener('mouseleave', () => {
+ containerFocused = false;
+ input.keys.forward = 0;
+ input.keys.back = 0;
+ input.keys.left = 0;
+ input.keys.right = 0;
+ input.keys.run = false;
+ });
+ container.addEventListener('focus', () => { containerFocused = true; });
+ container.addEventListener('blur', () => {
+ containerFocused = false;
+ input.keys.forward = 0;
+ input.keys.back = 0;
+ input.keys.left = 0;
+ input.keys.right = 0;
+ input.keys.run = false;
+ });
+
+ window.addEventListener('keydown', (e) => {
+ if (!containerFocused) return;
+ if (e.target?.tagName === 'INPUT' || e.target?.tagName === 'TEXTAREA') return;
+ switch (e.code) {
+ case 'KeyW': case 'ArrowUp': input.keys.forward = 1; e.preventDefault(); break;
+ case 'KeyS': case 'ArrowDown': input.keys.back = 1; e.preventDefault(); break;
+ case 'KeyA': case 'ArrowLeft': input.keys.left = 1; e.preventDefault(); break;
+ case 'KeyD': case 'ArrowRight': input.keys.right = 1; e.preventDefault(); break;
+ case 'ShiftLeft': case 'ShiftRight': input.keys.run = true; break;
+ case 'Space': e.preventDefault(); triggerJump(); break;
+ }
+ });
+ window.addEventListener('keyup', (e) => {
+ switch (e.code) {
+ case 'KeyW': case 'ArrowUp': input.keys.forward = 0; break;
+ case 'KeyS': case 'ArrowDown': input.keys.back = 0; break;
+ case 'KeyA': case 'ArrowLeft': input.keys.left = 0; break;
+ case 'KeyD': case 'ArrowRight': input.keys.right = 0; break;
+ case 'ShiftLeft': case 'ShiftRight': input.keys.run = false; break;
+ }
+ });
+
+ // Drag to orbit
+ let dragActive = false;
+ let dragStartX = 0, dragStartY = 0;
+ let yawAtDragStart = 0, pitchAtDragStart = 0;
+ canvas.addEventListener('pointerdown', (e) => {
+ dragActive = true;
+ dragStartX = e.clientX;
+ dragStartY = e.clientY;
+ yawAtDragStart = cameraYaw;
+ pitchAtDragStart = cameraPitch;
+ canvas.setPointerCapture(e.pointerId);
+ });
+ canvas.addEventListener('pointermove', (e) => {
+ if (!dragActive) return;
+ const dx = e.clientX - dragStartX;
+ const dy = e.clientY - dragStartY;
+ cameraYaw = yawAtDragStart + dx * 0.006;
+ cameraPitch = Math.max(-0.5, Math.min(0.8, pitchAtDragStart + dy * 0.004));
+ });
+ canvas.addEventListener('pointerup', () => { dragActive = false; });
+ canvas.addEventListener('pointercancel', () => { dragActive = false; });
+
+ // ── Jump ────────────────────────────────────────────────────────
+ let jumpActive = false;
+ let jumpVelocity = 0;
+ function triggerJump() {
+ if (jumpActive) return;
+ jumpActive = true;
+ jumpVelocity = JUMP_VELOCITY;
+ }
+
+ // ── Avatar ──────────────────────────────────────────────────────
+ const animationManager = new AnimationManager();
+ let avatar = null;
+ let avatarYaw = 0;
+ let avatarLean = 0;
+ let currentMotion = 'idle';
+
+ async function loadAvatar() {
+ const loader = new GLTFLoader();
+ const gltf = await loader.loadAsync(AVATAR_URL);
+ const model = gltf.scene;
+ model.traverse((c) => {
+ if (c.isMesh) {
+ c.castShadow = true;
+ c.receiveShadow = true;
+ }
+ });
+ avatarRig.add(model);
+ avatar = model;
+ blobShadow.material.opacity = 0.6;
+
+ animationManager.attach(model);
+ await animationManager.loadAll(ANIMATIONS_MANIFEST_URL);
+ animationManager.play(CLIP_IDLE);
+ applyCameraImmediate();
+
+ // Hide loading overlay
+ const loadingEl = container.querySelector('[data-walk-loading]');
+ if (loadingEl) {
+ loadingEl.classList.add('is-done');
+ loadingEl.addEventListener('transitionend', () => loadingEl.remove(), { once: true });
+ }
+ }
+
+ // ── Resize ──────────────────────────────────────────────────────
+ function resize() {
+ const r = container.getBoundingClientRect();
+ const w = r.width;
+ const h = r.height;
+ renderer.setSize(w, h, false);
+ camera.aspect = w / h;
+ camera.updateProjectionMatrix();
+ }
+ resize();
+ const ro = new ResizeObserver(resize);
+ ro.observe(container);
+
+ // ── Tick ─────────────────────────────────────────────────────────
+ const clock = new Clock();
+ const moveWorld = new Vector3();
+ const moveForward = new Vector3();
+ const moveRight = new Vector3();
+ const upY = new Vector3(0, 1, 0);
+ let running = true;
+
+ function tick() {
+ if (!running) return;
+ requestAnimationFrame(tick);
+
+ const dt = Math.min(clock.getDelta(), 0.05);
+
+ // Jump
+ if (jumpActive && avatar) {
+ jumpVelocity += GRAVITY * dt;
+ avatarRig.position.y += jumpVelocity * dt;
+ if (avatarRig.position.y <= GROUND_Y) {
+ avatarRig.position.y = GROUND_Y;
+ jumpVelocity = 0;
+ jumpActive = false;
+ }
+ }
+
+ // Input
+ let ix, iy;
+ if (input.joy.active) {
+ ix = input.joy.x;
+ iy = input.joy.y;
+ } else if (input.keys.forward || input.keys.back || input.keys.left || input.keys.right) {
+ ix = input.keys.right - input.keys.left;
+ iy = input.keys.forward - input.keys.back;
+ } else {
+ ix = 0;
+ iy = 0;
+ }
+ const mag = Math.min(1, Math.hypot(ix, iy));
+ const wantRun = mag > 0.9 || input.keys.run;
+ const speed = mag * (wantRun ? RUN_SPEED : WALK_SPEED);
+
+ if (mag > 0.01 && avatar) {
+ moveForward.copy(camLookCurrent).sub(camera.position);
+ moveForward.y = 0;
+ if (moveForward.lengthSq() < 1e-6) moveForward.set(0, 0, -1);
+ else moveForward.normalize();
+ moveRight.crossVectors(moveForward, upY).normalize();
+
+ moveWorld.set(0, 0, 0)
+ .addScaledVector(moveForward, iy / Math.max(mag, 1e-6))
+ .addScaledVector(moveRight, ix / Math.max(mag, 1e-6))
+ .normalize()
+ .multiplyScalar(speed * dt);
+
+ avatarRig.position.add(moveWorld);
+
+ // Clamp to ground disc
+ const r = Math.hypot(avatarRig.position.x, avatarRig.position.z);
+ const max = GROUND_RADIUS - 0.5;
+ if (r > max) {
+ const k = max / r;
+ avatarRig.position.x *= k;
+ avatarRig.position.z *= k;
+ }
+
+ const wantYaw = Math.atan2(moveWorld.x, moveWorld.z);
+ avatarYaw = lerpAngle(avatarYaw, wantYaw, TURN_LERP);
+ avatarRig.quaternion.setFromAxisAngle(upY, avatarYaw);
+
+ // Lean
+ const leanTarget = wantRun ? LEAN_RUN_RAD : LEAN_WALK_RAD;
+ avatarLean += (leanTarget - avatarLean) * LEAN_LERP;
+ } else {
+ avatarLean += (0 - avatarLean) * LEAN_LERP;
+ }
+
+ if (avatar) {
+ avatar.rotation.x = avatarLean;
+ }
+
+ // Animation crossfade
+ let wantMotion = 'idle';
+ if (mag > 0.01) wantMotion = wantRun ? 'run' : 'walk';
+ if (wantMotion !== currentMotion) {
+ currentMotion = wantMotion;
+ const clip = wantMotion === 'idle' ? CLIP_IDLE : CLIP_WALK;
+ animationManager.crossfadeTo(clip, 0.35);
+ }
+
+ // Animation speed sync
+ if (currentMotion !== 'idle' && animationManager.currentAction) {
+ const naturalSpeed = wantRun ? NATURAL_RUN_SPEED : NATURAL_WALK_SPEED;
+ animationManager.currentAction.timeScale = speed / naturalSpeed;
+ }
+
+ animationManager.mixer?.update(dt);
+
+ // Blob shadow follows avatar
+ blobShadow.position.x = avatarRig.position.x;
+ blobShadow.position.z = avatarRig.position.z;
+
+ // Sun follows avatar
+ sun.position.set(
+ avatarRig.position.x + 4,
+ 8,
+ avatarRig.position.z + 6,
+ );
+ sun.target.position.copy(avatarRig.position);
+
+ // Camera follow
+ const offset = CAM_OFFSET.clone();
+ offset.applyAxisAngle(upY, cameraYaw);
+ offset.y += Math.sin(cameraPitch) * offset.length() * 0.3;
+ camTarget.copy(avatarRig.position).add(offset);
+ camLookTarget.copy(avatarRig.position).add(CAM_LOOK_OFFSET);
+ camPosCurrent.lerp(camTarget, CAM_LERP);
+ camLookCurrent.lerp(camLookTarget, CAM_LERP);
+ camera.position.copy(camPosCurrent);
+ camera.lookAt(camLookCurrent);
+
+ renderer.render(scene, camera);
+ }
+
+ // ── Lazy init — only start when visible ─────────────────────────
+ let started = false;
+ const observer = new IntersectionObserver((entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting && !started) {
+ started = true;
+ loadAvatar().catch((err) => console.warn('[walk-preview] load failed', err));
+ tick();
+ observer.disconnect();
+ }
+ }
+ }, { threshold: 0.1 });
+ observer.observe(container);
+
+ // Pause rendering when off-screen
+ const visObserver = new IntersectionObserver((entries) => {
+ for (const entry of entries) {
+ if (!entry.isIntersecting && running) {
+ running = false;
+ clock.stop();
+ } else if (entry.isIntersecting && !running && started) {
+ running = true;
+ clock.start();
+ tick();
+ }
+ }
+ }, { threshold: 0 });
+ visObserver.observe(container);
+}
diff --git a/src/widgets/talking-agent.js b/src/widgets/talking-agent.js
index a8eeb47de..bdf84f23d 100644
--- a/src/widgets/talking-agent.js
+++ b/src/widgets/talking-agent.js
@@ -15,6 +15,7 @@
import { NichAgent } from '../nich-agent.js';
import { ACTION_TYPES } from '../agent-protocol.js';
+import { ThoughtBubble } from '../thought-bubble.js';
/**
* @param {import('../viewer.js').Viewer} viewer
@@ -45,6 +46,8 @@ export async function mountTalkingAgent(viewer, config, container, ctx) {
// conversation bucket the creator can browse independently
const ids = isPreview ? { visitorId: null, threadId: null } : ensureVisitorThread(widgetId);
+ const bubble = new ThoughtBubble(viewer);
+
const agent = new NichAgent(container, protocol, null, identity, null, {
layout: 'embedded',
position: config.chatPosition || 'right',
@@ -55,6 +58,7 @@ export async function mountTalkingAgent(viewer, config, container, ctx) {
voiceInput: config.voiceInput !== false,
voiceOutput: config.voiceOutput !== false,
skipDefaultListeners: true,
+ thoughtBubble: bubble,
onSend: async (text) => {
if (isPreview) {
return { reply: 'Preview mode — save your widget to enable live chat.' };
@@ -88,6 +92,7 @@ export async function mountTalkingAgent(viewer, config, container, ctx) {
if (destroyed) return;
destroyed = true;
try {
+ bubble.dispose();
agent.panel?.remove();
agent.toggleBtn?.remove();
} catch {}
diff --git a/vercel.json b/vercel.json
index 24cfef503..55b643167 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1920,6 +1920,10 @@
"src": "/discover/a/(\\d+)/(\\d+)",
"dest": "/api/discover-detail?kind=onchain&chain=$1&id=$2"
},
+ {
+ "src": "/discover/a/sol/([A-Za-z0-9]+)",
+ "dest": "/api/discover-detail?kind=solana&asset=$1"
+ },
{
"src": "/discover/avatar/([^/]+)",
"status": 301,
diff --git a/verify-color-picker.mjs b/verify-color-picker.mjs
new file mode 100644
index 000000000..132493c5f
--- /dev/null
+++ b/verify-color-picker.mjs
@@ -0,0 +1,139 @@
+import { chromium } from 'playwright';
+
+const browser = await chromium.launch({ headless: true });
+const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
+
+console.log('--- Step 1: Navigate and scroll to Playground ---');
+await page.goto('http://localhost:3000/pages/home-next.html', { waitUntil: 'domcontentloaded', timeout: 15000 });
+await page.waitForTimeout(1500);
+
+// Scroll to the embed/playground section
+await page.locator('#embed').scrollIntoViewIfNeeded({ timeout: 5000 });
+await page.waitForTimeout(500);
+await page.screenshot({ path: '/tmp/ss-01-playground.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-01-playground.png');
+
+console.log('--- Step 2: Find the BG control group and color trigger ---');
+const colorTrigger = page.locator('#pg-color-trigger');
+const triggerVisible = await colorTrigger.isVisible();
+console.log('Color trigger visible:', triggerVisible);
+
+// Get its bounding box
+const triggerBox = await colorTrigger.boundingBox();
+console.log('Trigger bounding box:', triggerBox);
+
+// Scroll to it
+await colorTrigger.scrollIntoViewIfNeeded();
+await page.waitForTimeout(300);
+await page.screenshot({ path: '/tmp/ss-02-bg-controls.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-02-bg-controls.png');
+
+console.log('--- Step 3: Click the color trigger to open popover ---');
+await colorTrigger.click();
+await page.waitForTimeout(300);
+
+const popover = page.locator('#pg-color-popover');
+const popoverOpen = await popover.evaluate(el => el.classList.contains('open'));
+console.log('Popover open after click:', popoverOpen);
+const popoverVisible = await popover.isVisible();
+console.log('Popover visible:', popoverVisible);
+
+await page.screenshot({ path: '/tmp/ss-03-popover-open.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-03-popover-open.png');
+
+// Check swatches are rendered
+const swatchCount = await page.locator('.pg-color-swatch').count();
+console.log('Number of color swatches:', swatchCount);
+
+// Check hex input exists
+const hexInput = page.locator('#pg-color-hex');
+const hexVisible = await hexInput.isVisible();
+console.log('Hex input visible:', hexVisible);
+
+console.log('--- Step 4: Click a swatch to pick a color ---');
+const thirdSwatch = page.locator('.pg-color-swatch').nth(4); // #e94560 (a red)
+const swatchColor = await thirdSwatch.getAttribute('data-color');
+console.log('Picking swatch color:', swatchColor);
+await thirdSwatch.click();
+await page.waitForTimeout(300);
+
+// Check state: trigger should have 'active' and 'has-color' classes
+const triggerHasActive = await colorTrigger.evaluate(el => el.classList.contains('active'));
+const triggerHasColor = await colorTrigger.evaluate(el => el.classList.contains('has-color'));
+console.log('Trigger active:', triggerHasActive, '| has-color:', triggerHasColor);
+
+// Check hex input value
+const hexVal = await hexInput.inputValue();
+console.log('Hex input value:', hexVal);
+
+// Check BG preset chips are deselected
+const activeBgChips = await page.locator('#pg-bg-chips .pg-chip.active').count();
+console.log('Active BG preset chips after picking custom color:', activeBgChips);
+
+// Check the swatch has active class
+const swatchActive = await thirdSwatch.evaluate(el => el.classList.contains('active'));
+console.log('Clicked swatch has active class:', swatchActive);
+
+// Check the generated code includes background attribute
+const codeText = await page.locator('#pg-textarea').inputValue();
+console.log('Code includes background attr:', codeText.includes('background="' + swatchColor + '"'));
+
+await page.screenshot({ path: '/tmp/ss-04-color-picked.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-04-color-picked.png');
+
+console.log('--- Step 5: Click outside to close popover ---');
+await page.mouse.click(100, 100);
+await page.waitForTimeout(300);
+const popoverOpenAfterClick = await popover.evaluate(el => el.classList.contains('open'));
+console.log('Popover still open after clicking outside:', popoverOpenAfterClick);
+await page.screenshot({ path: '/tmp/ss-05-popover-closed.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-05-popover-closed.png');
+
+console.log('--- Step 6: Click "none" preset chip to reset color picker ---');
+await page.locator('#pg-color-trigger').scrollIntoViewIfNeeded();
+await page.waitForTimeout(200);
+const noneChip = page.locator('#pg-bg-chips .pg-chip').first();
+await noneChip.click();
+await page.waitForTimeout(300);
+
+const triggerStillActive = await colorTrigger.evaluate(el => el.classList.contains('active'));
+const triggerStillHasColor = await colorTrigger.evaluate(el => el.classList.contains('has-color'));
+console.log('Trigger active after "none" click:', triggerStillActive, '| has-color:', triggerStillHasColor);
+
+const noneChipActive = await noneChip.evaluate(el => el.classList.contains('active'));
+console.log('"none" chip is active:', noneChipActive);
+
+const codeAfterReset = await page.locator('#pg-textarea').inputValue();
+console.log('Code still has background attr after reset:', codeAfterReset.includes('background='));
+
+await page.screenshot({ path: '/tmp/ss-06-reset.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-06-reset.png');
+
+console.log('--- Step 7: Probe - type hex value directly ---');
+await colorTrigger.scrollIntoViewIfNeeded();
+await colorTrigger.click();
+await page.waitForTimeout(300);
+const hexInputField = page.locator('#pg-color-hex');
+await hexInputField.fill('#00ff88');
+await page.waitForTimeout(300);
+
+const triggerAfterHex = await colorTrigger.evaluate(el => el.classList.contains('active'));
+console.log('Trigger active after typing hex:', triggerAfterHex);
+
+const codeAfterHex = await page.locator('#pg-textarea').inputValue();
+console.log('Code includes typed hex:', codeAfterHex.includes('#00ff88'));
+
+await page.screenshot({ path: '/tmp/ss-07-hex-typed.png', fullPage: false });
+console.log('Screenshot: /tmp/ss-07-hex-typed.png');
+
+console.log('--- Step 8: Probe - Enter key in hex input closes popover ---');
+await hexInputField.fill('#ff00aa');
+await hexInputField.press('Enter');
+await page.waitForTimeout(300);
+const popoverAfterEnter = await popover.evaluate(el => el.classList.contains('open'));
+console.log('Popover closed after Enter:', !popoverAfterEnter);
+await page.screenshot({ path: '/tmp/ss-08-enter-close.png', fullPage: false });
+
+console.log('\n=== All Steps Complete ===');
+
+await browser.close();
diff --git a/verify-walk-preview.mjs b/verify-walk-preview.mjs
new file mode 100644
index 000000000..e4a8f8107
--- /dev/null
+++ b/verify-walk-preview.mjs
@@ -0,0 +1,58 @@
+import { chromium } from 'playwright';
+
+(async () => {
+ const browser = await chromium.launch({
+ args: ['--no-sandbox', '--disable-gpu', '--disable-software-rasterizer'],
+ });
+ const context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
+ // Block heavy external scripts to avoid OOM
+ await context.route('**/agent-3d/**', route => route.abort());
+
+ const page = await context.newPage();
+
+ const consoleErrors = [];
+ page.on('console', msg => {
+ if (msg.type() === 'error') consoleErrors.push(msg.text());
+ });
+ page.on('pageerror', err => consoleErrors.push(`PAGE ERROR: ${err.message}`));
+
+ await page.goto('http://localhost:3002/home-next', { waitUntil: 'domcontentloaded', timeout: 30000 });
+ await page.waitForTimeout(3000);
+ console.log('Page loaded. URL:', page.url());
+
+ const container = await page.waitForSelector('#walk-preview-container', { timeout: 5000 }).catch(() => null);
+ console.log(`Container found: ${!!container}`);
+
+ if (!container) {
+ await page.screenshot({ path: '/tmp/walk-debug.png' });
+ console.log('FAIL: no container. Debug screenshot at /tmp/walk-debug.png');
+ await browser.close();
+ return;
+ }
+
+ await container.scrollIntoViewIfNeeded();
+ await page.waitForTimeout(1000);
+ await page.screenshot({ path: '/tmp/walk-preview-loading.png' });
+ console.log('Loading screenshot saved.');
+
+ // Wait for avatar to load (Three.js scene)
+ const loaded = await page.waitForSelector('[data-walk-loading].is-done', { timeout: 25000 }).catch(() => null);
+ console.log(`Avatar loaded: ${!!loaded}`);
+
+ await page.waitForTimeout(3000);
+ await page.screenshot({ path: '/tmp/walk-preview-loaded.png' });
+ console.log('Loaded screenshot saved.');
+
+ const hint = await page.locator('.walk-preview-hint').isVisible().catch(() => false);
+ const code = await page.locator('#walk-preview-container .bento-code').isVisible().catch(() => false);
+ const canvas = await page.locator('.walk-preview-canvas').boundingBox().catch(() => null);
+ console.log(`Hint: ${hint}, Code: ${code}, Canvas: ${JSON.stringify(canvas)}`);
+
+ const walkErrors = consoleErrors.filter(e => e.toLowerCase().includes('walk') || e.toLowerCase().includes('nipple'));
+ console.log(`Walk-related errors: ${walkErrors.length}`);
+ walkErrors.forEach(e => console.log(` ${e.substring(0, 200)}`));
+ console.log(`Total console errors: ${consoleErrors.length}`);
+
+ await browser.close();
+ console.log('Done.');
+})();
diff --git a/vite.config.js b/vite.config.js
index e82daa41a..5566ddc0e 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -47,6 +47,11 @@ function discoverDashboardNextInputs() {
const appConfig = {
server: {
proxy: {
+ '/r2-proxy': {
+ target: 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev',
+ changeOrigin: true,
+ rewrite: (path) => path.replace(/^\/r2-proxy/, ''),
+ },
'/ingest/static': {
target: 'https://us-assets.i.posthog.com',
changeOrigin: true,
@@ -922,6 +927,31 @@ const appConfig = {
cpSync(src, resolve(__dirname, 'dist/avatar-studio'), { recursive: true });
},
},
+ {
+ // Rewrite R2 public-bucket URLs in proxied /api/avatars/* responses so
+ // the <agent-3d> component (loaded from CDN) always receives /r2-proxy/*
+ // URLs instead of raw r2.dev URLs that fail CORS in Codespaces / localhost.
+ name: 'r2-url-rewrite-api',
+ configureServer(server) {
+ const R2_PUBLIC_RE = /https?:\/\/pub-[a-f0-9]+\.r2\.dev\//g;
+ server.middlewares.use(async (req, res, next) => {
+ if (!req.url?.startsWith('/api/avatars/')) return next();
+ try {
+ const upstream = new URL(req.url, DEV_API_PROXY);
+ const resp = await fetch(upstream.href, {
+ headers: { accept: 'application/json' },
+ });
+ const text = await resp.text();
+ const rewritten = text.replace(R2_PUBLIC_RE, '/r2-proxy/');
+ res.statusCode = resp.status;
+ res.setHeader('content-type', resp.headers.get('content-type') || 'application/json');
+ res.end(rewritten);
+ } catch (err) {
+ next();
+ }
+ });
+ },
+ },
{
// Serve `/api/widgets/wdgt_demo_*` from the local fixture file in dev.
// Without this, those requests fall through to the `/api` proxy and hit