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.

fix: update SQL query calls to use the new sql function

nirholas21bf24a338d9
diff --git a/.env.example b/.env.example
index 3e96bf45b..1332b8566 100644
--- a/.env.example
+++ b/.env.example
@@ -9,13 +9,13 @@ PUBLIC_APP_ORIGIN=https://3dagent.vercel.app
# Postgres (Neon serverless driver — HTTPS connection string)
DATABASE_URL=postgres://user:[email protected]/neondb?sslmode=require
-# Cloudflare R2 (S3-compatible)
-R2_ACCOUNT_ID=
-R2_ACCESS_KEY_ID=
-R2_SECRET_ACCESS_KEY=
-R2_BUCKET=3d-agent-avatars
-# Public CDN base URL for R2 bucket (custom domain or r2.dev)
-R2_PUBLIC_BASE=https://cdn.3d.irish
+# S3-compatible storage (AWS S3, Cloudflare R2, Backblaze B2, etc.)
+S3_ENDPOINT=
+S3_ACCESS_KEY_ID=
+S3_SECRET_ACCESS_KEY=
+S3_BUCKET=3d-agent-avatars
+# Public CDN base URL for the bucket (custom domain or provider default)
+S3_PUBLIC_DOMAIN=https://cdn.3d.irish
# Upstash Redis (rate limiting)
UPSTASH_REDIS_REST_URL=
diff --git a/api/_lib/avatars.js b/api/_lib/avatars.js
index 59dac7c75..50f0c0ef4 100644
--- a/api/_lib/avatars.js
+++ b/api/_lib/avatars.js
@@ -12,7 +12,7 @@ export async function listAvatars({ userId, limit = 50, cursor, visibility, incl
if (visibility) { params.push(visibility); conds.push(`visibility = $${params.length}`); }
if (cursor) { params.push(new Date(cursor)); conds.push(`created_at < $${params.length}`); }
params.push(limit + 1);
- const rows = await sql.query(
+ const rows = await sql(
`select id, owner_id, slug, name, description, storage_key, thumbnail_key, size_bytes,
content_type, source, visibility, tags, version, created_at, updated_at
from avatars where ${conds.join(' and ')}
@@ -113,7 +113,7 @@ export async function searchPublicAvatars({ q, tag, limit = 24, cursor }) {
if (tag) { params.push(tag); conds.push(`$${params.length} = any(tags)`); }
if (cursor) { params.push(new Date(cursor)); conds.push(`created_at < $${params.length}`); }
params.push(limit + 1);
- const rows = await sql.query(
+ const rows = await sql(
`select id, owner_id, slug, name, description, storage_key, thumbnail_key, size_bytes,
content_type, source, visibility, tags, created_at
from avatars where ${conds.join(' and ')}
diff --git a/api/_lib/env.js b/api/_lib/env.js
index f3413164e..2a5818845 100644
--- a/api/_lib/env.js
+++ b/api/_lib/env.js
@@ -21,11 +21,11 @@ export const env = {
get DATABASE_URL() { return req('DATABASE_URL'); },
- get R2_ACCOUNT_ID() { return req('R2_ACCOUNT_ID'); },
- get R2_ACCESS_KEY_ID() { return req('R2_ACCESS_KEY_ID'); },
- get R2_SECRET_ACCESS_KEY() { return req('R2_SECRET_ACCESS_KEY'); },
- get R2_BUCKET() { return req('R2_BUCKET'); },
- get R2_PUBLIC_BASE() { return trimSlash(req('R2_PUBLIC_BASE')); },
+ get S3_ENDPOINT() { return trimSlash(req('S3_ENDPOINT')); },
+ get S3_ACCESS_KEY_ID() { return req('S3_ACCESS_KEY_ID'); },
+ get S3_SECRET_ACCESS_KEY() { return req('S3_SECRET_ACCESS_KEY'); },
+ get S3_BUCKET() { return req('S3_BUCKET'); },
+ get S3_PUBLIC_DOMAIN() { return trimSlash(req('S3_PUBLIC_DOMAIN')); },
get UPSTASH_REDIS_REST_URL() { return opt('UPSTASH_REDIS_REST_URL'); },
get UPSTASH_REDIS_REST_TOKEN(){ return opt('UPSTASH_REDIS_REST_TOKEN'); },
diff --git a/api/_lib/r2.js b/api/_lib/r2.js
index 4d5197fc8..66f8f8eb5 100644
--- a/api/_lib/r2.js
+++ b/api/_lib/r2.js
@@ -1,20 +1,20 @@
-// Cloudflare R2 client (S3-compatible). Zero-egress storage for GLBs.
+// S3-compatible storage client (works with AWS S3, Cloudflare R2, Backblaze B2, etc.)
import { S3Client, PutObjectCommand, GetObjectCommand, DeleteObjectCommand, HeadObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { env } from './env.js';
// Lazy client — S3Client constructor reads env credentials eagerly, so defer
-// until first use to keep this module importable without R2 configured.
+// until first use to keep this module importable without storage configured.
let _r2;
function getR2() {
if (!_r2) {
_r2 = new S3Client({
region: 'auto',
- endpoint: `https://${env.R2_ACCOUNT_ID}.r2.cloudflarestorage.com`,
+ endpoint: env.S3_ENDPOINT,
credentials: {
- accessKeyId: env.R2_ACCESS_KEY_ID,
- secretAccessKey: env.R2_SECRET_ACCESS_KEY,
+ accessKeyId: env.S3_ACCESS_KEY_ID,
+ secretAccessKey: env.S3_SECRET_ACCESS_KEY,
},
});
}
@@ -27,7 +27,7 @@ export const r2 = new Proxy({}, {
// Short-lived signed URL for direct browser upload (PUT).
export async function presignUpload({ key, contentType, contentLength, checksumSha256 }) {
const cmd = new PutObjectCommand({
- Bucket: env.R2_BUCKET,
+ Bucket: env.S3_BUCKET,
Key: key,
ContentType: contentType,
ContentLength: contentLength,
@@ -38,13 +38,13 @@ export async function presignUpload({ key, contentType, contentLength, checksumS
// Signed URL for GET (used for private avatars or temporary shares).
export async function presignGet({ key, expiresIn = 600 }) {
- const cmd = new GetObjectCommand({ Bucket: env.R2_BUCKET, Key: key });
+ const cmd = new GetObjectCommand({ Bucket: env.S3_BUCKET, Key: key });
return getSignedUrl(r2, cmd, { expiresIn });
}
export async function headObject(key) {
try {
- return await r2.send(new HeadObjectCommand({ Bucket: env.R2_BUCKET, Key: key }));
+ return await r2.send(new HeadObjectCommand({ Bucket: env.S3_BUCKET, Key: key }));
} catch (err) {
if (err?.$metadata?.httpStatusCode === 404) return null;
throw err;
@@ -52,12 +52,12 @@ export async function headObject(key) {
}
export async function deleteObject(key) {
- await r2.send(new DeleteObjectCommand({ Bucket: env.R2_BUCKET, Key: key }));
+ await r2.send(new DeleteObjectCommand({ Bucket: env.S3_BUCKET, Key: key }));
}
// Public CDN URL for objects served via R2 custom domain / r2.dev.
export function publicUrl(key) {
- return `${env.R2_PUBLIC_BASE}/${encodeR2Key(key)}`;
+ return `${env.S3_PUBLIC_DOMAIN}/${encodeR2Key(key)}`;
}
function encodeR2Key(key) {
diff --git a/api/agent-actions.js b/api/agent-actions.js
index 9a7d209f1..595c53742 100644
--- a/api/agent-actions.js
+++ b/api/agent-actions.js
@@ -87,7 +87,7 @@ async function handleAppend(req, res) {
VALUES (
${body.agent_id},
${String(body.type).slice(0, 64)},
- ${sql.json(body.payload || {})},
+ ${JSON.stringify(body.payload || {})}::jsonb,
${body.source_skill || null},
${body.signature || null},
${body.signer_address || null}
diff --git a/api/agent-memory.js b/api/agent-memory.js
index c9533f48e..427e63ef4 100644
--- a/api/agent-memory.js
+++ b/api/agent-memory.js
@@ -109,7 +109,7 @@ async function handleUpsert(req, res) {
${memType},
${String(entry.content || '').slice(0, 10000)},
${entry.tags || []},
- ${sql.json(entry.context || {})},
+ ${JSON.stringify(entry.context || {})}::jsonb,
${entry.salience || 0.5},
${entry.createdAt ? new Date(entry.createdAt).toISOString() : new Date().toISOString()},
${entry.expiresAt ? new Date(entry.expiresAt).toISOString() : null}
@@ -128,7 +128,7 @@ async function handleUpsert(req, res) {
${memType},
${String(entry.content || '').slice(0, 10000)},
${entry.tags || []},
- ${sql.json(entry.context || {})},
+ ${JSON.stringify(entry.context || {})}::jsonb,
${entry.salience || 0.5},
${entry.expiresAt ? new Date(entry.expiresAt).toISOString() : null}
)
diff --git a/api/agents.js b/api/agents.js
index e0b430f55..c86e7f8ae 100644
--- a/api/agents.js
+++ b/api/agents.js
@@ -72,7 +72,7 @@ async function handleGetOrCreateMe(req, res, auth) {
${'Agent'},
${['greet', 'present-model', 'validate-model', 'remember', 'think']},
${wallet.address},
- ${sql.json({ encrypted_wallet_key: wallet.encrypted_key })}
+ ${JSON.stringify({ encrypted_wallet_key: wallet.encrypted_key })}::jsonb
)
RETURNING *
`;
@@ -115,7 +115,7 @@ async function handleCreate(req, res) {
${body.description ? String(body.description).slice(0, 500) : null},
${body.skills || ['greet', 'present-model', 'validate-model', 'remember', 'think']},
${wallet.address},
- ${sql.json(meta)}
+ ${JSON.stringify(meta)}::jsonb
)
RETURNING *
`;
@@ -170,7 +170,7 @@ async function handleUpdate(req, res, id, auth) {
description = COALESCE(${body.description || null}, description),
avatar_id = COALESCE(${body.avatar_id || null}, avatar_id),
skills = COALESCE(${body.skills || null}, skills),
- meta = COALESCE(${body.meta ? sql.json(body.meta) : null}, meta),
+ meta = COALESCE(${body.meta ? JSON.stringify(body.meta) : null}::jsonb, meta),
home_url = COALESCE(${body.home_url || null}, home_url)
WHERE id = ${id}
RETURNING *
diff --git a/api/agents/[id]/embed-policy.js b/api/agents/[id]/embed-policy.js
index 7f2b95e3c..4ef07d819 100644
--- a/api/agents/[id]/embed-policy.js
+++ b/api/agents/[id]/embed-policy.js
@@ -66,7 +66,7 @@ export default wrap(async (req, res) => {
const policy = parse(policySchema, await readJson(req));
const [updated] = await sql`
UPDATE agent_identities
- SET embed_policy = ${sql.json(policy)}
+ SET embed_policy = ${JSON.stringify(policy)}::jsonb
WHERE id = ${id}
RETURNING embed_policy
`;
diff --git a/api/erc8004/pin.js b/api/erc8004/pin.js
index dc14bc20d..25b972543 100644
--- a/api/erc8004/pin.js
+++ b/api/erc8004/pin.js
@@ -32,7 +32,7 @@ export default wrap(async (req, res) => {
const key = `erc8004/${Date.now()}-${Math.random().toString(36).slice(2)}.${ext}`;
await r2.send(new PutObjectCommand({
- Bucket: env.R2_BUCKET,
+ Bucket: env.S3_BUCKET,
Key: key,
Body: body,
ContentType: ct,
diff --git a/api/usage/summary.js b/api/usage/summary.js
index ba77736f7..3650910d6 100644
--- a/api/usage/summary.js
+++ b/api/usage/summary.js
@@ -27,6 +27,7 @@ export default wrap(async (req, res) => {
const [plan] = await sql`
select q.* from users u join plan_quotas q on q.plan = u.plan where u.id = ${userId}
`;
+ if (!plan) return error(res, 500, 'internal', 'plan quota record missing for user');
return json(res, 200, {
plan,
counts: {
diff --git a/api/widgets/[id]/stats.js b/api/widgets/[id]/stats.js
index c218a8ff5..b826631c4 100644
--- a/api/widgets/[id]/stats.js
+++ b/api/widgets/[id]/stats.js
@@ -92,7 +92,7 @@ async function recentViewsByDay(id) {
async function topAggregates(id, column) {
try {
- const rows = await sql.query(
+ const rows = await sql(
`select coalesce(${column}, '') as key, count(*)::bigint as count
from widget_views
where widget_id = $1 and ${column} is not null
diff --git a/api/widgets/oembed.js b/api/widgets/oembed.js
index e5802583d..8ca8016bc 100644
--- a/api/widgets/oembed.js
+++ b/api/widgets/oembed.js
@@ -90,7 +90,7 @@ async function loadWidget(id) {
const [row] = await sql`
select id, name, type, avatar_id
from widgets
- where id = ${id}
+ where id = ${id} and is_public = true and deleted_at is null
limit 1
`;
return row || null;
diff --git a/api/widgets/og.js b/api/widgets/og.js
index 5fb8470f8..e6b3d0063 100644
--- a/api/widgets/og.js
+++ b/api/widgets/og.js
@@ -57,7 +57,7 @@ async function loadWidget(id) {
const [row] = await sql`
select id, name, type, avatar_id
from widgets
- where id = ${id}
+ where id = ${id} and is_public = true and deleted_at is null
limit 1
`;
return row || null;
diff --git a/api/widgets/page.js b/api/widgets/page.js
index fb20f63ef..68a91c15e 100644
--- a/api/widgets/page.js
+++ b/api/widgets/page.js
@@ -51,7 +51,7 @@ async function loadWidget(id) {
const [row] = await sql`
select id, name, type, avatar_id
from widgets
- where id = ${id}
+ where id = ${id} and is_public = true and deleted_at is null
limit 1
`;
return row || null;
diff --git a/create.html b/create.html
new file mode 100644
index 000000000..aad4d01df
--- /dev/null
+++ b/create.html
@@ -0,0 +1,154 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>Create avatar · 3D Agent</title>
+ <link rel="icon" href="/favicon.ico" />
+ <meta name="description" content="Create a 3D avatar from a selfie. Use your camera or upload photos." />
+ <meta name="robots" content="noindex" />
+ <style>
+ :root { color-scheme: dark; --accent:#d6ff3d; --accent-ink:#0a0a0a; --bg:#05060a; --panel:#0f1018; --border:#1e1f2b; --text:#eee; --muted:#8a8d98; }
+ * { box-sizing: border-box; }
+ html, body { margin:0; padding:0; height:100%; }
+ body { font: 15px/1.55 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; color:var(--text); background:var(--bg); min-height:100vh; overflow-x:hidden; }
+ body::before {
+ content:''; position:fixed; inset:0; z-index:-1; pointer-events:none;
+ background:
+ radial-gradient(800px 500px at 50% -100px, rgba(106,92,255,.12) 0, transparent 70%),
+ radial-gradient(600px 400px at 50% 110%, rgba(214,255,61,.05) 0, transparent 70%),
+ #05060a;
+ }
+ header.topbar {
+ display:flex; align-items:center; justify-content:space-between;
+ padding:18px 28px; border-bottom:1px solid var(--border);
+ }
+ .back {
+ display:inline-flex; align-items:center; gap:6px; color:var(--muted);
+ text-decoration:none; font-size:14px; padding:6px 10px; border-radius:8px;
+ transition: background .15s, color .15s;
+ }
+ .back:hover { background:rgba(255,255,255,.04); color:var(--text); }
+ .brand { font-weight:600; letter-spacing:-.01em; font-size:15px; }
+ .brand a { color:var(--text); text-decoration:none; }
+ .spacer { width:72px; }
+
+ main.stage {
+ max-width:1100px; margin:0 auto; padding:48px 24px 80px;
+ }
+ .heading { display:flex; align-items:center; justify-content:center; gap:10px; margin:8px 0 48px; }
+ .heading h1 { font-size:22px; font-weight:500; margin:0; letter-spacing:-.01em; }
+ .heading svg { width:22px; height:22px; color:var(--muted); }
+
+ .choice-grid {
+ display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
+ gap:22px; max-width:820px; margin:0 auto;
+ }
+ .choice {
+ position:relative; display:flex; flex-direction:column; justify-content:flex-end;
+ aspect-ratio: 3/4; padding:24px; border-radius:22px; overflow:hidden;
+ background:var(--panel); border:1px solid var(--border); cursor:pointer;
+ text-align:left; color:inherit; font:inherit;
+ transition: transform .18s ease, border-color .18s, box-shadow .18s;
+ }
+ .choice:hover { transform: translateY(-2px); border-color:#2c2d3d; box-shadow:0 12px 32px rgba(0,0,0,.4); }
+ .choice:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
+ .choice .illustration {
+ position:absolute; inset:0; display:grid; place-items:center;
+ background:linear-gradient(180deg, rgba(20,22,34,0) 0%, rgba(5,6,10,.6) 75%, rgba(5,6,10,.92) 100%);
+ }
+ .choice .illustration svg { width:60%; max-width:220px; opacity:.85; color:#cfd2e0; }
+ .choice .label {
+ position:relative; display:flex; align-items:flex-end; justify-content:space-between;
+ gap:12px; z-index:1;
+ }
+ .choice .label h2 { margin:0; font-size:22px; font-weight:500; letter-spacing:-.01em; line-height:1.15; }
+ .choice .arrow {
+ flex:0 0 auto; width:44px; height:44px; border-radius:50%;
+ background:#f5f5f5; color:#0a0a0a;
+ display:grid; place-items:center;
+ transition: transform .18s ease, background .18s;
+ }
+ .choice:hover .arrow { transform: translateX(4px); background:var(--accent); }
+ .choice[data-method="upload"] .illustration {
+ background:linear-gradient(180deg, rgba(20,22,34,0) 40%, rgba(5,6,10,.6) 75%, rgba(5,6,10,.92) 100%);
+ }
+
+ .hidden-input { display:none; }
+
+ .unsupported {
+ margin-top:16px; padding:8px 12px; border-radius:8px;
+ background:rgba(255,92,92,.08); border:1px solid rgba(255,92,92,.3);
+ color:#ffb3b3; font-size:12px; text-align:center; display:none;
+ }
+ .unsupported.show { display:block; }
+
+ @media (max-width: 560px) {
+ main.stage { padding:24px 16px 64px; }
+ .heading h1 { font-size:18px; }
+ .choice { aspect-ratio: 4/5; padding:20px; border-radius:18px; }
+ .choice .label h2 { font-size:18px; }
+ }
+ </style>
+</head>
+<body>
+ <header class="topbar">
+ <a class="back" href="/" aria-label="Back">
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>
+ <span>Back</span>
+ </a>
+ <div class="brand"><a href="/">3D Agent</a></div>
+ <div class="spacer" aria-hidden="true"></div>
+ </header>
+
+ <main class="stage">
+ <div class="heading">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7V5a1 1 0 0 1 1-1h2"/><path d="M4 17v2a1 1 0 0 0 1 1h2"/><path d="M20 7V5a1 1 0 0 0-1-1h-2"/><path d="M20 17v2a1 1 0 0 1-1 1h-2"/><circle cx="12" cy="12" r="3"/></svg>
+ <h1>Create new avatar</h1>
+ </div>
+
+ <div class="choice-grid" role="group" aria-label="Choose avatar input method">
+ <button type="button" class="choice" data-method="camera" aria-label="Use camera to capture selfies">
+ <div class="illustration" aria-hidden="true">
+ <svg viewBox="0 0 160 200" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
+ <circle cx="80" cy="72" r="34" fill="rgba(255,255,255,.04)" />
+ <path d="M28 180c0-28 23-46 52-46s52 18 52 46" fill="rgba(255,255,255,.04)" />
+ <path d="M24 40 L24 52 M32 40 L40 40" />
+ <path d="M136 40 L136 52 M128 40 L120 40" />
+ <path d="M24 160 L24 148 M32 160 L40 160" />
+ <path d="M136 160 L136 148 M128 160 L120 160" />
+ </svg>
+ </div>
+ <div class="label">
+ <h2>Use<br/>camera</h2>
+ <span class="arrow" aria-hidden="true">
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>
+ </span>
+ </div>
+ </button>
+
+ <button type="button" class="choice" data-method="upload" aria-label="Upload photos from device">
+ <div class="illustration" aria-hidden="true">
+ <svg viewBox="0 0 160 200" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
+ <rect x="28" y="52" width="60" height="88" rx="6" fill="rgba(255,255,255,.04)" transform="rotate(-8 58 96)" />
+ <rect x="50" y="34" width="60" height="88" rx="6" fill="rgba(255,255,255,.06)" stroke-dasharray="4 4" />
+ <rect x="72" y="52" width="60" height="88" rx="6" fill="rgba(255,255,255,.04)" transform="rotate(8 102 96)" />
+ </svg>
+ </div>
+ <div class="label">
+ <h2>Upload<br/>from device</h2>
+ <span class="arrow" aria-hidden="true">
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>
+ </span>
+ </div>
+ </button>
+ </div>
+
+ <p class="unsupported" id="unsupported-msg">Camera not available on this device — use the upload option instead.</p>
+ </main>
+
+ <input type="file" id="upload-input" class="hidden-input" accept="image/jpeg,image/png" multiple />
+
+ <script type="module" src="/src/selfie-capture.js"></script>
+</body>
+</html>
diff --git a/docs/avaturn-docs.md b/docs/avaturn-docs.md
new file mode 100644
index 000000000..26858cd1d
--- /dev/null
+++ b/docs/avaturn-docs.md
@@ -0,0 +1,369 @@
+# Avaturn Documentation (scraped 2026-04-16)
+
+Source: https://docs.avaturn.me/docs/what-is-avaturn/
+
+---
+
+## 1. Getting Started
+
+**URL:** https://docs.avaturn.me/docs/what-is-avaturn/
+
+Avaturn is a realistic avatar creator and avatar system for games, apps and metaverses. The platform enables developers to delegate avatar generation and customization responsibilities while focusing on their core game experience.
+
+The service allows users to design avatars with customizable elements including body shape, clothing, accessories, hairstyles, footwear, and eyewear. Upon completion, users receive a compiled ready-to-use 3D model that can replace existing characters.
+
+Avaturn supports integration across multiple platforms: Unity, Unreal Engine, HTML + JavaScript (including Three.js), Android, and iOS. The platform offers free integration access via tutorials, with advanced customization available through an API and web SDK accessible through the developer portal.
+
+Users can register at developer.avaturn.me to begin using Avaturn at no cost with no limits on the number of avatars created or number of exports.
+
+---
+
+## 2. Importing
+
+### 2.1 Blender
+
+**URL:** https://docs.avaturn.me/docs/importing/blender/
+
+Straightforward instructions for importing Avaturn avatars into Blender, leveraging the software's native support for GLTF 2.0 format.
+
+Three-Step Import Process:
+1. Initiate Import: Access Blender's import function to load your GLB file
+2. Configure Settings: When the import dialog appears, set the bone direction parameter to "Blender" before finalizing the import process
+3. Completion: Your avatar assets are now ready for use within your Blender project
+
+If the imported avatar appears gray or you're uncertain whether textures have loaded correctly, click a visualization button to verify texture rendering. The process is streamlined due to Blender's robust compatibility with industry-standard GLTF 2.0 specifications.
+
+### 2.2 Unity
+
+**URL:** https://docs.avaturn.me/docs/importing/unity/
+
+Avaturn exports avatars in GLB format, which Unity doesn't natively support. The documentation recommends using the "GLTFast" package to load GLB files either during editing or while the application runs.
+
+Key Recommendations:
+- Apply an environment map to prevent metallic clothing from appearing black
+- GLTFast version 5.2 was tested, though other versions should work
+
+Alternative Approach (Not Recommended): Users can alternatively convert GLB files to FBX format using Avaturn's conversion tool, then import the FBX directly into Unity. However, this method requires additional manual work—specifically importing metalness maps and adjusting material smoothness settings. This approach is less ideal than using GLTFast.
+
+### 2.3 Unreal Engine
+
+**URL:** https://docs.avaturn.me/docs/importing/unreal/
+
+Two distinct import processes depending on your Unreal Engine version.
+
+For UE 5.1 and newer: The procedure is streamlined since these versions natively support GLB files. Users simply need to drag and drop it onto the content manager to complete the import.
+
+For UE 5.0 and earlier: Since native GLB support is unavailable, the workflow requires additional steps:
+1. Download a GLB avatar from Avaturn
+2. Convert the file to FBX format using Avaturn's dedicated converter tool, ensuring "Unreal" is selected in the converter settings
+3. Import the FBX into the content browser with specific settings:
+ - Normals import method set to "Import Normals"
+ - Import uniform scale at 100.0 (adjustable based on asset scale)
+ - Enable "Invert normal maps"
+4. Finalize the process, with occasional manual transparency corrections needed for eyewear elements
+
+### 2.4 Meta Spark Studio
+
+**URL:** https://docs.avaturn.me/docs/importing/spark_studio/
+
+Brief documentation page with reference to a video tutorial contributed by Max Gomes demonstrating the import process for importing avatars into Meta's Spark Studio.
+
+### 2.5 Convert GLB to FBX
+
+**URL:** https://docs.avaturn.me/docs/importing/glb-to-fbx/
+
+Avaturn exports 3D avatars in GLTF 2.0 format to ensure compatibility across different engines. For legacy workflows that require FBX files, Avaturn provides a conversion tool that outputs FBX files with separate texture maps, though materials may require manual adjustment.
+
+Why GLTF 2.0 is Preferred:
+- Open standard developed by the Khronos Group (versus Autodesk's proprietary FBX)
+- JSON-based structure for readability and easier debugging
+- Optimized for real-time rendering in web and VR applications
+- Built-in support for Physically-Based Rendering (PBR) materials
+- Better interoperability across engines and platforms
+- Smaller file sizes with improved compression
+- Extensible architecture for custom metadata
+
+Engine-Specific Guidance:
+- Unity: Strongly recommends using GLTFast package to load GLB directly, avoiding conversion
+- Unreal Engine: Versions 5.1+ support native GLB importing. Older versions requiring FBX need specific import settings: Import Normals method, 100.0 uniform scale, and inverted normal maps enabled
+
+### 2.6 Convert GLB to VRM
+
+**URL:** https://docs.avaturn.me/docs/importing/glb-to-vrm/
+
+Avaturn exports in GLTF 2.0 format to ensure the 3D model looks well in every engine that uses it. VR applications and VTubing software utilize the VRM file format for humanoid avatar data, which is built upon glTF 2.0. This means VRM-compatible software can open glTF 2.0 files, but the reverse compatibility does not apply.
+
+### 2.7 Mixamo Animations
+
+**URL:** https://docs.avaturn.me/docs/importing/mixamo/
+
+While Avaturn exports models in GLB format, Mixamo cannot directly read this format. Converting GLB to FBX may cause issues, so the guide recommends an alternative approach:
+
+Recommended Process:
+1. Download a pre-tested Avaturn avatar in FBX format from their assets
+2. Import that model into Mixamo and select desired animations
+3. Export the animated avatar, choosing "without skin" for Blender or "with skin" for Unity
+4. Apply the animation to your avatar
+
+The key insight is that instead of converting your exported avatar, users should work with a Mixamo-compatible FBX template provided by Avaturn, then transfer the animations to their actual avatar model.
+
+---
+
+## 3. Integration
+
+### 3.1 Overview
+
+**URL:** https://docs.avaturn.me/docs/integration/overview/
+
+Avaturn functions as an integrable plugin for applications, games, and metaverse platforms. The workflow is straightforward: users trigger an avatar configurator within a game, customize their avatar, and the game then receives the completed avatar file.
+
+Available SDKs and Integration Options:
+- Unity integration
+- Unreal Engine support
+- HTML and JavaScript implementation
+- Three.js framework support
+- Android mobile development
+- iOS mobile development
+
+Basic integration follows published tutorials at no cost. Developers seeking advanced customization features can access enhanced tools through the API and web SDK, which require registration at the developer portal.
+
+### 3.2 Avatar and Body Types
+
+**URL:** https://docs.avaturn.me/docs/integration/bodies/
+
+Avatar Types:
+- **T1 Avatars:** Static faces that provide the most realistic avatar. Cannot use face bones or blendshapes for facial animation.
+- **T2 Avatars:** Feature separate eyeballs and mouthhole structures, enabling facial animation through ARKit blendshapes and visemes. Slightly reduced recognizability compared to T1 models.
+
+Body Shape Types: Two body presets are available: v2023 and v2024.
+- **v2023:** The original body design iteration with unique skeletons per body shape that vary significantly from each other.
+- **v2024:** An improved version with nearly identical skeletons across body shapes. "Skeletons are identical everywhere, but have a bit of stretch/compression of the shoulder joints. Legs, arm length, head bone is the same!" This design makes animation work easier while maintaining shape variety.
+
+Both versions come in Female and Male configurations.
+
+### 3.3 Web Integration - HTML
+
+**URL:** https://docs.avaturn.me/docs/integration/web/html/
+
+Instructions for integrating the Avaturn avatar creation tool into web applications.
+
+Quick Start:
+1. Add a div element with the ID `avaturn-sdk-container` to your HTML markup.
+2. Include a module script that imports the AvaturnSDK from a CDN. Initialize the SDK with your custom subdomain and set up an event listener for the export event.
+
+Key Configuration Details:
+- **Subdomain Setup:** Create a project and obtain your own subdomain through developer.avaturn.me rather than using the limited "demo" subdomain.
+- **Export Callback:** The SDK triggers an "export" event when users click the "Next" button, returning the generated avatar data for processing.
+- **Styling Options:** CSS can be applied to the container element, with optional custom class names for the internal iframe.
+
+Additional Resources: Complete SDK reference guide, plain HTML CodeSandbox example, React component examples, and package manager installation via npm (`@avaturn/sdk`).
+
+### 3.4 Web Integration - Three.js
+
+**URL:** https://docs.avaturn.me/docs/integration/web/threejs/
+
+Integration overview for using Avaturn with Three.js. The platform functions by opening an iframe through which users can create avatars, which are then sent as GLB files to the Three.js app for rendering using GLTFLoader.
+
+Developers are directed to a starter project available on GitHub at the `avaturn-threejs-example` repository. The documentation specifically mentions the `initAvaturn` function, which requires customization.
+
+Required Configuration: Replace the demo subdomain with your own, created through the developer portal at developer.avaturn.me.
+
+### 3.5 Web SDK - Introduction
+
+**URL:** https://docs.avaturn.me/docs/integration/web/sdk/introduction/
+
+Key Features:
+- Receive callbacks on user actions (garment change, body change, export)
+- Customize the list of assets available for a particular user
+- Create custom UI for the avatar editor through programmatic asset switching
+
+Prerequisites and Installation:
+- Create a project at the developer portal and activate API access
+- Install via npm: `npm install @avaturn/sdk`
+
+Basic Implementation: Obtain a session link from the `/v1/sessions/new` API endpoint and initialize the SDK. Pass a DOM container to `sdk.init(...)`, which handles iframe creation. Optional parameters include custom CSS class names for the iframe.
+
+**Important:** "Avaturn web SDK only works in conjunction with Avaturn API and is only available in the paid package."
+
+### 3.6 Web SDK - Using Callbacks
+
+**URL:** https://docs.avaturn.me/docs/integration/web/sdk/callbacks/
+
+The Avaturn Web SDK enables developers to implement callbacks that respond to user interactions:
+- Asset changed
+- Body changed
+- Avatar exported
+
+Implementation: Obtain a URL using the `/v1/sessions/new` API request, then pass it to the SDK initialization function.
+
+```js
+const scene = await sdk.init(container, {
+ url: '<URL_RETURNED_BY_AVATURN_API>',
+ iframeClassName: '<CSS_CLASS_NAME_FOR_IFRAME>',
+ disableUi: false,
+});
+```
+
+After initialization, attach event listeners using the `.on()` method to execute custom actions based on user interactions.
+
+### 3.7 Web SDK - Implementing Custom UI
+
+**URL:** https://docs.avaturn.me/docs/integration/web/sdk/custom-ui/
+
+To disable Avaturn's default interface, pass `disableUi=true` to the initialization function.
+
+Once disabled, the SDK provides access to asset and body data through specific methods. Developers can retrieve available options by calling methods that return lists of bodies and assets when the system is ready. Activate specific asset or body using dedicated setter functions that accept an ID parameter.
+
+**Important Limitation:** In custom UI mode, developers will only receive the `'load'` callback event. Other callback functions that normally fire during user interactions will not trigger when using `disableUi` mode.
+
+### 3.8 Unity Integration
+
+**URL:** https://docs.avaturn.me/docs/integration/unity/
+
+Supported Platforms: WebGL and Android/iOS integrations. Windows/Mac Standalone apps possible but require contacting the company directly.
+
+Available Resources:
+- Integration tutorial explaining how to add Avaturn to games
+- SDK and sample code available on GitHub, supporting Android, iOS, and WebGL
+- WebGL demo showcasing runtime avatar replacement
+- WebGL demo featuring a third-person controller implementation
+
+### 3.9 Unreal Engine Integration
+
+**URL:** https://docs.avaturn.me/docs/integration/unreal/
+
+Introduction to Avaturn integration for Unreal Engine 5.0 and later. Two SDK options:
+1. Web-view based SDK — a browser-integrated approach
+2. Native SDK — a direct integration method (newer)
+
+As of June 2023 (version 2.0), supports T1 avatars (static head) and T2 avatars (blendshapes for facial animation). September 2023 update (v2.1) added skeletons for animation retargeting.
+
+### 3.10 Unreal Engine - Webview SDK
+
+**URL:** https://docs.avaturn.me/docs/integration/unreal/webview-sdk/
+
+The Avaturn Unreal SDK enables integration of Avaturn avatars into Unreal Engine 5.0+. Capabilities include importing previously created avatars from the web platform and developing/editing avatars directly within UE-based applications.
+
+Key Resources: Google Drive folder containing the SDK, demo project source code, and compiled builds for Windows and Android.
+
+The framework builds upon the Ready Player Me Unreal framework. Copy necessary files from the downloaded demo project into your own projects.
+
+Troubleshooting:
+- Material loading failures in packaged builds: solved via cooking plugin directories
+- Multiplayer functionality requiring proper httpURL configuration in developer settings
+
+### 3.11 Android Integration
+
+**URL:** https://docs.avaturn.me/docs/integration/mobile/android/
+
+"Avaturn operates through native WebView, no extra libraries are required."
+
+Example project: https://github.com/avaturn/avaturn-android-example
+
+Modify `MainActivity.java` to replace the demo domain with your own project subdomain or API-provided link.
+
+### 3.12 iOS Integration
+
+**URL:** https://docs.avaturn.me/docs/integration/mobile/ios/
+
+Integration for native Swift iOS applications. Operates through a native WebView without requiring additional libraries.
+
+Example project: https://github.com/avaturn/ios-example
+
+Update the URL initialization in `WebViewController.swift` from the demo domain to your own project URL.
+
+### 3.13 API - Introduction
+
+**URL:** https://docs.avaturn.me/docs/integration/api/introduction/
+
+Key Capabilities:
+- Integrate Avaturn while bypassing the sign-in interface (use your own authentication method)
+- Customize user workflows
+- Upload selfies directly rather than requiring users to scan through the UI
+- Implement custom interfaces using the web SDK with event callbacks
+- Generate avatar images for profile pictures
+- Utilize native SDKs for Unreal and Unity
+
+Getting Started:
+1. Create a project at the developer portal
+2. Generate an API authentication token
+3. Maintain a paid subscription plan — **the API is not available on the free plan**
+
+---
+
+## 4. UX Customization
+
+### 4.1 Overview
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/overview/
+
+"Avaturn can be easily customized and extended with additional content."
+
+Key Features:
+- Upload personalized looks and accessories
+- Adjust UI color schemes
+- Modify the avatar's environment setting
+- Incorporate branded logos
+
+Getting Started: Create a project through the developer portal at developer.avaturn.me.
+
+### 4.2 Custom Assets - Getting Started
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/assets/intro/
+
+Creating custom assets is straightforward: "just grab one of our template avatars and create an asset to look good on it." Developers don't need separate versions for different body types — the platform automatically adjusts assets across all body variations.
+
+Avatar Resources: Two downloadable template avatars — male body template and female body template, both in T-pose. Can switch to A-pose temporarily for simulation purposes before reverting to T-pose.
+
+"You don't want pose-related wrinkles to be baked into the garment."
+
+### 4.3 Custom Assets - Clothing
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/assets/clothing/
+
+Key Requirements:
+- Create an alpha mask for the avatar to hide parts covered by clothing (prevents visibility issues from deformations)
+- Asset must share the same skeleton as the avatar with correct skinning weights (manual painting recommended)
+- The mesh and avatar require proper alignment with identity global transforms
+- Assets should be created at the same location as the avatar without moving it
+
+Uploading: Access the developer portal's asset management panel, select the clothing tab, and upload both avatar and asset files in `.glb` format. Processing takes approximately 30 seconds. Verify the asset functions properly across all avatar body types before saving.
+
+### 4.4 Custom Assets - Footwear
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/assets/footwear/
+
+Pipeline is the same as for clothing. Key distinction: footwear textures are compressed to 512 pixels by default, whereas clothing textures use 1024 pixels.
+
+### 4.5 Custom Assets - Eyewear
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/assets/eyewear/
+
+Guidelines:
+- "The lower polycount the better" for mesh optimization
+- Glasses typically consist of two parts: frame and lens
+- Lens uses translucent material; frame uses another material type
+
+Recoloring: The system recognizes a mesh portion as recolorable if its material name **starts with** `lens`.
+
+### 4.6 Custom Assets - Hair
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/assets/hair/
+
+Haircap: An additional texture applied to the back of the head to minimize visual artifacts from transparent hair textures. Especially useful for hairstyles exposing head skin (bald, mohawk styles).
+
+Recoloring: The recoloring mechanism "maps grayscale diffuse texture into the user-selected color." Darker gray values produce darker shades; lighter grays yield lighter colors. Can be toggled during asset upload.
+
+Hats: Design hats independently of hair by following the clothing pipeline and defining an alpha map.
+
+Mixing Hair with Hats: To prevent recoloring on accessories, include **no_ramp** in the accessory mesh's material name. Alternatively, disable recoloring entirely during upload.
+
+### 4.7 Custom Assets - General Guidelines
+
+**URL:** https://docs.avaturn.me/docs/ux_customization/assets/general_guidelines/
+
+Technical Specifications:
+
+- **Polygon Count:** No more than 7k triangles for the look (top + bottom) to ensure compatibility with older devices and slower connections.
+- **Materials:** GLTF 2.0 format with PBR material pipelines. Supported maps: diffuse, normals, occlusion, roughness, metalness. Use a single opaque material (or alpha-clipped), with an optional separate alpha blend material.
+- **Texture Resolution:** 1K resolution recommended; lower resolutions are preferable. Higher resolutions (2K/4K) may cause noticeable loading delays in browsers due to network bandwidth, CPU-to-GPU data transfer, and real-time shader compilation constraints.
diff --git a/home.css b/home.css
new file mode 100644
index 000000000..04ae4dbd6
--- /dev/null
+++ b/home.css
@@ -0,0 +1,854 @@
+/* ── Home page marketing styles ── */
+
+.home-page {
+ overflow-y: auto;
+ overflow-x: hidden;
+ height: 100%;
+ scroll-behavior: smooth;
+}
+
+.home-main {
+ width: 100%;
+}
+
+/* ── Nav ── */
+
+.home-nav {
+ margin-left: auto;
+ display: flex;
+ align-items: center;
+ gap: var(--space-lg);
+ -webkit-app-region: no-drag;
+}
+
+.home-nav a {
+ color: rgba(255, 255, 255, 0.4);
+ text-decoration: none;
+ font-size: var(--text-sm);
+ font-weight: 400;
+ letter-spacing: 0.04em;
+ transition: color 0.2s ease;
+}
+
+.home-nav a:hover {
+ color: #fff;
+}
+
+.home-nav .nav-cta {
+ padding: 0.42rem 1.1rem;
+ background: #fff;
+ color: #000;
+ border-radius: var(--radius-lg);
+ font-weight: 500;
+ font-size: var(--text-sm);
+ transition: background 0.2s ease, transform 0.2s ease;
+}
+
+.home-nav .nav-cta:hover {
+ background: rgba(255, 255, 255, 0.88);
+ color: #000;
+ transform: translateY(-1px);
+}
+
+/* ── Scroll reveal ── */
+
+.h-reveal {
+ opacity: 0;
+ transform: translateY(20px);
+ transition:
+ opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
+ transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
+}
+
+.h-reveal.revealed {
+ opacity: 1;
+ transform: translateY(0);
+}
+
+/* ── Hero ── */
+
+.h-hero {
+ position: relative;
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
+ align-items: center;
+ gap: var(--space-2xl);
+ min-height: 100vh;
+ max-width: 1280px;
+ margin: 0 auto;
+ padding: calc(var(--space-2xl) + 2rem) var(--space-lg) var(--space-2xl);
+ overflow: hidden;
+ isolation: isolate;
+}
+
+.h-hero-bg {
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ z-index: 0;
+ overflow: hidden;
+}
+
+.h-hero-grid {
+ position: absolute;
+ inset: -1px;
+ background-image:
+ linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
+ linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
+ background-size: 64px 64px;
+ mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
+ -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
+}
+
+.h-hero-mesh {
+ position: absolute;
+ inset: -20%;
+ background:
+ radial-gradient(40% 50% at 72% 38%, rgba(255, 200, 60, 0.13) 0%, transparent 60%),
+ radial-gradient(35% 45% at 20% 72%, rgba(80, 200, 255, 0.08) 0%, transparent 65%),
+ radial-gradient(55% 40% at 50% 100%, rgba(120, 80, 255, 0.05) 0%, transparent 60%);
+ filter: blur(40px);
+ animation: hMeshDrift 20s ease-in-out infinite alternate;
+}
+
+@keyframes hMeshDrift {
+ 0% { transform: translate3d(0, 0, 0) scale(1); }
+ 50% { transform: translate3d(-2%, 1.5%, 0) scale(1.04); }
+ 100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
+}
+
+.h-hero-glow-a {
+ position: absolute;
+ width: 700px;
+ height: 700px;
+ border-radius: 50%;
+ background: radial-gradient(circle, rgba(255, 200, 60, 0.11) 0%, transparent 65%);
+ top: 38%;
+ right: -6%;
+ transform: translateY(-50%);
+ filter: blur(18px);
+ animation: hBreath 6s ease-in-out infinite;
+}
+
+.h-hero-glow-b {
+ position: absolute;
+ width: 400px;
+ height: 400px;
+ border-radius: 50%;
+ background: radial-gradient(circle, rgba(80, 220, 255, 0.07) 0%, transparent 65%);
+ bottom: -8%;
+ left: -2%;
+ filter: blur(18px);
+ animation: hBreathB 9s ease-in-out infinite;
+}
+
+@keyframes hBreath {
+ 0%, 100% { opacity: 0.85; transform: translateY(-50%) scale(1); }
+ 50% { opacity: 1; transform: translateY(-50%) scale(1.06); }
+}
+
+@keyframes hBreathB {
+ 0%, 100% { opacity: 0.7; transform: scale(1); }
+ 50% { opacity: 1; transform: scale(1.09); }
+}
+
+/* ── Hero content ── */
+
+.h-hero-content {
+ position: relative;
+ z-index: 2;
+}
+
+.h-eyebrow {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-sm);
+ padding: 0.38rem 0.9rem;
+ background: rgba(255, 255, 255, 0.035);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 999px;
+ font-size: 0.68rem;
+ color: rgba(255, 255, 255, 0.6);
+ letter-spacing: 0.09em;
+ text-transform: uppercase;
+ margin-bottom: var(--space-lg);
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+ font-family: 'JetBrains Mono', monospace;
+}
+
+.h-eyebrow-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: #4ade80;
+ box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
+ animation: hDotPulse 2.4s ease-out infinite;
+}
+
+@keyframes hDotPulse {
+ 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
+ 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
+ 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
+}
+
+.h-title {
+ font-size: clamp(2.8rem, 7vw, 5.2rem);
+ font-weight: 600;
+ color: #fff;
+ line-height: 1.03;
+ margin: 0 0 var(--space-lg);
+ letter-spacing: -0.035em;
+}
+
+.h-title em {
+ font-style: normal;
+ background: linear-gradient(100deg, #ffd76a 0%, #ffb347 35%, #7df9ff 75%, #9d8cff 100%);
+ background-size: 200% 100%;
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+ animation: hTitleShimmer 9s ease-in-out infinite;
+}
+
+@keyframes hTitleShimmer {
+ 0%, 100% { background-position: 0% 50%; }
+ 50% { background-position: 100% 50%; }
+}
+
+.h-subtitle {
+ font-size: clamp(1rem, 1.3vw, 1.2rem);
+ color: rgba(255, 255, 255, 0.52);
+ font-weight: 300;
+ line-height: 1.55;
+ max-width: 30em;
+ margin: 0 0 var(--space-xl);
+}
+
+.h-cta-row {
+ display: flex;
+ gap: var(--space-md);
+ flex-wrap: wrap;
+ margin-bottom: var(--space-xl);
+}
+
+.h-btn-primary {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5em;
+ padding: 0.7rem 1.6rem;
+ background: #fff;
+ color: #000;
+ font-size: var(--text-sm);
+ font-weight: 500;
+ border-radius: var(--radius-lg);
+ text-decoration: none;
+ letter-spacing: 0.02em;
+ transition: all 0.25s ease;
+}
+
+.h-btn-primary:hover {
+ background: rgba(255, 255, 255, 0.88);
+ transform: translateY(-1px);
+ box-shadow: 0 4px 20px rgba(255, 255, 255, 0.14);
+}
+
+.h-btn-primary .arrow {
+ transition: transform 0.25s ease;
+}
+
+.h-btn-primary:hover .arrow {
+ transform: translateX(3px);
+}
+
+.h-btn-ghost {
+ display: inline-flex;
+ align-items: center;
+ padding: 0.7rem 1.6rem;
+ color: rgba(255, 255, 255, 0.5);
+ font-size: var(--text-sm);
+ font-weight: 400;
+ text-decoration: none;
+ letter-spacing: 0.02em;
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: var(--radius-lg);
+ transition: all 0.25s ease;
+}
+
+.h-btn-ghost:hover {
+ color: #fff;
+ border-color: rgba(255, 255, 255, 0.28);
+ background: rgba(255, 255, 255, 0.04);
+}
+
+.h-standards {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: flex;
+ flex-wrap: wrap;
+ gap: var(--space-md) var(--space-lg);
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.68rem;
+ color: rgba(255, 255, 255, 0.3);
+ letter-spacing: 0.14em;
+ text-transform: uppercase;
+}
+
+.h-standards li {
+ position: relative;
+}
+
+.h-standards li + li::before {
+ content: '';
+ position: absolute;
+ left: calc(var(--space-lg) * -0.5);
+ top: 50%;
+ width: 2px;
+ height: 2px;
+ border-radius: 50%;
+ background: rgba(255, 255, 255, 0.2);
+ transform: translateY(-50%);
+}
+
+/* ── Hero avatar column ── */
+
+.h-hero-visual {
+ position: relative;
+ z-index: 1;
+ width: 100%;
+ aspect-ratio: 1 / 1;
+ max-width: 600px;
+ justify-self: end;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.h-avatar-viewer {
+ width: 100%;
+ height: 100%;
+ background: transparent;
+ --poster-color: transparent;
+ border-radius: 50%;
+ outline: none;
+ position: relative;
+ z-index: 2;
+}
+
+.h-avatar-ring {
+ position: absolute;
+ inset: 4%;
+ border-radius: 50%;
+ background: conic-gradient(
+ from 140deg,
+ rgba(255, 200, 60, 0.0) 0deg,
+ rgba(255, 200, 60, 0.22) 60deg,
+ rgba(125, 249, 255, 0.15) 180deg,
+ rgba(157, 140, 255, 0.1) 260deg,
+ rgba(255, 200, 60, 0.0) 360deg
+ );
+ filter: blur(1px);
+ opacity: 0.65;
+ animation: hRingSpin 30s linear infinite;
+ mask: radial-gradient(circle, transparent 58%, #000 59%, #000 63%, transparent 64%);
+ -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 63%, transparent 64%);
+ pointer-events: none;
+ z-index: 1;
+}
+
+@keyframes hRingSpin {
+ to { transform: rotate(360deg); }
+}
+
+.h-avatar-glow {
+ position: absolute;
+ inset: 8%;
+ border-radius: 50%;
+ background:
+ radial-gradient(circle at 50% 50%, rgba(255, 200, 60, 0.12) 0%, transparent 60%),
+ radial-gradient(circle at 40% 70%, rgba(125, 249, 255, 0.07) 0%, transparent 55%);
+ box-shadow: 0 40px 120px -20px rgba(255, 200, 60, 0.16);
+ animation: hBreath 5s ease-in-out infinite;
+ pointer-events: none;
+ z-index: 0;
+}
+
+.h-avatar-badge {
+ position: absolute;
+ bottom: 9%;
+ right: 0;
+ display: inline-flex;
+ align-items: center;
+ gap: 0.6em;
+ padding: 0.5rem 0.9rem;
+ background: rgba(10, 10, 14, 0.72);
+ border: 1px solid rgba(255, 255, 255, 0.07);
+ border-radius: var(--radius-lg);
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.68rem;
+ color: rgba(255, 255, 255, 0.75);
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+ z-index: 3;
+ box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
+}
+
+.h-avatar-badge-label {
+ color: rgba(255, 215, 0, 0.65);
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ font-size: 0.58rem;
+}
+
+.h-scroll-hint {
+ position: absolute;
+ bottom: var(--space-lg);
+ left: 50%;
+ transform: translateX(-50%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 0.5rem;
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.58rem;
+ color: rgba(255, 255, 255, 0.22);
+ letter-spacing: 0.25em;
+ text-transform: uppercase;
+ z-index: 2;
+ pointer-events: none;
+}
+
+.h-scroll-line {
+ width: 1px;
+ height: 32px;
+ background: linear-gradient(to bottom, rgba(255, 255, 255, 0.28), transparent);
+ animation: hScrollLine 2.2s ease-in-out infinite;
+ transform-origin: top;
+}
+
+@keyframes hScrollLine {
+ 0% { transform: scaleY(0); opacity: 0; }
+ 40% { opacity: 1; }
+ 100% { transform: scaleY(1); opacity: 0; }
+}
+
+/* ── Section base ── */
+
+.h-section {
+ padding: var(--space-2xl) var(--space-lg);
+ max-width: 1080px;
+ margin: 0 auto;
+}
+
+.h-section-dark {
+ max-width: none;
+ background: rgba(255, 255, 255, 0.018);
+ border-top: 1px solid rgba(255, 255, 255, 0.04);
+ border-bottom: 1px solid rgba(255, 255, 255, 0.04);
+ padding: var(--space-2xl) var(--space-lg);
+}
+
+.h-section-dark > .h-section-inner {
+ max-width: 1080px;
+ margin: 0 auto;
+}
+
+.h-section-label {
+ font-family: 'JetBrains Mono', monospace;
+ font-size: var(--text-xs);
+ color: rgba(255, 215, 0, 0.55);
+ letter-spacing: 0.15em;
+ text-transform: uppercase;
+ margin: 0 0 var(--space-xl);
+ text-align: center;
+}
+
+.h-section-title {
+ font-size: clamp(1.8rem, 3.5vw, 2.8rem);
+ font-weight: 600;
+ color: #fff;
+ line-height: 1.1;
+ margin: 0 0 var(--space-md);
+ text-align: center;
+ letter-spacing: -0.025em;
+}
+
+.h-section-sub {
+ font-size: var(--text-base);
+ color: rgba(255, 255, 255, 0.4);
+ font-weight: 300;
+ text-align: center;
+ max-width: 36em;
+ margin: 0 auto var(--space-2xl);
+ line-height: var(--leading-normal);
+}
+
+/* ── Steps ── */
+
+.h-steps {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: var(--space-xl);
+ position: relative;
+}
+
+.h-steps::before {
+ content: '';
+ position: absolute;
+ top: 1.8rem;
+ left: calc(33.333% + 1rem);
+ right: calc(33.333% + 1rem);
+ height: 1px;
+ background: linear-gradient(to right, rgba(255,215,0,0.15), rgba(255,215,0,0.08));
+}
+
+.h-step {
+ padding: var(--space-lg);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-lg);
+ transition: border-color 0.3s ease, transform 0.3s ease;
+ position: relative;
+}
+
+.h-step:hover {
+ border-color: rgba(255, 255, 255, 0.12);
+ transform: translateY(-2px);
+}
+
+.h-step-num {
+ font-family: 'JetBrains Mono', monospace;
+ font-size: var(--text-2xl);
+ font-weight: 600;
+ color: rgba(255, 215, 0, 0.13);
+ line-height: 1;
+ margin-bottom: var(--space-sm);
+}
+
+.h-step h4 {
+ color: #fff;
+ font-size: var(--text-lg);
+ font-weight: 500;
+ margin: 0 0 var(--space-xs);
+}
+
+.h-step p {
+ color: rgba(255, 255, 255, 0.42);
+ font-size: var(--text-sm);
+ line-height: var(--leading-normal);
+ margin: 0;
+}
+
+/* ── Feature rows (alternating, Avaturn-style) ── */
+
+.h-feature {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: var(--space-2xl);
+ align-items: center;
+ padding: var(--space-2xl) var(--space-lg);
+ max-width: 1080px;
+ margin: 0 auto;
+}
+
+.h-feature.h-feature-flip {
+ direction: rtl;
+}
+
+.h-feature.h-feature-flip > * {
+ direction: ltr;
+}
+
+.h-feature-text h3 {
+ font-size: clamp(1.5rem, 2.5vw, 2.2rem);
+ font-weight: 600;
+ color: #fff;
+ line-height: 1.1;
+ margin: 0 0 var(--space-md);
+ letter-spacing: -0.02em;
+}
+
+.h-feature-text p {
+ font-size: var(--text-base);
+ color: rgba(255, 255, 255, 0.45);
+ font-weight: 300;
+ line-height: var(--leading-normal);
+ margin: 0 0 var(--space-lg);
+}
+
+.h-feature-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4em;
+ font-size: var(--text-sm);
+ color: rgba(255, 215, 0, 0.75);
+ text-decoration: none;
+ letter-spacing: 0.02em;
+ transition: color 0.2s ease, gap 0.2s ease;
+}
+
+.h-feature-link:hover {
+ color: #ffd76a;
+ gap: 0.7em;
+}
+
+.h-feature-visual {
+ border-radius: var(--radius-lg);
+ background: rgba(255, 255, 255, 0.02);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 280px;
+ position: relative;
+}
+
+.h-feature-visual model-viewer {
+ width: 100%;
+ height: 320px;
+ background: transparent;
+ --poster-color: transparent;
+}
+
+/* Widget preview card */
+.h-widget-preview {
+ padding: var(--space-lg);
+ width: 100%;
+}
+
+.h-widget-card {
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.07);
+ border-radius: var(--radius-lg);
+ padding: var(--space-md);
+ margin-bottom: var(--space-sm);
+}
+
+.h-widget-card-label {
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.65rem;
+ color: rgba(255, 215, 0, 0.6);
+ letter-spacing: 0.12em;
+ text-transform: uppercase;
+ margin-bottom: var(--space-xs);
+}
+
+.h-widget-card-title {
+ color: #fff;
+ font-size: var(--text-sm);
+ font-weight: 500;
+ margin-bottom: var(--space-xs);
+}
+
+.h-widget-card-desc {
+ color: rgba(255, 255, 255, 0.35);
+ font-size: 0.75rem;
+}
+
+.h-embed-code {
+ background: #0a0a0a;
+ border: 1px solid rgba(255, 255, 255, 0.05);
+ border-radius: var(--radius-sm);
+ padding: var(--space-sm) var(--space-md);
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.68rem;
+ color: rgba(255, 255, 255, 0.45);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ margin-top: var(--space-sm);
+}
+
+.h-embed-code .tag { color: rgba(125, 200, 255, 0.8); }
+.h-embed-code .attr { color: rgba(168, 204, 140, 0.8); }
+
+/* Identity card */
+.h-identity-card {
+ padding: var(--space-lg);
+ width: 100%;
+}
+
+.h-id-header {
+ display: flex;
+ align-items: center;
+ gap: var(--space-sm);
+ margin-bottom: var(--space-md);
+}
+
+.h-id-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: #4ade80;
+}
+
+.h-id-title {
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.7rem;
+ color: rgba(255, 255, 255, 0.5);
+ letter-spacing: 0.08em;
+}
+
+.h-id-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: var(--space-xs) 0;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.04);
+ font-size: 0.75rem;
+}
+
+.h-id-row:last-child {
+ border-bottom: none;
+}
+
+.h-id-key {
+ font-family: 'JetBrains Mono', monospace;
+ color: rgba(255, 255, 255, 0.3);
+ letter-spacing: 0.05em;
+}
+
+.h-id-val {
+ color: rgba(255, 255, 255, 0.65);
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 0.7rem;
+}
+
+.h-id-val.gold {
+ color: rgba(255, 215, 0, 0.7);
+}
+
+/* ── Final CTA ── */
+
+.h-cta-section {
+ text-align: center;
+ padding: var(--space-2xl) var(--space-lg);
+}
+
+.h-cta-section h2 {
+ font-size: clamp(1.8rem, 4vw, 3rem);
+ font-weight: 600;
+ color: #fff;
+ line-height: 1.1;
+ margin: 0 0 var(--space-md);
+ letter-spacing: -0.025em;
+}
+
+.h-cta-section p {
+ font-size: var(--text-base);
+ color: rgba(255, 255, 255, 0.4);
+ margin: 0 0 var(--space-xl);
+}
+
+.h-cta-row-center {
+ display: flex;
+ gap: var(--space-md);
+ justify-content: center;
+ flex-wrap: wrap;
+}
+
+/* ── Footer ── */
+
+.h-footer {
+ text-align: center;
+ padding: var(--space-xl) var(--space-lg);
+ border-top: 1px solid rgba(255, 255, 255, 0.04);
+}
+
+.h-footer p {
+ color: rgba(255, 255, 255, 0.22);
+ font-size: var(--text-xs);
+ font-family: 'JetBrains Mono', monospace;
+ margin: 0;
+}
+
+.h-footer a {
+ color: rgba(255, 255, 255, 0.32);
+ text-decoration: none;
+ transition: color 0.2s ease;
+}
+
+.h-footer a:hover {
+ color: #fff;
+}
+
+/* ── Responsive ── */
+
+@media (prefers-reduced-motion: reduce) {
+ .h-hero-mesh, .h-hero-glow-a, .h-hero-glow-b,
+ .h-avatar-ring, .h-avatar-glow, .h-eyebrow-dot,
+ .h-title em, .h-scroll-line {
+ animation: none !important;
+ }
+}
+
+@media screen and (max-width: 1024px) {
+ .h-hero {
+ grid-template-columns: 1fr 1fr;
+ gap: var(--space-xl);
+ }
+
+ .h-hero-visual {
+ max-width: 400px;
+ }
+}
+
+@media screen and (max-width: 768px) {
+ .h-hero {
+ grid-template-columns: 1fr;
+ min-height: auto;
+ padding: calc(var(--space-xl) + 1rem) var(--space-md) var(--space-xl);
+ text-align: center;
+ }
+
+ .h-hero-content {
+ order: 2;
+ }
+
+ .h-hero-visual {
+ order: 1;
+ max-width: 320px;
+ margin: 0 auto;
+ justify-self: center;
+ }
+
+ .h-cta-row {
+ justify-content: center;
+ }
+
+ .h-standards {
+ justify-content: center;
+ }
+
+ .h-steps {
+ grid-template-columns: 1fr;
+ gap: var(--space-md);
+ }
+
+ .h-steps::before {
+ display: none;
+ }
+
+ .h-feature {
+ grid-template-columns: 1fr;
+ gap: var(--space-lg);
+ padding: var(--space-xl) var(--space-md);
+ }
+
+ .h-feature.h-feature-flip {
+ direction: ltr;
+ }
+
+ .h-section {
+ padding: var(--space-xl) var(--space-md);
+ }
+
+ .h-section-dark {
+ padding: var(--space-xl) var(--space-md);
+ }
+
+ .h-scroll-hint {
+ display: none;
+ }
+}
diff --git a/home.html b/home.html
new file mode 100644
index 000000000..3bc8e3cf6
--- /dev/null
+++ b/home.html
@@ -0,0 +1,294 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <title>3D Agent — Give Your AI a Body</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="author" content="nirholas" />
+ <meta name="description" content="Drop any GLB model into 3D Agent — view it, animate it, embed it anywhere, and give it a verifiable on-chain identity." />
+ <meta name="theme-color" content="#000000" />
+
+ <meta property="og:type" content="website" />
+ <meta property="og:title" content="3D Agent — Give Your AI a Body" />
+ <meta property="og:description" content="Drop any GLB model into 3D Agent — view it, animate it, embed it anywhere." />
+ <meta property="og:url" content="https://3dagent.vercel.app/home" />
+
+ <link rel="canonical" href="https://3dagent.vercel.app/home" />
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/home.css" />
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400&display=swap" rel="stylesheet" />
+ <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
+</head>
+<body class="home-page">
+ <header>
+ <h1><a href="/"><span class="wordmark-dot" aria-hidden="true"></span>3D Agent</a></h1>
+ <nav class="home-nav">
+ <a href="/app">Viewer</a>
+ <a href="/studio">Studio</a>
+ <a href="/widgets">Widgets</a>
+ <a href="/features">Docs</a>
+ <a href="/login" class="nav-cta" id="home-nav-cta">Get started</a>
+ </nav>
+ </header>
+
+ <main class="home-main">
+
+ <!-- ── Hero ── -->
+ <section class="h-hero">
+ <div class="h-hero-bg" aria-hidden="true">
+ <div class="h-hero-mesh"></div>
+ <div class="h-hero-grid"></div>
+ <div class="h-hero-glow-a"></div>
+ <div class="h-hero-glow-b"></div>
+ </div>
+
+ <div class="h-hero-content">
+ <div class="h-eyebrow h-reveal">
+ <span class="h-eyebrow-dot"></span>
+ <span>Browser-native · No install</span>
+ </div>
+ <h2 class="h-title h-reveal">
+ Give your AI<br/>agent a <em>body</em>.
+ </h2>
+ <p class="h-subtitle h-reveal">
+ Drop any GLB model into 3D Agent — view it, animate it,
+ embed it anywhere, and give it a verifiable on-chain identity.
+ No plugins. No server uploads. Just open and go.
+ </p>
+ <div class="h-cta-row h-reveal">
+ <a href="/" class="h-btn-primary">
+ <span>Launch Viewer</span>
+ <span class="arrow">→</span>
+ </a>
+ <a href="/widgets" class="h-btn-ghost">Explore Widgets</a>
+ </div>
+ <ul class="h-standards h-reveal" aria-label="Supported formats and standards">
+ <li>glTF 2.0</li>
+ <li>GLB</li>
+ <li>ERC-8004</li>
+ <li>A2A</li>
+ <li>MCP</li>
+ </ul>
+ </div>
+
+ <div class="h-hero-visual h-reveal" aria-hidden="true">
+ <div class="h-avatar-ring"></div>
+ <div class="h-avatar-glow"></div>
+ <model-viewer
+ class="h-avatar-viewer"
+ src="/avatars/cz.glb"
+ alt="3D Agent avatar"
+ camera-controls
+ disable-zoom
+ auto-rotate
+ auto-rotate-delay="0"
+ rotation-per-second="18deg"
+ interaction-prompt="none"
+ shadow-intensity="0.8"
+ shadow-softness="1"
+ exposure="1.05"
+ tone-mapping="aces"
+ environment-image="neutral"
+ camera-orbit="20deg 68deg 3.4m"
+ field-of-view="28deg"
+ loading="eager"
+ ></model-viewer>
+ <div class="h-avatar-badge">
+ <span class="h-avatar-badge-label">agent</span>
+ <span>0x3d…a9f</span>
+ </div>
+ </div>
+
+ <div class="h-scroll-hint" aria-hidden="true">
+ <span>scroll</span>
+ <span class="h-scroll-line"></span>
+ </div>
+ </section>
+
+ <!-- ── How it works ── -->
+ <section class="h-section">
+ <p class="h-section-label h-reveal">How It Works</p>
+ <h2 class="h-section-title h-reveal">From file to deployed agent<br/>in three steps.</h2>
+ <p class="h-section-sub h-reveal">No account required to start. Drop a model, explore the viewer, then sign in when you're ready to save and share.</p>
+ <div class="h-steps">
+ <div class="h-step h-reveal">
+ <div class="h-step-num">01</div>
+ <h4>Drop your model</h4>
+ <p>Drag a GLB or glTF 2.0 file directly into the browser. Instant WebGL rendering — no upload, no install, no waiting.</p>
+ </div>
+ <div class="h-step h-reveal">
+ <div class="h-step-num">02</div>
+ <h4>Animate &amp; configure</h4>
+ <p>Pick animations, add an AI chat agent, adjust lighting and camera. Save your avatar to your account for reuse.</p>
+ </div>
+ <div class="h-step h-reveal">
+ <div class="h-step-num">03</div>
+ <h4>Embed anywhere</h4>
+ <p>Generate a widget — one iframe, any site. Turntable, talking agent, animation gallery. Works in Notion, Ghost, WordPress.</p>
+ </div>
+ </div>
+ </section>
+
+ <!-- ── Feature: Viewer ── -->
+ <div class="h-section-dark">
+ <div class="h-feature h-section-inner">
+ <div class="h-feature-text h-reveal">
+ <h3>Instant 3D viewer,<br/>no install.</h3>
+ <p>Built on three.js r176. Drag a GLB file onto the page and see it rendered in WebGL with full lighting, animations, and material inspection — on any device, any browser.</p>
+ <a href="/" class="h-feature-link">Open the viewer →</a>
+ </div>
+ <div class="h-feature-visual h-reveal">
+ <model-viewer
+ src="/avatars/cz.glb"
+ alt="3D model preview"
+ camera-controls
+ auto-rotate
+ auto-rotate-delay="0"
+ rotation-per-second="12deg"
+ interaction-prompt="none"
+ shadow-intensity="0.6"
+ exposure="1.0"
+ tone-mapping="aces"
+ environment-image="neutral"
+ camera-orbit="0deg 75deg 2.8m"
+ field-of-view="30deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ </div>
+ </div>
+
+ <!-- ── Feature: Widget Studio ── -->
+ <div class="h-feature h-reveal" style="max-width:1080px; margin: 0 auto;">
+ <div class="h-feature-text">
+ <h3>Embeddable widgets.<br/>One line of HTML.</h3>
+ <p>Save any avatar as a widget — a configured, shareable view that any site can drop in with a single iframe. Five types: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour.</p>
+ <a href="/studio" class="h-feature-link">Open Widget Studio →</a>
+ </div>
+ <div class="h-feature-visual">
+ <div class="h-widget-preview">
+ <div class="h-widget-card h-reveal">
+ <div class="h-widget-card-label">Turntable</div>
+ <div class="h-widget-card-title">Auto-rotating hero banner</div>
+ <div class="h-widget-card-desc">360° display, configurable speed and background.</div>
+ </div>
+ <div class="h-widget-card h-reveal">
+ <div class="h-widget-card-label">Talking Agent</div>
+ <div class="h-widget-card-title">Embodied AI chat</div>
+ <div class="h-widget-card-desc">Your 3D avatar speaks. Powered by your LLM of choice.</div>
+ </div>
+ <div class="h-embed-code h-reveal">
+ <span class="tag">&lt;iframe</span>
+ <span class="attr"> src</span>=<span class="attr">"https://3dagent.vercel.app/#widget=wdgt_abc123"</span>
+ <span class="tag">/&gt;</span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- ── Feature: Agent Identity ── -->
+ <div class="h-section-dark">
+ <div class="h-feature h-feature-flip h-section-inner">
+ <div class="h-feature-text h-reveal">
+ <h3>On-chain identity<br/>for every agent.</h3>
+ <p>Register your avatar on Ethereum via ERC-8004 — a verifiable, portable identity discoverable by any A2A or MCP client. Your 3D model becomes your agent's on-chain passport.</p>
+ <a href="/features" class="h-feature-link">Read the spec →</a>
+ </div>
+ <div class="h-feature-visual h-reveal">
+ <div class="h-identity-card">
+ <div class="h-id-header">
+ <div class="h-id-dot"></div>
+ <span class="h-id-title">agent-registration.json</span>
+ </div>
+ <div class="h-id-row">
+ <span class="h-id-key">name</span>
+ <span class="h-id-val">"3D Agent"</span>
+ </div>
+ <div class="h-id-row">
+ <span class="h-id-key">agentId</span>
+ <span class="h-id-val gold">0x3d…a9f</span>
+ </div>
+ <div class="h-id-row">
+ <span class="h-id-key">type</span>
+ <span class="h-id-val">ERC-8004</span>
+ </div>
+ <div class="h-id-row">
+ <span class="h-id-key">services</span>
+ <span class="h-id-val">A2A · MCP · web</span>
+ </div>
+ <div class="h-id-row">
+ <span class="h-id-key">active</span>
+ <span class="h-id-val gold">true</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- ── Final CTA ── -->
+ <section class="h-cta-section h-reveal">
+ <h2>Ready to give your<br/>agent a presence?</h2>
+ <p>Drop a 3D model. Add AI. Ship in minutes.</p>
+ <div class="h-cta-row-center">
+ <a href="/" class="h-btn-primary">
+ <span>Launch Viewer</span>
+ <span class="arrow">→</span>
+ </a>
+ <a href="/register" class="h-btn-ghost">Create account</a>
+ </div>
+ </section>
+
+ <footer class="h-footer">
+ <p>
+ 3D Agent ·
+ <a href="https://github.com/nirholas/3D" target="_blank" rel="noopener">GitHub</a> ·
+ <a href="/features">Docs</a> ·
+ <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>
+ </p>
+ </footer>
+ </main>
+
+ <script>
+ // Auth-aware nav CTA
+ (function () {
+ try {
+ const token = localStorage.getItem('auth_token') || sessionStorage.getItem('auth_token');
+ if (token) {
+ const cta = document.getElementById('home-nav-cta');
+ if (cta) {
+ cta.textContent = 'Dashboard';
+ cta.href = '/dashboard';
+ }
+ }
+ } catch (_) {}
+ })();
+
+ // Scroll reveal
+ (function () {
+ const els = document.querySelectorAll('.h-reveal');
+ const observer = new IntersectionObserver(
+ (entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('revealed');
+ observer.unobserve(entry.target);
+ }
+ });
+ },
+ { threshold: 0.12, rootMargin: '0px 0px -50px 0px' }
+ );
+ els.forEach((el, i) => {
+ const siblings = Array.from(el.parentElement.querySelectorAll('.h-reveal'));
+ const idx = siblings.indexOf(el);
+ el.style.transitionDelay = (idx * 0.09) + 's';
+ observer.observe(el);
+ });
+ })();
+ </script>
+</body>
+</html>
diff --git a/index.html b/index.html
index 904d74d7d..8fa4a20f7 100644
--- a/index.html
+++ b/index.html
@@ -104,10 +104,10 @@
</label>
</div>
<span class="drop-hint">or drag &amp; drop glTF / GLB anywhere</span>
- <button class="create-avatar-btn" id="create-avatar-btn" title="Create a custom 3D avatar">
+ <a class="create-avatar-btn" id="create-avatar-btn" href="/create" title="Create a custom 3D avatar from a selfie">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
<span>Create Avatar</span>
- </button>
+ </a>
</div>
<div class="spinner"></div>
</main>
diff --git a/prompts/build/02-02-selfie-upload-r2.md b/prompts/build/02-02-selfie-upload-r2.md
index 8ad1b7240..fb3470a5c 100644
--- a/prompts/build/02-02-selfie-upload-r2.md
+++ b/prompts/build/02-02-selfie-upload-r2.md
@@ -12,7 +12,7 @@ Second step of the magic moment. The selfie blob from 02-01 must land in R2 unde
## Prerequisites
- 02-01 in place — `selfie:ready` event fires with a JPEG blob.
-- R2 env vars (`R2_ACCOUNT_ID`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY`, `R2_BUCKET`, `R2_PUBLIC_URL`) set.
+- S3 env vars (`S3_ENDPOINT`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_BUCKET`, `S3_PUBLIC_DOMAIN`) set.
## Read these first
diff --git a/src/app.js b/src/app.js
index 0f2340241..84ff0bdf8 100644
--- a/src/app.js
+++ b/src/app.js
@@ -423,6 +423,9 @@ class App {
// ── Avatar Creator ────────────────────────────────────────────────────────
setupAvatarCreator() {
+ // The creator instance stays wired so the selfie pipeline (task 4) can
+ // call `avatarCreator.open(sessionUrl)` once it has an Avaturn session.
+ // The "Create Avatar" button is now a link to /create — no click wiring here.
this.avatarCreator = new AvatarCreator(document.body, async (glbUrl) => {
this.view(glbUrl, '', new Map());
try {
@@ -434,11 +437,6 @@ class App {
}
}
});
-
- const btn = document.getElementById('create-avatar-btn');
- if (btn) {
- btn.addEventListener('click', () => this.avatarCreator.open());
- }
}
// ── File Loading ──────────────────────────────────────────────────────────
diff --git a/src/selfie-capture.js b/src/selfie-capture.js
new file mode 100644
index 000000000..21946e6a3
--- /dev/null
+++ b/src/selfie-capture.js
@@ -0,0 +1,59 @@
+/**
+ * Selfie capture flow — entry for /create.
+ *
+ * Task 1 (this file): render the input-method choice step. When the user picks
+ * a method, stash it on sessionStorage + advance the UI placeholder. Later
+ * tasks wire up the 3-photo camera / upload step and the Avaturn pipeline.
+ */
+
+const SESSION_KEY = 'selfie.method';
+
+const choices = document.querySelectorAll('.choice[data-method]');
+const uploadInput = /** @type {HTMLInputElement | null} */ (document.getElementById('upload-input'));
+const unsupportedMsg = document.getElementById('unsupported-msg');
+
+const cameraSupported =
+ typeof navigator !== 'undefined' &&
+ navigator.mediaDevices &&
+ typeof navigator.mediaDevices.getUserMedia === 'function';
+
+if (!cameraSupported) {
+ const cameraChoice = document.querySelector('.choice[data-method="camera"]');
+ if (cameraChoice) {
+ cameraChoice.setAttribute('aria-disabled', 'true');
+ /** @type {HTMLButtonElement} */ (cameraChoice).disabled = true;
+ cameraChoice.style.opacity = '0.45';
+ cameraChoice.style.cursor = 'not-allowed';
+ }
+ unsupportedMsg?.classList.add('show');
+}
+
+choices.forEach((btn) => {
+ btn.addEventListener('click', () => {
+ const method = btn.getAttribute('data-method');
+ if (!method) return;
+ if (method === 'camera' && !cameraSupported) return;
+
+ try {
+ sessionStorage.setItem(SESSION_KEY, method);
+ } catch (_) {
+ // sessionStorage may be blocked (private mode, etc.) — ignore, next step re-asks.
+ }
+
+ if (method === 'upload' && uploadInput) {
+ uploadInput.click();
+ return;
+ }
+
+ // Camera branch: step 2 (3-photo capture UI) lands in the next task.
+ // For now signal intent so the placeholder is visible during dev.
+ console.info('[selfie] camera flow — capture UI pending (task 2)');
+ });
+});
+
+uploadInput?.addEventListener('change', () => {
+ const files = uploadInput.files;
+ if (!files || files.length === 0) return;
+ // Step 2 picks up these files from the <input> reference in the next task.
+ console.info('[selfie] upload flow — %d file(s) selected; capture UI pending (task 2)', files.length);
+});
diff --git a/vercel.json b/vercel.json
index d5e05fbcd..fafc4b425 100644
--- a/vercel.json
+++ b/vercel.json
@@ -66,6 +66,9 @@
{ "src": "/robots.txt", "dest": "/public/robots.txt" },
{ "src": "/sitemap.xml", "dest": "/public/sitemap.xml" },
{ "src": "/features", "dest": "/features.html" },
+ { "src": "/create", "dest": "/create.html" },
+ { "src": "/create/", "dest": "/create.html" },
+ { "src": "/home", "dest": "/home.html" },
{ "src": "/(.*)", "dest": "/public/$1" }
]
}
diff --git a/vite.config.js b/vite.config.js
index 0303dce09..0642410f1 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -27,6 +27,7 @@ const appConfig = {
main: resolve(__dirname, 'index.html'),
features: resolve(__dirname, 'features.html'),
embed: resolve(__dirname, 'embed.html'),
+ create: resolve(__dirname, 'create.html'),
'agent-home': resolve(__dirname, 'agent-home.html'),
'agent-embed': resolve(__dirname, 'agent-embed.html'),
},
@@ -41,6 +42,7 @@ const appConfig = {
'/login': resolve(root, 'public/login.html'),
'/register': resolve(root, 'public/register.html'),
'/features': resolve(root, 'features.html'),
+ '/create': resolve(root, 'create.html'),
'/dashboard': resolve(root, 'public/dashboard/index.html'),
'/studio': resolve(root, 'public/studio/index.html'),
'/widgets': resolve(root, 'public/widgets-gallery/index.html'),