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.

Add screenshot automation script using Playwright

nirholas316ed4a288e2
diff --git a/README.md b/README.md
index b20c5b2e5..ad3915981 100644
--- a/README.md
+++ b/README.md
@@ -13,9 +13,12 @@
- [What is three.ws?](#what-is-threews)
- [Key Features](#key-features)
+- [Screenshots](#screenshots)
- [Architecture](#architecture)
- [Tech Stack](#tech-stack)
- [Getting Started](#getting-started)
+- [Examples](#examples)
+- [Tutorials](#tutorials)
- [Project Structure](#project-structure)
- [The Agent System](#the-agent-system)
- [Event Bus (Agent Protocol)](#event-bus-agent-protocol)
@@ -100,6 +103,18 @@ three.ws is production-ready and serves [three.ws](https://three.ws) live. The e
---
+## Screenshots
+
+| Viewer | Widget Studio |
+|--------|--------------|
+| ![Viewer](public/screenshots/viewer.png) | ![Widget Studio](public/screenshots/studio.png) |
+
+| Agent Discovery | Avatar Creation |
+|----------------|----------------|
+| ![Discover](public/screenshots/discover.png) | ![Create](public/screenshots/create.png) |
+
+---
+
## Architecture
The platform is organized into four layers. All layers communicate through a single event bus (`agent-protocol`) rather than direct calls.
@@ -237,6 +252,239 @@ To try the agent, navigate to `/create`, upload a GLB, and configure a brain (re
---
+## Examples
+
+Copy-paste ready snippets for the most common use cases. Swap in your own GLB URL and go.
+
+### 1. Minimal viewer (no AI)
+
+The simplest possible setup — one script tag, one element, zero build step.
+
+```html
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>3D Viewer</title>
+ <style>
+ body { margin: 0; background: #0a0a0a; display: flex; align-items: center; justify-content: center; height: 100vh; }
+ agent-3d { width: 400px; height: 560px; display: block; }
+ </style>
+</head>
+<body>
+ <script type="module" src="https://three.ws/agent-3d/1.5.1/agent-3d.js"></script>
+ <agent-3d body="https://cdn.three.ws/models/sample-avatar.glb"></agent-3d>
+</body>
+</html>
+```
+
+Drag-to-rotate, scroll-to-zoom, full PBR rendering — no API key, no account required. Swap `body=` for any publicly accessible `.glb` URL.
+
+---
+
+### 2. Talking agent with inline instructions
+
+Add `brain=` and `instructions=` to turn the viewer into a conversational agent.
+
+```html
+<script type="module" src="https://three.ws/agent-3d/1.5.1/agent-3d.js"></script>
+
+<agent-3d
+ body="https://cdn.three.ws/models/sample-avatar.glb"
+ brain="claude-sonnet-4-6"
+ name="Aria"
+ instructions="You are Aria, a friendly AI guide. Be warm, concise, and occasionally playful.
+ When someone greets you, wave at them. Keep replies to 2–3 sentences."
+ mode="inline"
+ width="400px"
+ height="560px"
+></agent-3d>
+```
+
+The chat input and mic button appear automatically when `brain` is set. No UI to build.
+
+---
+
+### 3. Floating bubble (support widget style)
+
+Pin the agent to a corner of the page so it persists as users scroll.
+
+```html
+<script type="module" src="https://three.ws/agent-3d/1.5.1/agent-3d.js"></script>
+
+<agent-3d
+ body="https://cdn.three.ws/models/sample-avatar.glb"
+ brain="claude-sonnet-4-6"
+ instructions="You are a helpful product assistant. Answer questions about our features."
+ mode="floating"
+ position="bottom-right"
+ width="320px"
+ height="420px"
+></agent-3d>
+```
+
+`position` accepts `bottom-right`, `bottom-left`, `top-right`, or `top-left`.
+
+---
+
+### 4. Load a registered agent by ID
+
+If you've registered an agent on the platform, load it entirely from its manifest — no inline attributes needed.
+
+```html
+<!-- By platform agent ID -->
+<agent-3d agent-id="a_abc123def456"></agent-3d>
+
+<!-- By on-chain ERC-8004 ID -->
+<agent-3d agent-id="42" chain-id="8453"></agent-3d>
+```
+
+The element fetches the manifest (model URL, instructions, skills, memory config) automatically.
+
+---
+
+### 5. Custom chat UI with JavaScript API
+
+Hide the built-in chrome and wire in your own input using the element's JS API.
+
+```html
+<script type="module" src="https://three.ws/agent-3d/1.5.1/agent-3d.js"></script>
+
+<agent-3d id="agent" body="./avatar.glb" brain="claude-sonnet-4-6" kiosk
+ style="width:400px;height:560px;display:block"></agent-3d>
+
+<input id="msg" type="text" placeholder="Ask something…">
+<button onclick="send()">Send</button>
+
+<script>
+ const agent = document.getElementById('agent');
+ const input = document.getElementById('msg');
+
+ async function send() {
+ const text = input.value.trim();
+ if (!text) return;
+ input.value = '';
+ await agent.say(text);
+ }
+
+ input.addEventListener('keydown', e => { if (e.key === 'Enter') send(); });
+
+ // Auto-greet on load
+ agent.addEventListener('agent:ready', () => {
+ setTimeout(() => agent.say('Hello! How can I help you today?'), 1200);
+ });
+
+ // Listen to replies
+ agent.addEventListener('brain:message', e => {
+ if (e.detail.role === 'assistant') console.log('Agent:', e.detail.content);
+ });
+</script>
+```
+
+**Full JS API:**
+
+| Method | Description |
+|---|---|
+| `agent.say(text)` | Send a message; agent speaks and animates the reply |
+| `agent.ask(text)` | Same as `say()`, returns reply text as a string |
+| `agent.wave()` | Trigger the wave gesture directly |
+| `agent.lookAt(target)` | `'camera'`, `'model'`, or `'user'` |
+| `agent.play(clipName)` | Play a named animation clip |
+| `agent.clearConversation()` | Reset conversation history |
+| `agent.expressEmotion(trigger, weight)` | Manually inject an emotion blend |
+
+**Key events:** `agent:ready`, `brain:message`, `brain:thinking`, `skill:tool-called`, `voice:transcript`
+
+---
+
+### 6. iframe widget (works in Notion, Substack, Webflow)
+
+Use a widget URL directly — no script tag needed.
+
+```html
+<iframe
+ src="https://three.ws/a/8453/42/embed"
+ width="400"
+ height="560"
+ frameborder="0"
+ allow="microphone"
+ style="border-radius:16px;"
+></iframe>
+```
+
+Generate the `src` URL from [Widget Studio](https://three.ws/studio) — pick an avatar, choose a widget type, and copy the snippet.
+
+---
+
+### 7. Agent manifest JSON
+
+For anything beyond a quick one-liner, define the agent in a manifest file and reference it with `manifest=`.
+
+**agent.json:**
+```json
+{
+ "spec": "agent-manifest/0.2",
+ "name": "Aria",
+ "description": "A friendly AI guide",
+ "body": {
+ "uri": "./avatar.glb",
+ "format": "gltf-binary"
+ },
+ "brain": {
+ "provider": "anthropic",
+ "model": "claude-sonnet-4-6",
+ "instructions": "You are Aria, a warm and curious AI guide. Wave when greeted.",
+ "temperature": 0.8,
+ "maxTokens": 1024
+ },
+ "voice": {
+ "tts": { "provider": "browser", "rate": 1.05 },
+ "stt": { "provider": "browser", "language": "en-US" }
+ },
+ "memory": { "mode": "local" },
+ "skills": [
+ { "uri": "https://cdn.three.ws/skills/wave/" }
+ ]
+}
+```
+
+```html
+<agent-3d manifest="./agent.json" width="400px" height="560px"></agent-3d>
+```
+
+---
+
+## Tutorials
+
+Step-by-step guides in [`docs/tutorials/`](docs/tutorials/):
+
+| Tutorial | What you'll build | Time |
+|---|---|---|
+| [Build Your First Agent](docs/tutorials/first-agent.md) | A talking 3D character on a shareable page, from zero | ~20 min |
+| [Embed on Your Website](docs/tutorials/embed-on-website.md) | Add an agent to any page — plain HTML, React, Webflow, WordPress | ~15 min |
+| [Write a Custom Skill](docs/tutorials/custom-skill.md) | A new tool the agent can call (e.g., fetch live weather data) | ~30 min |
+| [Register On-Chain](docs/tutorials/register-onchain.md) | Mint your agent as an ERC-8004 token with permanent identity | ~20 min |
+| [Build a Personal AI Site](docs/tutorials/personal-ai-site.md) | A full personal site with an embedded AI version of yourself | ~45 min |
+
+### Common gotchas
+
+**CORS** — if your GLB is hosted on a different domain, the server must send `Access-Control-Allow-Origin: *`. Without it the fetch is blocked and the canvas stays blank. Uploading via the platform's storage sets this automatically.
+
+**File size** — models over ~50 MB load slowly. Compress with Draco:
+```bash
+npx gltf-transform draco input.glb output.glb
+```
+
+**Voice on HTTPS** — `getUserMedia` (microphone) requires HTTPS. Localhost is exempt; any remote deployment needs TLS. Vercel and Netlify both provide it automatically.
+
+**CSP** — if your page has a strict Content Security Policy, add:
+```
+script-src 'self' https://three.ws;
+```
+For sandboxed iframes use the widget embed path instead — it runs in its own browsing context.
+
+---
+
## Project Structure
```
diff --git a/api/_lib/auth.js b/api/_lib/auth.js
index 6787096e3..7c498874f 100644
--- a/api/_lib/auth.js
+++ b/api/_lib/auth.js
@@ -168,7 +168,7 @@ export async function getSessionUser(req, res) {
const hash = await sha256(token);
const rows = await sql`
select s.id as sid, s.last_seen_at, s.expires_at,
- u.id, u.email, u.display_name, u.plan, u.avatar_url, u.wallet_address
+ u.id, u.email, u.display_name, u.username, u.plan, u.avatar_url, u.wallet_address
from sessions s join users u on u.id = s.user_id
where s.token_hash = ${hash}
and s.revoked_at is null
diff --git a/api/_lib/schema.sql b/api/_lib/schema.sql
index 54b6e4545..f9363d5a9 100644
--- a/api/_lib/schema.sql
+++ b/api/_lib/schema.sql
@@ -24,7 +24,9 @@ create table if not exists users (
-- Additive migration for deployments that pre-date the wallet_address column.
alter table users add column if not exists wallet_address text;
alter table users add column if not exists is_admin boolean not null default false;
+alter table users add column if not exists username text;
create unique index if not exists users_wallet_unique on users(wallet_address) where wallet_address is not null;
+create unique index if not exists users_username_unique on users(lower(username)) where username is not null;
-- ── avatars (GLBs stored in R2) ─────────────────────────────────────────────
create table if not exists avatars (
diff --git a/api/auth/profile.js b/api/auth/profile.js
new file mode 100644
index 000000000..af8243f48
--- /dev/null
+++ b/api/auth/profile.js
@@ -0,0 +1,48 @@
+import { sql } from '../_lib/db.js';
+import { getSessionUser } from '../_lib/auth.js';
+import { cors, json, method, wrap, error, readJson } from '../_lib/http.js';
+import { parse, username as usernameValidator, displayName } from '../_lib/validate.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { z } from 'zod';
+
+const bodySchema = z
+ .object({
+ username: usernameValidator.optional(),
+ display_name: displayName.optional(),
+ })
+ .refine((b) => b.username !== undefined || b.display_name !== undefined, {
+ message: 'at least one field required',
+ });
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'PATCH,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['PATCH'])) return;
+
+ const user = await getSessionUser(req);
+ if (!user) return error(res, 401, 'unauthenticated', 'not signed in');
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const body = parse(bodySchema, await readJson(req));
+
+ if (body.username) {
+ const taken = await sql`
+ select id from users
+ where lower(username) = ${body.username.toLowerCase()} and id != ${user.id} and deleted_at is null
+ limit 1
+ `;
+ if (taken[0]) return error(res, 409, 'conflict', 'username already taken');
+ }
+
+ const [updated] = await sql`
+ update users set
+ username = coalesce(${body.username ?? null}, username),
+ display_name = coalesce(${body.display_name ?? null}, display_name),
+ updated_at = now()
+ where id = ${user.id} and deleted_at is null
+ returning id, display_name, username
+ `;
+
+ return json(res, 200, { user: updated });
+});
diff --git a/api/users/[username].js b/api/users/[username].js
new file mode 100644
index 000000000..18eb243e5
--- /dev/null
+++ b/api/users/[username].js
@@ -0,0 +1,51 @@
+import { sql } from '../_lib/db.js';
+import { cors, json, method, wrap, error } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { publicUrl } from '../_lib/r2.js';
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: false })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ const username = (req.query.username || '').toLowerCase().trim();
+ if (!username || !/^[a-z0-9_-]{3,30}$/.test(username)) {
+ return error(res, 400, 'validation_error', 'invalid username');
+ }
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const [user] = await sql`
+ select id, display_name, username, created_at
+ from users
+ where lower(username) = ${username} and deleted_at is null
+ limit 1
+ `;
+ if (!user) return error(res, 404, 'not_found', 'user not found');
+
+ const avatarRows = await sql`
+ select id, name, description, thumbnail_key, tags, created_at
+ from avatars
+ where owner_id = ${user.id} and visibility = 'public' and deleted_at is null
+ order by created_at desc
+ limit 48
+ `;
+
+ const avatars = avatarRows.map((a) => ({
+ id: a.id,
+ name: a.name,
+ description: a.description,
+ thumbnail_url: a.thumbnail_key ? publicUrl(a.thumbnail_key) : null,
+ tags: a.tags || [],
+ created_at: a.created_at,
+ }));
+
+ res.setHeader('Cache-Control', 'public, s-maxage=60, stale-while-revalidate=300');
+ return json(res, 200, {
+ user: {
+ username: user.username,
+ display_name: user.display_name || user.username,
+ },
+ avatars,
+ });
+});
diff --git a/app.html b/app.html
index 3499f8db9..2ac1a37e7 100644
--- a/app.html
+++ b/app.html
@@ -174,6 +174,18 @@
<span>Public profile</span>
</a>
<a href="/dashboard" class="nav-dashboard">Dashboard</a>
+ <div class="nav-user-wrap" id="nav-user-wrap" hidden>
+ <button class="nav-user" id="nav-user-btn" aria-haspopup="true" aria-expanded="false" type="button">
+ <span id="nav-user-label">Account</span>
+ </button>
+ <div class="nav-user-menu" id="nav-user-menu" role="menu" hidden>
+ <a href="/profile" id="nav-my-profile-link" class="nav-user-menu-item">My Profile</a>
+ <a href="/settings" class="nav-user-menu-item">Settings</a>
+ <a href="/dashboard" class="nav-user-menu-item">Dashboard</a>
+ <div class="nav-user-menu-sep" role="separator"></div>
+ <button class="nav-user-menu-item nav-user-menu-signout" id="nav-sign-out-btn" type="button">Sign out</button>
+ </div>
+ </div>
<a href="/login" class="nav-sign-in" id="nav-sign-in">Sign in</a>
</nav>
</header>
diff --git a/avatar-page.html b/avatar-page.html
new file mode 100644
index 000000000..0126a6178
--- /dev/null
+++ b/avatar-page.html
@@ -0,0 +1,363 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Avatar — three.ws</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="theme-color" content="#000000" />
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <link
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap"
+ rel="stylesheet"
+ />
+ <script
+ type="module"
+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
+ ></script>
+
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:url" content="" id="og-url" />
+ <meta property="og:title" content="Avatar — three.ws" id="og-title" />
+ <meta property="og:description" content="A 3D avatar on three.ws" id="og-description" />
+ <meta property="og:image" content="https://three.ws/assets/og-image.png" id="og-image" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:title" content="Avatar — three.ws" id="tw-title" />
+ <meta name="twitter:description" content="A 3D avatar on three.ws" id="tw-description" />
+
+ <style>
+ body {
+ overflow: auto;
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
+ }
+
+ .av-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 1rem 1.618rem;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);
+ }
+
+ .av-header a {
+ color: rgba(255, 255, 255, 0.4);
+ text-decoration: none;
+ font-size: 0.764rem;
+ }
+
+ .av-header a:hover {
+ color: rgba(255, 255, 255, 0.8);
+ }
+
+ .av-copy-btn {
+ background: transparent;
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ color: rgba(255, 255, 255, 0.4);
+ font-size: 0.618rem;
+ padding: 0.25rem 0.618rem;
+ border-radius: 6px;
+ cursor: pointer;
+ font-family: inherit;
+ transition: color 0.15s, border-color 0.15s;
+ }
+
+ .av-copy-btn:hover {
+ color: rgba(255, 255, 255, 0.8);
+ border-color: rgba(255, 255, 255, 0.2);
+ }
+
+ .av-copy-btn.copied {
+ color: #4ade80;
+ border-color: rgba(74, 222, 128, 0.3);
+ }
+
+ .av-root {
+ max-width: 960px;
+ margin: 0 auto;
+ padding: 2.5rem 1.5rem 5rem;
+ width: 100%;
+ flex: 1;
+ }
+
+ .av-layout {
+ display: grid;
+ grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.2fr);
+ gap: 2rem;
+ align-items: start;
+ }
+
+ .av-viewer {
+ background: radial-gradient(ellipse at center, rgba(154, 140, 255, 0.04) 0%, transparent 70%),
+ rgba(255, 255, 255, 0.02);
+ border: 1px solid rgba(255, 255, 255, 0.07);
+ border-radius: 16px;
+ overflow: hidden;
+ aspect-ratio: 1 / 1;
+ }
+
+ .av-viewer model-viewer {
+ width: 100%;
+ height: 100%;
+ }
+
+ .av-info {
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
+ }
+
+ .av-name {
+ font-size: 1.618rem;
+ font-weight: 400;
+ color: #e5e5e5;
+ letter-spacing: -0.02em;
+ margin: 0;
+ line-height: 1.2;
+ }
+
+ .av-by {
+ font-size: 0.764rem;
+ color: rgba(255, 255, 255, 0.3);
+ margin: 0;
+ }
+
+ .av-by a {
+ color: rgba(154, 140, 255, 0.8);
+ text-decoration: none;
+ }
+
+ .av-by a:hover {
+ color: #9a8cff;
+ }
+
+ .av-desc {
+ font-size: 0.875rem;
+ color: rgba(255, 255, 255, 0.5);
+ line-height: 1.6;
+ margin: 0;
+ }
+
+ .av-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.382rem;
+ }
+
+ .av-tag {
+ font-size: 0.618rem;
+ padding: 0.2rem 0.618rem;
+ border-radius: 999px;
+ background: rgba(154, 140, 255, 0.08);
+ border: 1px solid rgba(154, 140, 255, 0.2);
+ color: rgba(154, 140, 255, 0.7);
+ }
+
+ .av-actions {
+ display: flex;
+ gap: 0.75rem;
+ flex-wrap: wrap;
+ margin-top: 0.5rem;
+ }
+
+ .av-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.382rem;
+ padding: 0.5rem 1.2rem;
+ border-radius: 8px;
+ font-size: 0.764rem;
+ font-family: inherit;
+ cursor: pointer;
+ text-decoration: none;
+ transition: opacity 0.15s;
+ border: none;
+ }
+
+ .av-btn:hover {
+ opacity: 0.8;
+ }
+
+ .av-btn-primary {
+ background: #9a8cff;
+ color: #000;
+ font-weight: 500;
+ }
+
+ .av-btn-sec {
+ background: transparent;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ color: rgba(255, 255, 255, 0.6);
+ }
+
+ .av-meta {
+ font-size: 0.618rem;
+ color: rgba(255, 255, 255, 0.2);
+ margin-top: 1rem;
+ }
+
+ .av-error {
+ text-align: center;
+ color: rgba(255, 255, 255, 0.3);
+ font-size: 0.875rem;
+ padding: 4rem 1rem;
+ }
+
+ @media (max-width: 600px) {
+ .av-layout {
+ grid-template-columns: 1fr;
+ }
+ }
+ </style>
+ </head>
+ <body>
+ <header class="av-header">
+ <a href="/" aria-label="Back to three.ws">← three.ws</a>
+ <button class="av-copy-btn" id="copy-btn">copy link</button>
+ </header>
+
+ <main>
+ <div class="av-root" id="av-root">
+ <div class="av-error">Loading…</div>
+ </div>
+ </main>
+
+ <footer class="h-footer-horizon">
+ <div class="h-footer-glow-line" aria-hidden="true"></div>
+ <div class="h-footer-floor" aria-hidden="true"></div>
+ <div class="h-footer-haze" aria-hidden="true"></div>
+ <div class="h-footer-watermark" aria-hidden="true">three.ws</div>
+ <div class="h-footer-inner">
+ <div class="h-footer-brand-col">
+ <div class="h-footer-brand">
+ <span class="wordmark-dot" aria-hidden="true"></span>
+ <span>three.ws</span>
+ </div>
+ <p class="h-footer-tagline">Give your AI a body.</p>
+ </div>
+ <nav class="h-footer-links" aria-label="Footer">
+ <a href="/create">Create</a>
+ <a href="/discover">Discover</a>
+ <a href="/dashboard">Dashboard</a>
+ </nav>
+ </div>
+ <div class="h-footer-bottom">
+ <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
+ </div>
+ </footer>
+
+ <script type="module">
+ const esc = (s) =>
+ String(s ?? '').replace(
+ /[&<>"']/g,
+ (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c],
+ );
+
+ const root = document.getElementById('av-root');
+ const segments = location.pathname.split('/').filter(Boolean);
+ const id = segments[1]; // /avatars/<id>
+
+ if (!id) {
+ root.innerHTML = `<div class="av-error">No avatar specified.</div>`;
+ } else {
+ load(id);
+ }
+
+ async function load(avatarId) {
+ let avatar;
+ try {
+ const res = await fetch(`/api/avatars/${encodeURIComponent(avatarId)}`);
+ if (!res.ok) {
+ const data = await res.json().catch(() => ({}));
+ throw new Error(data.error_description || res.statusText);
+ }
+ avatar = (await res.json()).avatar;
+ } catch (err) {
+ root.innerHTML = `<div class="av-error">${esc(err.message)}</div>`;
+ return;
+ }
+
+ if (!avatar.model_url) {
+ root.innerHTML = `<div class="av-error">This avatar is private.</div>`;
+ return;
+ }
+
+ // OG / title
+ document.title = `${avatar.name} — three.ws`;
+ document.querySelector('#og-title')?.setAttribute('content', avatar.name);
+ document.querySelector('#og-description')?.setAttribute(
+ 'content',
+ avatar.description || `A 3D avatar on three.ws`,
+ );
+ document.querySelector('#og-url')?.setAttribute('content', location.href);
+ document.querySelector('#tw-title')?.setAttribute('content', avatar.name);
+ document.querySelector('#tw-description')?.setAttribute(
+ 'content',
+ avatar.description || `A 3D avatar on three.ws`,
+ );
+ if (avatar.thumbnail_url) {
+ document.querySelector('#og-image')?.setAttribute('content', avatar.thumbnail_url);
+ }
+
+ const tagsHtml = (avatar.tags || [])
+ .map((t) => `<span class="av-tag">${esc(t)}</span>`)
+ .join('');
+
+ const byLine = avatar.owner_username
+ ? `<p class="av-by">by <a href="/u/${esc(avatar.owner_username)}">@${esc(avatar.owner_username)}</a></p>`
+ : '';
+
+ const sizeStr = avatar.size_bytes
+ ? `${(avatar.size_bytes / 1_048_576).toFixed(1)} MB`
+ : '';
+ const dateStr = avatar.created_at
+ ? new Date(avatar.created_at).toLocaleDateString()
+ : '';
+
+ root.innerHTML = `
+ <div class="av-layout">
+ <div class="av-viewer">
+ <model-viewer
+ src="${esc(avatar.model_url)}"
+ camera-controls
+ auto-rotate
+ rotation-per-second="12deg"
+ shadow-intensity="1"
+ exposure="1"
+ tone-mapping="aces"
+ ></model-viewer>
+ </div>
+ <div class="av-info">
+ <h1 class="av-name">${esc(avatar.name)}</h1>
+ ${byLine}
+ ${avatar.description ? `<p class="av-desc">${esc(avatar.description)}</p>` : ''}
+ ${tagsHtml ? `<div class="av-tags">${tagsHtml}</div>` : ''}
+ <div class="av-actions">
+ <a class="av-btn av-btn-primary" href="/dashboard">Use this avatar</a>
+ <a class="av-btn av-btn-sec" href="${esc(avatar.model_url)}" download>Download GLB</a>
+ </div>
+ <p class="av-meta">${[sizeStr, avatar.source, dateStr].filter(Boolean).join(' · ')}</p>
+ </div>
+ </div>
+ `;
+ }
+
+ // Copy link button
+ document.getElementById('copy-btn').addEventListener('click', async () => {
+ const btn = document.getElementById('copy-btn');
+ try {
+ await navigator.clipboard.writeText(location.href);
+ btn.textContent = 'copied ✓';
+ btn.classList.add('copied');
+ setTimeout(() => {
+ btn.textContent = 'copy link';
+ btn.classList.remove('copied');
+ }, 1800);
+ } catch {}
+ });
+ </script>
+ </body>
+</html>
diff --git a/profile.html b/profile.html
index 08f07becb..919bfb9d3 100644
--- a/profile.html
+++ b/profile.html
@@ -396,29 +396,99 @@
<script type="module">
import { mountUserProfile } from './src/erc8004/user-profile.js';
- // Address comes from the URL: /u/0x...
+ const esc = (s) =>
+ String(s ?? '').replace(
+ /[&<>"']/g,
+ (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c],
+ );
+ const attr = (s) => esc(s).replace(/"/g, '&quot;');
+
const segments = location.pathname.split('/').filter(Boolean);
- const address = segments[1]; // /u/<address>
+ const slug = segments[1]; // /u/<slug>
const root = document.getElementById('profile-root');
const copyBtn = document.getElementById('copy-profile-btn');
- if (!address || !/^0x[0-9a-fA-F]{40}$/.test(address)) {
- root.innerHTML = `<div class="up-error">Invalid address. Use /u/0x…</div>`;
- } else {
- // Update page title and OG
- const short = address.slice(0, 6) + '…' + address.slice(-4);
+ if (!slug) {
+ root.innerHTML = `<div class="up-error">No profile specified.</div>`;
+ } else if (/^0x[0-9a-fA-F]{40}$/.test(slug)) {
+ // Legacy: on-chain wallet address profile
+ const short = slug.slice(0, 6) + '…' + slug.slice(-4);
document.title = `${short} — Agents`;
- const profileUrl = `${location.origin}/u/${address}`;
+ const profileUrl = `${location.origin}/u/${slug}`;
document.querySelector('#og-title')?.setAttribute('content', `${short} — Agents`);
- document.querySelector('#og-description')?.setAttribute('content', `On-chain agent identity profile for ${address}`);
+ document.querySelector('#og-description')?.setAttribute('content', `On-chain agent identity profile for ${slug}`);
document.querySelector('#og-url')?.setAttribute('content', profileUrl);
document.querySelector('#tw-title')?.setAttribute('content', `${short} — Agents`);
- document.querySelector('#tw-description')?.setAttribute('content', `On-chain agent identity profile for ${address}`);
-
- mountUserProfile(root, address).catch((err) => {
- root.innerHTML = `<div class="up-error">Could not load profile: ${err.message}</div>`;
+ document.querySelector('#tw-description')?.setAttribute('content', `On-chain agent identity profile for ${slug}`);
+ mountUserProfile(root, slug).catch((err) => {
+ root.innerHTML = `<div class="up-error">Could not load profile: ${esc(err.message)}</div>`;
});
+ } else {
+ // Username-based profile
+ mountUsernameProfile(root, slug).catch((err) => {
+ root.innerHTML = `<div class="up-error">Could not load profile: ${esc(err.message)}</div>`;
+ });
+ }
+
+ async function mountUsernameProfile(rootEl, username) {
+ rootEl.innerHTML = `<div class="up-error">Loading…</div>`;
+
+ const res = await fetch(`/api/users/${encodeURIComponent(username)}`);
+ if (!res.ok) {
+ const data = await res.json().catch(() => ({}));
+ const msg = res.status === 404 ? 'User not found.' : (data.error_description || res.statusText);
+ rootEl.innerHTML = `<div class="up-error">${esc(msg)}</div>`;
+ return;
+ }
+ const { user, avatars } = await res.json();
+
+ // Update page meta
+ const title = `@${user.username} — three.ws`;
+ document.title = title;
+ const profileUrl = `${location.origin}/u/${encodeURIComponent(user.username)}`;
+ document.querySelector('#og-title')?.setAttribute('content', title);
+ document.querySelector('#og-description')?.setAttribute('content', `${user.display_name || user.username}'s avatars on three.ws`);
+ document.querySelector('#og-url')?.setAttribute('content', profileUrl);
+ document.querySelector('#tw-title')?.setAttribute('content', title);
+ document.querySelector('#tw-description')?.setAttribute('content', `${user.display_name || user.username}'s public avatars on three.ws`);
+
+ const avatarCards = avatars.map((a) => {
+ const thumb = a.thumbnail_url
+ ? `<img src="${attr(a.thumbnail_url)}" alt="${attr(a.name)}" style="width:100%;height:100%;object-fit:cover">`
+ : `<div class="up-card-thumb-placeholder">◎</div>`;
+ const tags = (a.tags || []).slice(0, 3).map((t) => `<span style="font-size:0.55rem;color:rgba(154,140,255,0.6);margin-right:4px">#${esc(t)}</span>`).join('');
+ return `
+ <article class="up-card">
+ <a href="/avatars/${attr(a.id)}" class="up-card-thumb-link" tabindex="-1" aria-hidden="true">
+ <div class="up-card-thumb">${thumb}</div>
+ </a>
+ <div class="up-card-body">
+ <a href="/avatars/${attr(a.id)}" class="up-card-name">${esc(a.name)}</a>
+ ${a.description ? `<p class="up-card-desc">${esc(a.description)}</p>` : ''}
+ <div class="up-card-footer">
+ <div>${tags}</div>
+ </div>
+ </div>
+ </article>
+ `;
+ }).join('');
+
+ rootEl.innerHTML = `
+ <div class="up-hero">
+ <div class="up-avatar-ring">
+ <span class="up-avatar-glyph">◎</span>
+ </div>
+ <div class="up-hero-info">
+ <h1 class="up-address">${esc(user.display_name || user.username)}</h1>
+ <p class="up-muted">@${esc(user.username)}</p>
+ <p class="up-muted" style="margin-top:4px">${avatars.length} public avatar${avatars.length === 1 ? '' : 's'}</p>
+ </div>
+ </div>
+ <div class="up-grid">
+ ${avatarCards || `<p class="up-empty">No public avatars yet.</p>`}
+ </div>
+ `;
}
// Copy profile URL to clipboard
diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.js
index 02760879e..505f094e7 100644
--- a/public/dashboard/dashboard.js
+++ b/public/dashboard/dashboard.js
@@ -85,6 +85,7 @@ const tabs = {
keys: renderKeys,
mcp: renderMcp,
billing: renderBilling,
+ account: renderAccount,
};
// ── Avatars ─────────────────────────────────────────────────────────────────
@@ -496,94 +497,19 @@ async function getAvaturnSDK() {
function renderCreate(root) {
root.innerHTML = `
- <div class="toolbar">
- <div>
- <h1>Create avatar</h1>
- <p class="sub">Design a 3D avatar and save it to your account.</p>
- </div>
- <button class="btn sec" id="avaturn-restart" type="button" style="display:none">Start over</button>
+ <div>
+ <h1>Create avatar</h1>
+ <p class="sub">Design a 3D avatar from a selfie.</p>
</div>
- <div id="avaturn-stage" class="card" style="padding:0; overflow:hidden; min-height:640px; position:relative">
- <div id="avaturn-intro" style="padding:32px; text-align:center">
- <div style="font-size:42px; line-height:1; margin-bottom:12px">🧍</div>
- <p style="margin:0 0 18px; color:#ccc">
- Customize your 3D avatar — body type, outfit, hair, and more.
- It auto-saves here when you click Export.
- </p>
- <button class="btn" id="avaturn-launch" type="button">Open avatar editor</button>
- </div>
- <div id="avaturn-container" style="display:none; width:100%; height:640px; position:relative"></div>
- <div id="avaturn-progress" class="muted" style="padding:16px 20px; border-top:1px solid var(--border); display:none"></div>
+ <div class="empty" style="margin-top:24px; padding:60px 32px">
+ <div style="font-size:48px; line-height:1; margin-bottom:16px">🧍</div>
+ <div style="font-size:18px; font-weight:600; margin-bottom:8px; color:#eee">Coming soon</div>
+ <p style="margin:0 0 20px; color:#888; max-width:380px; margin-left:auto; margin-right:auto; font-size:14px">
+ Avatar creation from a selfie is under development. In the meantime you can upload an existing .glb file.
+ </p>
+ <a href="#upload" class="btn">Upload a .glb instead</a>
</div>
`;
-
- const launchBtn = root.querySelector('#avaturn-launch');
- const restartBtn = root.querySelector('#avaturn-restart');
- const intro = root.querySelector('#avaturn-intro');
- const container = root.querySelector('#avaturn-container');
- const progress = root.querySelector('#avaturn-progress');
-
- const say = (msg, isError = false) => {
- progress.style.display = 'block';
- progress.style.color = isError ? '#ffb3b3' : '#888';
- progress.textContent = msg;
- };
-
- let sdk = null;
-
- const start = async () => {
- launchBtn.disabled = true;
- launchBtn.textContent = 'Loading…';
- try {
- const AvaturnSDK = await getAvaturnSDK();
- sdk = new AvaturnSDK();
- await sdk.init(container, {});
- intro.style.display = 'none';
- container.style.display = 'block';
- restartBtn.style.display = 'inline-block';
- progress.style.display = 'none';
-
- sdk.on('export', async (data) => {
- const glbUrl = data?.url;
- if (!glbUrl) {
- say('No avatar URL returned', true);
- return;
- }
- say('Saving avatar…');
- try {
- const blob = await fetchGlbBlob(glbUrl, data?.urlType);
- const avatar = await saveAvaturnAvatar(blob);
- say(`Saved "${avatar.name}". Redirecting…`);
- setTimeout(() => {
- location.hash = 'avatars';
- }, 600);
- } catch (err) {
- say(err.message || 'Failed to save avatar', true);
- }
- });
- } catch (err) {
- say(err.message || 'Failed to load editor', true);
- launchBtn.disabled = false;
- launchBtn.textContent = 'Open avatar editor';
- }
- };
-
- const stop = () => {
- if (sdk) {
- sdk.destroy();
- sdk = null;
- }
- container.style.display = 'none';
- container.innerHTML = '';
- intro.style.display = 'block';
- restartBtn.style.display = 'none';
- progress.style.display = 'none';
- launchBtn.disabled = false;
- launchBtn.textContent = 'Open avatar editor';
- };
-
- launchBtn.addEventListener('click', start);
- restartBtn.addEventListener('click', stop);
}
async function fetchGlbBlob(url, urlType) {
@@ -707,6 +633,13 @@ async function renderEdit(root, params = []) {
</select>
</label>
<label style="display:block;margin-top:12px">Tags (comma separated)<input id="etags" value="${attr((avatar.tags || []).join(', '))}" style="width:100%"></label>
+ <div id="epublink" style="margin-top:16px;${avatar.visibility === 'private' ? 'display:none' : ''}">
+ <p class="muted" style="margin:0 0 6px;font-size:11px">Public link</p>
+ <div class="row" style="gap:6px;align-items:center">
+ <input id="epublinkval" readonly value="${attr(location.origin + '/avatars/' + avatar.id)}" style="width:100%;font-size:12px;color:#9a8cff;cursor:text">
+ <button id="ecopybtn" class="btn sec" type="button" style="white-space:nowrap;flex-shrink:0">Copy</button>
+ </div>
+ </div>
<div id="emsg" class="muted" style="margin-top:12px"></div>
<div class="row" style="gap:8px; margin-top:16px">
<button class="btn" type="submit">Save changes</button>
@@ -740,6 +673,24 @@ async function renderEdit(root, params = []) {
}
});
+ // Show/hide public link when visibility changes
+ body.querySelector('#evis').addEventListener('change', (e) => {
+ const publink = body.querySelector('#epublink');
+ if (publink) publink.style.display = e.target.value === 'private' ? 'none' : '';
+ });
+
+ // Copy public link
+ body.querySelector('#ecopybtn')?.addEventListener('click', async () => {
+ const btn = body.querySelector('#ecopybtn');
+ const val = body.querySelector('#epublinkval')?.value;
+ if (!val) return;
+ try {
+ await navigator.clipboard.writeText(val);
+ btn.textContent = 'Copied ✓';
+ setTimeout(() => (btn.textContent = 'Copy'), 1800);
+ } catch {}
+ });
+
body.querySelector('#euse').addEventListener('click', async () => {
msg.style.color = '#888';
msg.textContent = 'Linking to your agent…';
@@ -1751,6 +1702,104 @@ async function hydrateWidgetPrefsFromRemote() {
}
}
+// ── Account ──────────────────────────────────────────────────────────────────
+async function renderAccount(root) {
+ root.innerHTML = `
+ <h1>Account</h1>
+ <p class="sub">Set your username to get a public profile at three.ws/u/username.</p>
+ <div class="card" style="max-width:480px" id="acct-form-wrap">
+ <div class="muted">Loading…</div>
+ </div>
+ `;
+
+ const wrap = root.querySelector('#acct-form-wrap');
+ let user;
+ try {
+ const data = await api.me();
+ user = data.user;
+ } catch (err) {
+ wrap.innerHTML = `<div class="err">${esc(err.message)}</div>`;
+ return;
+ }
+
+ const profileUrl = user.username
+ ? `${location.origin}/u/${encodeURIComponent(user.username)}`
+ : null;
+
+ wrap.innerHTML = `
+ <form id="acct-form">
+ <label style="display:block">
+ Display name
+ <input id="acct-name" value="${attr(user.display_name || '')}" maxlength="60" placeholder="Your name" style="width:100%">
+ </label>
+ <label style="display:block;margin-top:12px">
+ Username
+ <input id="acct-username" value="${attr(user.username || '')}" maxlength="30" placeholder="e.g. nirholas" style="width:100%" autocomplete="off" spellcheck="false">
+ <span class="muted" style="font-size:11px;display:block;margin-top:4px">Letters, numbers, _ and - only. 3–30 characters.</span>
+ </label>
+ ${profileUrl ? `
+ <div style="margin-top:12px">
+ <p class="muted" style="font-size:11px;margin:0 0 4px">Your public profile</p>
+ <div class="row" style="gap:6px;align-items:center">
+ <a href="${attr(profileUrl)}" target="_blank" style="font-size:12px;color:#9a8cff;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${esc(profileUrl)}</a>
+ <button id="acct-copy" class="btn sec" type="button" style="flex-shrink:0;white-space:nowrap">Copy</button>
+ </div>
+ </div>
+ ` : ''}
+ <div id="acct-msg" class="muted" style="margin-top:12px"></div>
+ <div class="row" style="gap:8px;margin-top:16px">
+ <button class="btn" type="submit">Save</button>
+ </div>
+ </form>
+ `;
+
+ const msg = wrap.querySelector('#acct-msg');
+
+ wrap.querySelector('#acct-form').addEventListener('submit', async (e) => {
+ e.preventDefault();
+ msg.style.color = '#888';
+ msg.textContent = 'Saving…';
+ const username = wrap.querySelector('#acct-username').value.trim();
+ const display_name = wrap.querySelector('#acct-name').value.trim();
+ const patch = {};
+ if (username) patch.username = username;
+ if (display_name) patch.display_name = display_name;
+ if (!Object.keys(patch).length) {
+ msg.style.color = '#ffb3b3';
+ msg.textContent = 'No changes.';
+ return;
+ }
+ try {
+ const res = await fetch('/api/auth/profile', {
+ method: 'PATCH',
+ credentials: 'include',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify(patch),
+ });
+ const data = await res.json();
+ if (!res.ok) throw new Error(data.error_description || res.statusText);
+ msg.style.color = '#9a8cff';
+ msg.textContent = 'Saved.';
+ if (data.user.username) {
+ const url = `${location.origin}/u/${encodeURIComponent(data.user.username)}`;
+ msg.innerHTML = `Saved. Your profile is at <a href="${attr(url)}" target="_blank" style="color:#9a8cff">${esc(url)}</a>`;
+ }
+ } catch (err) {
+ msg.style.color = '#ffb3b3';
+ msg.textContent = err.message;
+ }
+ });
+
+ wrap.querySelector('#acct-copy')?.addEventListener('click', async () => {
+ const btn = wrap.querySelector('#acct-copy');
+ try {
+ await navigator.clipboard.writeText(profileUrl);
+ btn.textContent = 'Copied ✓';
+ setTimeout(() => (btn.textContent = 'Copy'), 1800);
+ } catch {}
+ });
+}
+
async function renderWidgets(root) {
await hydrateWidgetPrefsFromRemote();
const prefs = loadWidgetPrefs();
diff --git a/public/dashboard/index.html b/public/dashboard/index.html
index 0c96b5934..f177893ee 100644
--- a/public/dashboard/index.html
+++ b/public/dashboard/index.html
@@ -5,6 +5,10 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Dashboard · three.ws</title>
<link rel="icon" href="/favicon.ico" />
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet" />
+ <link rel="stylesheet" href="/footer.css" />
<style>
:root {
color-scheme: dark;
@@ -36,30 +40,70 @@
header {
display: flex;
align-items: center;
- justify-content: space-between;
- padding: 16px 24px;
+ gap: 12px;
+ padding: 0 24px;
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
- background: var(--bg);
+ background: rgba(11, 11, 16, 0.92);
+ backdrop-filter: blur(16px);
+ -webkit-backdrop-filter: blur(16px);
z-index: 5;
+ height: 60px;
}
- .brand {
- font-weight: 600;
- letter-spacing: -0.01em;
+ header h1 {
+ margin: 0;
+ font-size: inherit;
+ font-weight: inherit;
+ flex-shrink: 0;
}
- nav a {
- margin-right: 14px;
- color: #aaa;
- font-size: 14px;
+ header h1 a {
+ display: flex;
+ align-items: center;
+ }
+ .wordmark-logo {
+ height: 1.55rem;
+ width: auto;
+ display: block;
+ }
+ .dash-header-nav {
+ display: flex;
+ align-items: center;
+ gap: 2px;
+ margin-left: 4px;
+ flex: 1;
+ overflow-x: auto;
+ scrollbar-width: none;
}
- nav a.active {
+ .dash-header-nav::-webkit-scrollbar { display: none; }
+ .dash-header-nav a {
+ padding: 6px 10px;
+ border-radius: 6px;
+ color: #888;
+ font-size: 13px;
+ text-decoration: none;
+ transition: color 0.15s, background 0.15s;
+ white-space: nowrap;
+ }
+ .dash-header-nav a:hover {
+ color: #eee;
+ background: rgba(255, 255, 255, 0.05);
+ }
+ .dash-header-nav a.active {
color: #fff;
+ background: rgba(106, 92, 255, 0.12);
+ }
+ .dash-header-user {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-shrink: 0;
+ margin-left: auto;
}
.layout {
display: grid;
grid-template-columns: 220px 1fr;
- min-height: calc(100vh - 57px);
+ min-height: calc(100vh - 60px);
}
aside {
border-right: 1px solid var(--border);
@@ -1057,8 +1101,21 @@
</head>
<body>
<header>
- <div class="brand"><a href="/">three.ws</a></div>
- <div class="row">
+ <h1>
+ <a href="/"><img src="/three.svg" alt="three.ws" class="wordmark-logo" /></a>
+ </h1>
+ <nav class="dash-header-nav" aria-label="Primary">
+ <a href="/app">Viewer</a>
+ <a href="/create">Create</a>
+ <a href="/discover">Discover</a>
+ <a href="/features">Features</a>
+ <a href="/widgets">Widgets</a>
+ <a href="/studio">Studio</a>
+ <a href="/docs/widgets">Docs</a>
+ <a href="/my-agents">My Agents</a>
+ <a href="/dashboard" class="active" aria-current="page">Dashboard</a>
+ </nav>
+ <div class="dash-header-user">
<span id="user-email" class="muted"></span>
<button class="btn sec" onclick="signOut()">Sign out</button>
</div>
@@ -1074,6 +1131,7 @@
<a href="#keys" data-tab="keys">API keys</a>
<a href="#mcp" data-tab="mcp">MCP</a>
<a href="#billing" data-tab="billing">Plan &amp; usage</a>
+ <a href="#account" data-tab="account">Account</a>
<a href="/dashboard/wallets">Wallets</a>
<a href="/discover" title="Browse on-chain agents across every supported chain"
>Discover on-chain ↗</a
@@ -1081,6 +1139,69 @@
</aside>
<main id="main"></main>
</div>
+ <footer class="h-footer-horizon">
+ <div class="h-footer-glow-line" aria-hidden="true"></div>
+ <div class="h-footer-floor" aria-hidden="true"></div>
+ <div class="h-footer-haze" aria-hidden="true"></div>
+ <div class="h-footer-watermark" aria-hidden="true">three.ws</div>
+ <div class="h-footer-avatar" aria-hidden="true">
+ <model-viewer
+ src="/animations/robotexpressive.glb"
+ auto-rotate
+ auto-rotate-delay="0"
+ rotation-per-second="20deg"
+ interaction-prompt="none"
+ camera-controls="false"
+ disable-zoom
+ shadow-intensity="0"
+ exposure="0.7"
+ environment-image="neutral"
+ camera-orbit="0deg 80deg 4m"
+ field-of-view="35deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ <div class="h-footer-inner">
+ <div class="h-footer-brand-col">
+ <div class="h-footer-brand">
+ <span class="wordmark-dot" aria-hidden="true"></span>
+ <span>three.ws</span>
+ </div>
+ <p class="h-footer-tagline">Give your AI a body.</p>
+ </div>
+ <nav class="h-footer-links" aria-label="Footer">
+ <a href="https://github.com/nirholas/3D" target="_blank" rel="noopener">GitHub</a>
+ <a href="/create">Create</a>
+ <a href="/studio">Studio</a>
+ <a href="/widgets">Widgets</a>
+ <a href="/features">Features</a>
+ <a href="/discover">Discover</a>
+ <a href="/showcase">Showcase</a>
+ <a href="/docs/widgets">Docs</a>
+ <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>
+ <a href="/legal/privacy">Privacy</a>
+ <a href="/legal/tos">Terms</a>
+ </nav>
+ </div>
+ <div class="h-footer-bottom">
+ <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
+ <div class="h-footer-badges">
+ <span class="h-footer-badge" aria-label="System status">
+ <span class="h-footer-status-dot" aria-hidden="true"></span>
+ <span>All systems normal</span>
+ </span>
+ <span class="h-footer-badge">
+ <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 14.5A6.5 6.5 0 1 1 8 1.5a6.5 6.5 0 0 1 0 13zm-1-9.25a1 1 0 1 1 2 0v3.5a1 1 0 1 1-2 0v-3.5zm1 6.5a1.1 1.1 0 1 1 0-2.2 1.1 1.1 0 0 1 0 2.2z"/></svg>
+ <span>Transparent by default</span>
+ </span>
+ <a class="h-footer-badge" href="https://github.com/nirholas/3D" target="_blank" rel="noopener" aria-label="View source on GitHub">
+ <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
+ <span>Open source</span>
+ </a>
+ </div>
+ </div>
+ </footer>
+
<script type="module">
import { state, api, navigate, signOut } from '/dashboard/dashboard.js';
window.signOut = signOut;
diff --git a/public/screenshots/create.png b/public/screenshots/create.png
new file mode 100644
index 000000000..4e6c037c3
Binary files /dev/null and b/public/screenshots/create.png differ
diff --git a/public/screenshots/discover.png b/public/screenshots/discover.png
new file mode 100644
index 000000000..6e14f29e8
Binary files /dev/null and b/public/screenshots/discover.png differ
diff --git a/public/screenshots/features.png b/public/screenshots/features.png
new file mode 100644
index 000000000..78a580d09
Binary files /dev/null and b/public/screenshots/features.png differ
diff --git a/public/screenshots/landing.png b/public/screenshots/landing.png
new file mode 100644
index 000000000..70a9bc20c
Binary files /dev/null and b/public/screenshots/landing.png differ
diff --git a/public/screenshots/studio.png b/public/screenshots/studio.png
new file mode 100644
index 000000000..1046440e4
Binary files /dev/null and b/public/screenshots/studio.png differ
diff --git a/public/screenshots/validation.png b/public/screenshots/validation.png
new file mode 100644
index 000000000..daf15a100
Binary files /dev/null and b/public/screenshots/validation.png differ
diff --git a/public/screenshots/viewer.png b/public/screenshots/viewer.png
new file mode 100644
index 000000000..616d4aad0
Binary files /dev/null and b/public/screenshots/viewer.png differ
diff --git a/src/app.js b/src/app.js
index bd177e732..32487eb40 100644
--- a/src/app.js
+++ b/src/app.js
@@ -463,6 +463,7 @@ class App {
try {
const user = await getMe();
if (link && user) link.classList.add('signed-in');
+ if (user) this._initUserMenu(user);
if (document.body.dataset.viewerMode === 'main') {
document.body.dataset.authed = user ? 'true' : 'false';
}
@@ -473,6 +474,46 @@ class App {
}
}
+ _initUserMenu(user) {
+ const wrap = document.getElementById('nav-user-wrap');
+ const btn = document.getElementById('nav-user-btn');
+ const menu = document.getElementById('nav-user-menu');
+ const label = document.getElementById('nav-user-label');
+ const profileLink = document.getElementById('nav-my-profile-link');
+ const signOutBtn = document.getElementById('nav-sign-out-btn');
+ if (!wrap || !btn || !menu) return;
+
+ if (label) label.textContent = user.email || user.username || 'Account';
+ if (profileLink && user.address) profileLink.href = `/u/${user.address}`;
+
+ wrap.hidden = false;
+
+ btn.addEventListener('click', (e) => {
+ e.stopPropagation();
+ const open = menu.hidden === false;
+ menu.hidden = open;
+ btn.setAttribute('aria-expanded', String(!open));
+ });
+
+ document.addEventListener('click', () => {
+ if (!menu.hidden) {
+ menu.hidden = true;
+ btn.setAttribute('aria-expanded', 'false');
+ }
+ });
+
+ menu.addEventListener('click', (e) => e.stopPropagation());
+
+ if (signOutBtn) {
+ signOutBtn.addEventListener('click', () => {
+ fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }).finally(() => {
+ try { localStorage.removeItem('3dagent:auth-hint'); } catch { /* ignore */ }
+ location.href = '/';
+ });
+ });
+ }
+ }
+
_refreshMakeWidgetButton() {
const btn = document.getElementById('make-widget-btn');
if (!btn) return;
diff --git a/style.css b/style.css
index dfb4658ec..d55193ba3 100644
--- a/style.css
+++ b/style.css
@@ -320,6 +320,73 @@ header h1 .wordmark-dot {
display: none;
}
+.nav-user-wrap {
+ position: relative;
+}
+
+.nav-user {
+ cursor: pointer;
+ background: none;
+ border: 1px solid rgba(255, 255, 255, 0.1);
+}
+
+.nav-user[aria-expanded='true'] {
+ border-color: rgba(255, 255, 255, 0.22);
+ background: rgba(255, 255, 255, 0.07);
+ color: rgba(255, 255, 255, 0.85);
+}
+
+.nav-user-menu {
+ position: absolute;
+ right: 0;
+ top: calc(100% + 6px);
+ min-width: 160px;
+ background: #0e0e16;
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: 10px;
+ padding: 4px;
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
+ z-index: 200;
+ display: flex;
+ flex-direction: column;
+}
+
+.nav-user-menu-item {
+ display: block;
+ padding: 8px 12px;
+ font-size: 13px;
+ color: rgba(255, 255, 255, 0.7);
+ text-decoration: none;
+ border-radius: 7px;
+ background: none;
+ border: 0;
+ cursor: pointer;
+ text-align: left;
+ font-family: inherit;
+ width: 100%;
+ transition: background 0.12s, color 0.12s;
+}
+
+.nav-user-menu-item:hover {
+ background: rgba(255, 255, 255, 0.07);
+ color: #fff;
+}
+
+.nav-user-menu-signout {
+ color: rgba(255, 100, 100, 0.8);
+}
+
+.nav-user-menu-signout:hover {
+ background: rgba(204, 64, 64, 0.12);
+ color: #ffb3b3;
+}
+
+.nav-user-menu-sep {
+ height: 1px;
+ background: rgba(255, 255, 255, 0.07);
+ margin: 4px 0;
+}
+
.gui-wrap {
position: absolute;
top: 0;
diff --git a/vercel.json b/vercel.json
index df8b142b6..a4c4e24f9 100644
--- a/vercel.json
+++ b/vercel.json
@@ -76,6 +76,9 @@
{ "src": "/api/a/(\\d+)/(\\d+)/og", "dest": "/api/a-og?chain=$1&id=$2" },
{ "src": "/api/oembed", "dest": "/api/agent-oembed" },
{ "src": "/u/([^/]+)", "dest": "/profile.html" },
+ { "src": "/avatars/([^/]+)", "dest": "/avatar-page.html" },
+ { "src": "/api/users/([^/]+)", "dest": "/api/users/[username]?username=$1" },
+ { "src": "/api/auth/profile", "dest": "/api/auth/profile" },
{ "src": "/a/(\\d+)/(\\d+)/edit", "dest": "/a-edit.html" },
{ "src": "/agent/([^/]+)/edit", "dest": "/agent-edit.html" },
{