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.

Refactor code structure for improved readability and maintainability

nirholasc68a05142063
diff --git a/README.md b/README.md
index 83acc1aa6..c091afbb1 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,11 @@ npm run claude -- [COMMAND]
| `db-status` | Checks the status of database migrations. |
| `pump-smoke-test` | Runs a smoke test for the pump.fun integration. |
| `seed-skills` | Seeds the skills from the `skills-manifest.js` file. |
-| `help` | Shows the help message, listing all available commands. |
+| `test` | Runs the full test suite. |
+| `format` | Formats the codebase using Prettier. |
+| `clean` | Cleans up all build artifacts and `dist/` folders. |
+| `deploy` | Deploys the project to Vercel (requires confirmation). |
+| `help` | Shows this help message, listing all available commands. |
---
diff --git a/agent-edit.html b/agent-edit.html
index 87889b5f1..963444a11 100644
--- a/agent-edit.html
+++ b/agent-edit.html
@@ -440,6 +440,16 @@
>
Publish
</button>
+ <button
+ class="edit-tab"
+ data-tab="monetization"
+ role="tab"
+ aria-selected="false"
+ aria-controls="panel-monetization"
+ id="tab-monetization"
+ >
+ Monetization
+ </button>
</div>
<main id="main">
diff --git a/api/_lib/auth.js b/api/_lib/auth.js
index 4d20fa4b4..f94639f0f 100644
--- a/api/_lib/auth.js
+++ b/api/_lib/auth.js
@@ -182,7 +182,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.username, u.plan, u.avatar_url, u.wallet_address, u.is_admin
+ u.id, u.email, u.display_name, u.username, u.plan, u.avatar_url, u.wallet_address, u.is_admin, u.referral_code
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/referrals.js b/api/_lib/referrals.js
new file mode 100644
index 000000000..30196a9d4
--- /dev/null
+++ b/api/_lib/referrals.js
@@ -0,0 +1,19 @@
+import { randomBytes } from 'crypto';
+
+/**
+ * Generates a random, human-readable referral code.
+ * @param {number} length The desired length of the code.
+ * @returns {string} A random referral code.
+ */
+export function generateReferralCode(length = 8) {
+ // Using a base32-like alphabet to avoid ambiguous characters (0/O, 1/I/l)
+ const alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ';
+ let code = '';
+ const randomValues = randomBytes(length);
+
+ for (let i = 0; i < length; i++) {
+ code += alphabet[randomValues[i] % alphabet.length];
+ }
+
+ return code;
+}
diff --git a/api/_lib/validate.js b/api/_lib/validate.js
index bc1274a1e..d820fd80e 100644
--- a/api/_lib/validate.js
+++ b/api/_lib/validate.js
@@ -30,11 +30,13 @@ export const registerBody = z.object({
email,
password,
display_name: displayName.optional(),
+ referralCode: z.string().trim().min(3).max(30).optional(),
});
export const usernameRegisterBody = z.object({
username,
password,
+ referralCode: z.string().trim().min(3).max(30).optional(),
});
export const loginBody = z.object({
diff --git a/api/auth/[action].js b/api/auth/[action].js
index dcdff49e8..fc443299a 100644
--- a/api/auth/[action].js
+++ b/api/auth/[action].js
@@ -14,6 +14,7 @@ import { cors, json, method, readJson, wrap, error } from '../_lib/http.js';
import { limits, clientIp } from '../_lib/rate-limit.js';
import { parse, loginBody, registerBody, usernameRegisterBody, username as usernameValidator, displayName, email, password } from '../_lib/validate.js';
import { sendPasswordResetEmail, sendVerificationEmail } from '../_lib/email.js';
+import { generateReferralCode } from '../_lib/referrals.js';
import { z } from 'zod';
const APP_ORIGIN = process.env.APP_ORIGIN || 'https://three.ws';
@@ -29,8 +30,8 @@ async function handleLogin(req, res) {
const body = parse(loginBody, await readJson(req));
const isEmail = body.email.includes('@');
const rows = isEmail
- ? await sql`select id, email, password_hash, display_name, plan, avatar_url from users where email = ${body.email} and deleted_at is null limit 1`
- : await sql`select id, email, password_hash, display_name, plan, avatar_url from users where display_name ilike ${body.email} and deleted_at is null limit 1`;
+ ? await sql`select id, email, password_hash, display_name, plan, avatar_url, referral_code from users where email = ${body.email} and deleted_at is null limit 1`
+ : await sql`select id, email, password_hash, display_name, plan, avatar_url, referral_code from users where display_name ilike ${body.email} and deleted_at is null limit 1`;
const user = rows[0];
const ok = user && (await verifyPassword(body.password, user.password_hash));
if (!ok) return error(res, 401, 'invalid_credentials', 'invalid username/email or password');
@@ -77,23 +78,36 @@ async function handleRegister(req, res) {
const rl = await limits.registerIp(ip);
if (!rl.success) return error(res, 429, 'rate_limited', 'too many signups from this IP');
const raw = await readJson(req);
- let email_val, displayName_val, passwordVal;
+ let email_val, displayName_val, passwordVal, referralCode;
if (raw.username && !raw.email) {
const body = parse(usernameRegisterBody, raw);
const safe = body.username.toLowerCase().replace(/[^a-z0-9_-]/g, '_');
email_val = `${safe}@users.three.ws.local`;
displayName_val = body.username;
passwordVal = body.password;
+ referralCode = body.referralCode;
const existing = await sql`select id from users where display_name ilike ${body.username} and deleted_at is null limit 1`;
if (existing[0]) return error(res, 409, 'conflict', 'email or username already in use');
} else {
const body = parse(registerBody, raw);
email_val = body.email; displayName_val = body.display_name ?? null; passwordVal = body.password;
+ referralCode = body.referralCode;
const existing = await sql`select id from users where email = ${email_val} and deleted_at is null limit 1`;
if (existing[0]) return error(res, 409, 'conflict', 'email or username already in use');
}
+
+ let referred_by_id = null;
+ if (referralCode) {
+ const [referrer] = await sql`select id from users where referral_code = ${referralCode}`;
+ if (referrer) {
+ referred_by_id = referrer.id;
+ }
+ }
+
const hash = await hashPassword(passwordVal);
- const [user] = await sql`insert into users (email, password_hash, display_name) values (${email_val}, ${hash}, ${displayName_val}) returning id, display_name, plan, created_at`;
+ // TODO: loop until referral code is unique
+ const newReferralCode = generateReferralCode();
+ const [user] = await sql`insert into users (email, password_hash, display_name, referred_by_id, referral_code) values (${email_val}, ${hash}, ${displayName_val}, ${referred_by_id}, ${newReferralCode}) returning id, display_name, plan, created_at, referral_code`;
await destroySession(req);
const token = await createSession({ userId: user.id, userAgent: req.headers['user-agent'], ip });
res.setHeader('set-cookie', sessionCookie(token));
diff --git a/api/marketplace.js b/api/marketplace.js
new file mode 100644
index 000000000..206153664
--- /dev/null
+++ b/api/marketplace.js
@@ -0,0 +1,51 @@
+export default (req, res) => {
+ const agents = [
+ {
+ "id": "1",
+ "name": "Creative Writer",
+ "description": "An AI assistant for brainstorming and writing creative content.",
+ "author": "GPT-4",
+ "category": "Copywriting",
+ "tags": ["writing", "creative", "blogging"],
+ "published": "2024-05-15",
+ "views": "1.2k",
+ "forks": "128",
+ "avatar": "✍️",
+ "prompt": "You are an AI assistant specialized in creative writing. Help users brainstorm ideas, write stories, and craft compelling content.",
+ "greeting": "Hello! I'm here to help you write something amazing. What's on your mind?",
+ "versions": [{ "version": "1.0", "date": "2024-05-15", "notes": "Initial release." }]
+ },
+ {
+ "id": "2",
+ "name": "Code Companion",
+ "description": "Your AI pair programmer. Helps with debugging, writing tests, and learning new languages.",
+ "author": "Claude 3",
+ "category": "Programming",
+ "tags": ["code", "development", "debugging"],
+ "published": "2024-05-14",
+ "views": "2.5k",
+ "forks": "342",
+ "avatar": "💻",
+ "prompt": "You are a friendly and helpful AI pair programmer. Assist users with their coding tasks, from simple scripts to complex applications.",
+ "greeting": "Hey there! I'm ready to code. What are we working on today?",
+ "versions": [{ "version": "1.0", "date": "2024-05-14", "notes": "Initial release." }]
+ },
+ {
+ "id": "3",
+ "name": "Solana Sage",
+ "description": "An expert on the Solana blockchain. Can answer questions about SPL tokens, DeFi, and more.",
+ "author": "Solana Labs",
+ "category": "Blockchain",
+ "tags": ["solana", "crypto", "blockchain"],
+ "published": "2024-05-12",
+ "views": "3.1k",
+ "forks": "512",
+ "avatar": "🔗",
+ "prompt": "You are an expert on the Solana blockchain. Provide accurate and up-to-date information about Solana, its ecosystem, and its technology.",
+ "greeting": "Welcome! I'm here to answer all your questions about the Solana blockchain.",
+ "versions": [{ "version": "1.0", "date": "2024-05-12", "notes": "Initial release." }]
+ }
+ ];
+
+ res.status(200).json(agents);
+}
\ No newline at end of file
diff --git a/api/pump/[action].js b/api/pump/[action].js
index c71d51a27..16216103a 100644
--- a/api/pump/[action].js
+++ b/api/pump/[action].js
@@ -107,6 +107,7 @@ export default async function dispatcher(req, res) {
if (req.query?.action === 'strategy-run') return handleStrategyRun(req, res);
if (req.query?.action === 'vanity-keygen') return handleVanityKeygen(req, res);
if (req.query?.action === 'live-stream') return handleLiveStream(req, res);
+ if (req.query?.action === 'trades-stream') return handleTradesStream(req, res);
return wrapped(req, res);
}
diff --git a/api/users/[username].js b/api/users/[username].js
index 18eb243e5..7b3e39402 100644
--- a/api/users/[username].js
+++ b/api/users/[username].js
@@ -16,7 +16,7 @@ export default wrap(async (req, res) => {
if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
const [user] = await sql`
- select id, display_name, username, created_at
+ select id, display_name, username, created_at, referral_code
from users
where lower(username) = ${username} and deleted_at is null
limit 1
@@ -45,6 +45,7 @@ export default wrap(async (req, res) => {
user: {
username: user.username,
display_name: user.display_name || user.username,
+ referral_code: user.referral_code,
},
avatars,
});
diff --git a/api/users/referrals.js b/api/users/referrals.js
new file mode 100644
index 000000000..0a5a6909e
--- /dev/null
+++ b/api/users/referrals.js
@@ -0,0 +1,41 @@
+import { sql } from '../_lib/db.js';
+import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';
+import { cors, json, error, method, wrap } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ const session = await getSessionUser(req);
+ const bearer = session ? null : await authenticateBearer(extractBearer(req));
+ if (!session && !bearer) return error(res, 401, 'unauthorized', 'sign in required');
+ const userId = session?.id ?? bearer.userId;
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const [user] = await sql`
+ SELECT
+ referral_code,
+ referral_earnings_total
+ FROM users
+ WHERE id = ${userId}
+ `;
+
+ if (!user) {
+ return error(res, 404, 'not_found', 'user not found');
+ }
+
+ const [referralCount] = await sql`
+ SELECT COUNT(*) as count
+ FROM users
+ WHERE referred_by_id = ${userId}
+ `;
+
+ return json(res, 200, {
+ referral_code: user.referral_code,
+ referral_earnings_total: user.referral_earnings_total,
+ referred_users_count: parseInt(referralCount.count, 10),
+ });
+});
diff --git a/character-studio/src/App.jsx b/character-studio/src/App.jsx
index 673ff5a20..3ba01d881 100644
--- a/character-studio/src/App.jsx
+++ b/character-studio/src/App.jsx
@@ -21,6 +21,7 @@ import Mint from "./pages/Mint"
import Optimizer from "./pages/Optimizer"
import Save from "./pages/Save"
import Wallet from "./pages/Wallet"
+import Studio from "./pages/Studio"
// dynamically import the manifest
const assetImportPath = import.meta.env.VITE_ASSET_PATH + "/manifest.json"
@@ -159,6 +160,7 @@ export default function App() {
[ViewMode.LOAD]: <Load />,
[ViewMode.MINT]: <Mint />,
[ViewMode.SAVE]: <Save />,
+ [ViewMode.STUDIO]: <Studio />,
}
let lastTap = 0
diff --git a/character-studio/src/pages/Studio.jsx b/character-studio/src/pages/Studio.jsx
new file mode 100644
index 000000000..0709b681b
--- /dev/null
+++ b/character-studio/src/pages/Studio.jsx
@@ -0,0 +1,25 @@
+import React from "react"
+
+import styles from "./Studio.module.css"
+
+const Studio = () => {
+ return (
+ <div className={styles.container}>
+ <div className={styles.leftPanel}>
+ {/* Agent Brain Configuration */}
+ <h2>Agent Brain</h2>
+ {/* Form elements for personality, skills, etc. */}
+ </div>
+ <div className={styles.centerPanel}>
+ {/* This is where the 3D viewport will be rendered */}
+ </div>
+ <div className={styles.rightPanel}>
+ {/* Appearance Customization */}
+ <h2>Appearance</h2>
+ {/* Color pickers, texture selectors, etc. */}
+ </div>
+ </div>
+ )
+}
+
+export default Studio
diff --git a/character-studio/src/pages/Studio.module.css b/character-studio/src/pages/Studio.module.css
new file mode 100644
index 000000000..4cf394c89
--- /dev/null
+++ b/character-studio/src/pages/Studio.module.css
@@ -0,0 +1,25 @@
+.container {
+ display: grid;
+ grid-template-columns: 280px 1fr 280px;
+ height: 100vh;
+ width: 100vw;
+ color: white;
+}
+
+.leftPanel,
+.rightPanel {
+ background-color: rgba(0, 0, 0, 0.2);
+ padding: 1rem;
+ backdrop-filter: blur(10px);
+}
+
+.centerPanel {
+ /* The 3D scene will be rendered here */
+}
+
+h2 {
+ font-size: 1.2rem;
+ margin-bottom: 1rem;
+ text-transform: uppercase;
+ letter-spacing: 0.1em;
+}
diff --git a/claude.sh b/claude.sh
index ae640b881..a6e353698 100644
--- a/claude.sh
+++ b/claude.sh
@@ -8,31 +8,63 @@ set -e
# management. It's a single entry point for various SDK and agent-related
# tasks.
#
-# Usage: ./claude.sh [COMMAND]
+# Usage: ./claude.sh [COMMAND] [OPTIONS]
#
# Commands:
# install-sdk Install and build the local agent SDKs.
# validate-cards Validate the agent cards.
-# db-migrate Apply database migrations.
+# db-migrate Apply database migrations (with confirmation).
# db-status Check the status of database migrations.
# pump-smoke-test Run the pump.fun smoke test.
# seed-skills Seed the skills from the manifest.
+# test Run the test suite.
+# format Format the codebase with Prettier.
+# clean Clean up build artifacts.
+# deploy Deploy the project to Vercel (with confirmation).
# help Show this help message.
# ---
-# --- Configuration ---
+# --- Configuration & Colors ---
# Root directory of the project
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+# Color codes
+COLOR_RESET='\033[0m'
+COLOR_RED='\033[0;31m'
+COLOR_GREEN='\033[0;32m'
+COLOR_YELLOW='\033[0;33m'
+COLOR_BLUE='\033[0;34m'
+COLOR_CYAN='\033[0;36m'
+
# --- Helper Functions ---
function print_header() {
- echo "--- $1 ---"
+ echo -e "${COLOR_BLUE}--- $1 ---${COLOR_RESET}"
}
function print_success() {
- echo "✅ Success: $1"
+ echo -e "${COLOR_GREEN}✅ Success: $1${COLOR_RESET}"
+}
+
+function print_warning() {
+ echo -e "${COLOR_YELLOW}⚠️ Warning: $1${COLOR_RESET}"
}
+function print_error() {
+ echo -e "${COLOR_RED}❌ Error: $1${COLOR_RESET}"
+ exit 1
+}
+
+function confirm_action() {
+ print_warning "$1"
+ read -p "Are you sure you want to continue? (y/N) " -n 1 -r
+ echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+ echo "Operation cancelled."
+ exit 0
+ fi
+}
+
+
# --- Commands ---
# Install and build the local agent SDKs
@@ -59,6 +91,7 @@ function validate_cards() {
# Apply database migrations
function db_migrate() {
print_header "Applying Database Migrations"
+ confirm_action "This will apply all pending migrations to the database."
cd "$ROOT_DIR"
npm run db:migrate
print_success "Database migrations applied."
@@ -87,10 +120,47 @@ function seed_skills() {
print_success "Skills seeded."
}
+# Run the test suite
+function test() {
+ print_header "Running Tests"
+ cd "$ROOT_DIR"
+ npm run test
+ print_success "Tests completed."
+}
+
+# Format the codebase
+function format() {
+ print_header "Formatting Code"
+ cd "$ROOT_DIR"
+ npm run format
+ print_success "Codebase formatted."
+}
+
+# Clean up build artifacts
+function clean() {
+ print_header "Cleaning Project"
+ cd "$ROOT_DIR"
+ npm run clean
+ print_success "Project cleaned."
+}
+
+# Deploy the project
+function deploy() {
+ print_header "Deploying Project"
+ confirm_action "This will deploy the project to Vercel."
+ cd "$ROOT_DIR"
+ npm run deploy
+ print_success "Project deployed."
+}
+
# Show the help message
function help() {
# Extract the help text from the script's header comments
- sed -n '/^# ---$/,/^# ---$/p' "$0" | sed 's/^# //g' | sed '1d;$d'
+ sed -n '/^# ---$/,/^# ---$/p' "$0" | sed 's/^# //g' | sed '1d;$d' | while read -r line; do
+ command=$(echo "$line" | awk '{print $1}')
+ description=$(echo "$line" | cut -d' ' -f2-)
+ printf " ${COLOR_CYAN}%-18s${COLOR_RESET} %s\n" "$command" "$description"
+ done
}
# --- Main Command Router ---
@@ -121,13 +191,24 @@ function main() {
seed-skills)
seed_skills
;;
+ test)
+ test
+ ;;
+ format)
+ format
+ ;;
+ clean)
+ clean
+ ;;
+ deploy)
+ deploy
+ ;;
help)
help
;;
*)
- echo "Error: Unknown command '$1'"
+ print_error "Unknown command '$1'"
help
- exit 1
;;
esac
}
diff --git a/migrations/001_add_referrals.sql b/migrations/001_add_referrals.sql
new file mode 100644
index 000000000..2d0424ec2
--- /dev/null
+++ b/migrations/001_add_referrals.sql
@@ -0,0 +1,14 @@
+-- Add referral_code to users table
+ALTER TABLE users ADD COLUMN referral_code VARCHAR(20) UNIQUE;
+
+-- Add referred_by_id to users table (foreign key to users.id)
+ALTER TABLE users ADD COLUMN referred_by_id INTEGER REFERENCES users(id);
+
+-- Add referral_earnings_total for tracking earnings
+ALTER TABLE users ADD COLUMN referral_earnings_total DECIMAL(12, 2) DEFAULT 0.00;
+
+-- Optional: Create an index on referral_code for faster lookups
+CREATE INDEX idx_users_referral_code ON users (referral_code);
+
+-- Optional: Create an index on referred_by_id
+CREATE INDEX idx_users_referred_by_id ON users (referred_by_id);
diff --git a/package.json b/package.json
index 436d44419..c22f4d20e 100644
--- a/package.json
+++ b/package.json
@@ -78,8 +78,8 @@
},
"dependencies": {
"@avaturn/sdk": "^1.1.4",
- "@aws-sdk/client-s3": "^3.651.0",
- "@aws-sdk/s3-request-presigner": "^3.651.0",
+ "@aws-sdk/client-s3": "latest",
+ "@aws-sdk/s3-request-presigner": "latest",
"@bonfida/spl-name-service": "^3.0.21",
"@chenglou/pretext": "^0.0.5",
"@coral-xyz/anchor": "^0.31.1",
@@ -101,7 +101,7 @@
"@solana/actions": "^1.6.6",
"@solana/kit": "^6.8.0",
"@solana/spl-token": "^0.4.14",
- "@solana/web3.js": "^1.98.4",
+ "@solana/web3.js": "latest",
"@upstash/ratelimit": "^2.0.5",
"@upstash/redis": "^1.34.3",
"@zauthx402/sdk": "^0.1.14",
@@ -118,13 +118,11 @@
"resend": "^6.12.2",
"sas-lib": "^1.0.10",
"simple-dropzone": "^0.8.3",
- "three": "^0.176.0",
+ "three": "latest",
"vhtml": "^2.2.0",
"viem": "^2.18.0",
"ws": "^8.20.0",
- "zod": "^3.23.8",
- "vite": "^5.3.6"
- },
+ "zod": "^3.23.8"
},
"devDependencies": {
"ajv": "^8.17.1",
@@ -132,9 +130,10 @@
"jsdom": "^29.1.0",
"playwright": "^1.45.1",
"prettier": "^3.2.5",
- "sharp": "^0.34.5",
- "vite-plugin-pwa": "^1.2.0",
- "vitest": "^1.6.0",
+ "sharp": "latest",
+ "vite": "latest",
+ "vite-plugin-pwa": "latest",
+ "vitest": "latest",
"workbox-build": "^7.4.0",
"workbox-window": "^7.4.0"
}
diff --git a/public/pumpfun.html b/public/pumpfun.html
index da01e2bf5..824f497e5 100644
--- a/public/pumpfun.html
+++ b/public/pumpfun.html
@@ -824,7 +824,8 @@
}
picker.customUrl.value = '';
const filename = parsed.pathname.split('/').pop();
- const name = filename ? filename.replace(/\.(glb|gltf|vrm)$/i, '') : 'Custom';
+ let name = filename ? filename.replace(/\.(glb|gltf|vrm)$/i, '') : 'Custom';
+ if (name.length > 24) name = name.slice(0, 24) + '…';
selectAvatar({ url: parsed.href, name, sub: shortenUrl(parsed.href) });
}
diff --git a/public/widgets-gallery/gallery.css b/public/widgets-gallery/gallery.css
index dee8823f9..564cbe886 100644
--- a/public/widgets-gallery/gallery.css
+++ b/public/widgets-gallery/gallery.css
@@ -375,7 +375,7 @@ body.gallery-body {
overflow: hidden;
background: #050505;
aspect-ratio: 1 / 1;
- min-height: 420px;
+ min-height: 300px;
width: 100%;
margin: 0 auto;
}
@@ -533,12 +533,14 @@ body.gallery-body {
border-radius: var(--radius-md);
padding: var(--space-sm);
font-family: var(--font-mono);
- font-size: var(--text-sm);
- color: rgba(229, 229, 229, 0.85);
+ font-size: 11px;
+ color: rgba(229, 229, 229, 0.75);
white-space: pre-wrap;
word-break: break-all;
overflow-x: auto;
- line-height: 1.6;
+ line-height: 1.55;
+ max-height: 5.5rem;
+ overflow-y: hidden;
}
.snippet code {
@@ -556,7 +558,7 @@ body.gallery-body {
.snippet-row button,
.snippet-row a {
flex: 1 1 auto;
- min-width: 110px;
+ min-width: 100px;
padding: var(--space-xs) var(--space-sm);
font-size: var(--text-sm);
background: rgba(255, 255, 255, 0.05);
@@ -569,7 +571,33 @@ body.gallery-body {
font-family: var(--font-body);
transition:
background 0.15s,
- border-color 0.15s;
+ border-color 0.15s,
+ color 0.15s;
+}
+
+/* "Copy iframe" is the primary action */
+.snippet-row button:first-child {
+ background: var(--blue);
+ border-color: var(--blue);
+ color: #fff;
+}
+
+.snippet-row button:first-child:hover {
+ background: #2563eb;
+ border-color: #2563eb;
+}
+
+/* "Open in Studio" sits quieter as a text link */
+.snippet-row a {
+ background: transparent;
+ color: rgba(229, 229, 229, 0.55);
+ border-color: transparent;
+}
+
+.snippet-row a:hover {
+ color: #fff;
+ background: rgba(255, 255, 255, 0.06);
+ border-color: rgba(255, 255, 255, 0.12);
}
.snippet-row button:hover,
diff --git a/pump-coin-page.html b/pump-coin-page.html
new file mode 100644
index 000000000..70da19776
--- /dev/null
+++ b/pump-coin-page.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<title>Pump.fun Coin</title>
+<style>
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
+ background-color: #121212;
+ color: #ffffff;
+ margin: 0;
+ padding: 20px;
+ }
+ .container {
+ max-width: 800px;
+ margin: auto;
+ background: #1e1e1e;
+ border: 1px solid #333;
+ border-radius: 8px;
+ padding: 20px;
+ }
+ .header {
+ display: flex;
+ align-items: center;
+ gap: 15px;
+ border-bottom: 1px solid #333;
+ padding-bottom: 15px;
+ margin-bottom: 20px;
+ }
+ .coin-img {
+ width: 64px;
+ height: 64px;
+ border-radius: 50%;
+ border: 2px solid #fff;
+ }
+ .coin-info h1 {
+ margin: 0;
+ font-size: 24px;
+ }
+ .coin-info .ticker {
+ color: #888;
+ font-size: 16px;
+ }
+ .description-box {
+ border: 1px solid #333;
+ background: #252525;
+ border-radius: 8px;
+ padding: 15px;
+ min-height: 200px;
+ }
+ h2 {
+ font-size: 18px;
+ color: #00ff41;
+ border-bottom: 1px solid #333;
+ padding-bottom: 10px;
+ }
+ .agent-embed {
+ width: 100%;
+ height: 400px;
+ border-radius: 8px;
+ border: 1px solid #333;
+ overflow: hidden;
+ }
+</style>
+</head>
+<body>
+ <div class="container">
+ <div class="header">
+ <img src="https://pump.fun/_next/image?url=%2Fandroid-chrome-512x512.png&w=128&q=75" alt="Coin" class="coin-img">
+ <div class="coin-info">
+ <h1>My 3D Agent Coin</h1>
+ <div class="ticker">$AGENT3D</div>
+ </div>
+ </div>
+ <h2>Description</h2>
+ <div class="description-box">
+ <p>This is a demonstration of embedding a 3D Agent on a pump.fun-style coin page. The agent below is rendered inside an iframe.</p>
+ <iframe class="agent-embed" src="/agent-embed.html?id=agent-test-ad415d18&bg=dark"></iframe>
+ <p>In a real-world scenario, websites like pump.fun would sanitize this description to prevent HTML and script injection for security reasons. This demo illustrates what would be possible if they allowed certain HTML elements like iframes.</p>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/pump-dashboard.html b/pump-dashboard.html
index 6d3c5f244..631637f30 100644
--- a/pump-dashboard.html
+++ b/pump-dashboard.html
@@ -411,6 +411,7 @@
<div class="section-label">Community</div>
<a href="/chat" data-page="chat"><span class="icon">💬</span> Chat</a>
<a href="/pumpdotfun" data-page="pumpfun"><span class="icon">🚀</span> Pump.fun</a>
+ <a href="/pump-coin-page.html"><span class="icon">🪙</span> Coin Page Demo</a>
<a href="#" data-page="animations"><span class="icon">🎬</span> Animations</a>
<div class="section-label">System</div>
diff --git a/src/agent-skills-scene.js b/src/agent-skills-scene.js
new file mode 100644
index 000000000..a9a25fbab
--- /dev/null
+++ b/src/agent-skills-scene.js
@@ -0,0 +1,136 @@
+/**
+ * 3D Scene Manipulation Skills
+ * ----------------------------
+ * Skills for creating and manipulating objects in the Three.js scene.
+ */
+import * as THREE from 'three';
+
+// Store a reference to the viewer instance
+let viewer;
+export function setSceneViewer(viewerInstance) {
+ viewer = viewerInstance;
+}
+
+/**
+ * @param {import('./agent-skills.js').AgentSkills} skills
+ */
+export function registerSceneSkills(skills) {
+ skills.register({
+ name: 'scene-create-object',
+ description: 'Create a new 3D object in the scene.',
+ instruction: `Create a 3D object with the specified shape, color, and position.`,
+ animationHint: 'gesture-magic',
+ voicePattern: 'Okay, creating a {{shape}}.',
+ mcpExposed: true,
+ inputSchema: {
+ type: 'object',
+ properties: {
+ shape: { type: 'string', description: 'The shape of the object (box, sphere, cone, cylinder)', enum: ['box', 'sphere', 'cone', 'cylinder'] },
+ color: { type: 'string', description: 'Color of the object (e.g., "#ff0000", "red")' },
+ position: { type: 'object', properties: { x: {type: 'number'}, y: {type: 'number'}, z: {type: 'number'} }, description: 'The x, y, z position of the object.'},
+ scale: { type: 'object', properties: { x: {type: 'number'}, y: {type: 'number'}, z: {type: 'number'} }, description: 'The x, y, z scale of the object.'}
+ },
+ required: ['shape'],
+ },
+ handler: async (args) => {
+ if (!viewer) return { success: false, output: '3D viewer is not available.' };
+
+ const { shape = 'box', color = '#ffffff', position = {x: 0, y: 1, z: 0}, scale = {x: 1, y: 1, z: 1} } = args;
+
+ let geometry;
+ switch (shape) {
+ case 'sphere':
+ geometry = new THREE.SphereGeometry(0.5, 32, 32);
+ break;
+ case 'cone':
+ geometry = new THREE.ConeGeometry(0.5, 1, 32);
+ break;
+ case 'cylinder':
+ geometry = new THREE.CylinderGeometry(0.5, 0.5, 1, 32);
+ break;
+ case 'box':
+ default:
+ geometry = new THREE.BoxGeometry(1, 1, 1);
+ break;
+ }
+
+ const material = new THREE.MeshStandardMaterial({ color: new THREE.Color(color) });
+ const mesh = new THREE.Mesh(geometry, material);
+ mesh.position.set(position.x, position.y, position.z);
+ mesh.scale.set(scale.x, scale.y, scale.z);
+ mesh.name = `${shape}_${Date.now()}`;
+
+ viewer.scene.add(mesh);
+ viewer.render();
+
+ return { success: true, output: `I've created a ${shape} in the scene.` };
+ },
+ });
+
+ skills.register({
+ name: 'scene-find-object',
+ description: 'Finds an object in the scene by its name.',
+ instruction: 'Find an object by its given name and return it.',
+ mcpExposed: true,
+ inputSchema: {
+ type: 'object',
+ properties: {
+ name: { type: 'string', description: 'The name of the object to find.' },
+ },
+ required: ['name'],
+ },
+ handler: async (args) => {
+ if (!viewer) return { success: false, output: '3D viewer is not available.' };
+ const object = viewer.scene.getObjectByName(args.name);
+ if (object) {
+ return { success: true, output: `Found object: ${args.name}`, data: { object } };
+ }
+ return { success: false, output: `Could not find an object named ${args.name}` };
+ }
+ });
+
+ skills.register({
+ name: 'scene-update-object',
+ description: 'Update properties of a 3D object in the scene.',
+ instruction: 'Update the color, position, rotation, or scale of a named object.',
+ animationHint: 'gesture-manipulate',
+ voicePattern: 'Okay, updating the {{name}}.',
+ mcpExposed: true,
+ inputSchema: {
+ type: 'object',
+ properties: {
+ name: { type: 'string', description: 'The name of the object to update.' },
+ color: { type: 'string', description: 'New color for the object (e.g., "#00ff00")' },
+ position: { type: 'object', properties: { x: {type: 'number'}, y: {type: 'number'}, z: {type: 'number'} }, description: 'New x, y, z position.'},
+ rotation: { type: 'object', properties: { x: {type: 'number'}, y: {type: 'number'}, z: {type: 'number'} }, description: 'New x, y, z Euler rotation in radians.'},
+ scale: { type: 'object', properties: { x: {type: 'number'}, y: {type: 'number'}, z: {type: 'number'} }, description: 'New x, y, z scale.'},
+ },
+ required: ['name'],
+ },
+ handler: async (args) => {
+ if (!viewer) return { success: false, output: '3D viewer is not available.' };
+ const { name, color, position, rotation, scale } = args;
+ const object = viewer.scene.getObjectByName(name);
+
+ if (!object) {
+ return { success: false, output: `Object not found: ${name}` };
+ }
+
+ if (color && object.material) {
+ object.material.color.set(new THREE.Color(color));
+ }
+ if (position) {
+ object.position.set(position.x, position.y, position.z);
+ }
+ if (rotation) {
+ object.rotation.set(rotation.x, rotation.y, rotation.z);
+ }
+ if (scale) {
+ object.scale.set(scale.x, scale.y, scale.z);
+ }
+
+ viewer.render();
+ return { success: true, output: `I've updated the ${name}.` };
+ },
+ });
+}
diff --git a/src/agent-skills.js b/src/agent-skills.js
index 01fa400cd..317f599f4 100644
--- a/src/agent-skills.js
+++ b/src/agent-skills.js
@@ -20,6 +20,7 @@ import { attachPumpFunMemoryHooks } from './agent-skills-pumpfun-hooks.js';
import { registerJupiterSkills } from './agent-skills-jupiter.js';
import { registerBlinksSkills } from './agent-skills-blinks.js';
import { registerNftSkills } from './agent-skills-nfts.js';
+import { registerSceneSkills } from './agent-skills-scene.js';
/**
* @typedef {Object} SkillContext
@@ -69,6 +70,7 @@ export class AgentSkills {
registerJupiterSkills(this);
registerBlinksSkills(this);
registerNftSkills(this);
+ registerSceneSkills(this);
}
// ── Registry ──────────────────────────────────────────────────────────────
diff --git a/src/marketplace.js b/src/marketplace.js
index ae3cc31b9..a0ac8ab72 100644
--- a/src/marketplace.js
+++ b/src/marketplace.js
@@ -5,7 +5,7 @@
* (5 tabs). Routing is path-based: /marketplace and /marketplace/agents/:id.
*/
-const API = '/api/marketplace';
+const API = '/api';
const CATEGORY_LABELS = {
academic: 'Academic',
@@ -22,6 +22,7 @@ const CATEGORY_LABELS = {
office: 'Office',
programming: 'Programming',
translation: 'Translation',
+ blockchain: 'Blockchain',
};
const state = {
@@ -135,16 +136,15 @@ async function loadList(reset = false) {
els.grid.innerHTML = '<div class="market-empty">Loading…</div>';
}
try {
- const url = new URL(`${API}/agents`, location.origin);
+ const url = new URL(`${API}/marketplace`, location.origin);
if (state.category) url.searchParams.set('category', state.category);
if (state.q) url.searchParams.set('q', state.q);
if (state.sort) url.searchParams.set('sort', state.sort);
if (state.cursor) url.searchParams.set('cursor', state.cursor);
const r = await fetch(url);
const j = await r.json();
- const items = j?.data?.items || [];
+ const items = j || [];
state.items = reset ? items : [...state.items, ...items];
- state.cursor = j?.data?.next_cursor || null;
renderGrid();
} catch (err) {
console.error('[marketplace] list', err);
@@ -168,20 +168,20 @@ function renderGrid() {
}
function renderCard(a) {
- const date = a.published_at ? formatDate(a.published_at) : '';
+ const date = a.published ? formatDate(a.published) : '';
const skills = (a.skills || []).length;
return `<div class="market-card-agent" data-id="${a.id}">
<div class="head">
- <div class="avatar">${initial(a.name)}</div>
+ <div class="avatar">${a.avatar}</div>
<div style="min-width:0;flex:1">
<div class="title">${escapeHtml(a.name || 'Untitled')}</div>
- <div class="author">${escapeHtml(a.author_name || 'Anonymous')}</div>
+ <div class="author">${escapeHtml(a.author || 'Anonymous')}</div>
</div>
</div>
<div class="desc">${escapeHtml(a.description || '')}</div>
<div class="stats">
- <span class="stat-pill">⊙ ${a.views_count || 0}</span>
- <span class="stat-pill">⑂ ${a.forks_count || 0}</span>
+ <span class="stat-pill">⊙ ${a.views || 0}</span>
+ <span class="stat-pill">⑂ ${a.forks || 0}</span>
${skills ? `<span class="stat-pill">▤ ${skills}</span>` : ''}
${a.has_paid_skills ? `<span class="stat-pill paid-badge">$ Paid</span>` : ''}
</div>
diff --git a/src/viewer/screenshot.js b/src/viewer/screenshot.js
index e9c094685..133274d58 100644
--- a/src/viewer/screenshot.js
+++ b/src/viewer/screenshot.js
@@ -1,7 +1,57 @@
+const WATERMARK_URL = '/three.svg';
+let watermarkImage = null;
+
+async function getWatermark() {
+ if (watermarkImage) return watermarkImage;
+ try {
+ const res = await fetch(WATERMARK_URL);
+ if (!res.ok) throw new Error('Failed to load watermark');
+ const svgText = await res.text();
+ const blob = new Blob([svgText], { type: 'image/svg+xml' });
+ const url = URL.createObjectURL(blob);
+ const img = new Image();
+ img.src = url;
+ await new Promise((resolve, reject) => {
+ img.onload = resolve;
+ img.onerror = reject;
+ });
+ watermarkImage = img;
+ return watermarkImage;
+ } catch (e) {
+ console.error('Failed to load watermark:', e);
+ return null;
+ }
+}
+
+getWatermark();
+
function _capture(viewer) {
- return new Promise((resolve) => {
+ return new Promise(async (resolve) => {
viewer.renderer.render(viewer.scene, viewer.activeCamera);
- viewer.renderer.domElement.toBlob(resolve, 'image/png');
+ const canvas = viewer.renderer.domElement;
+
+ const watermark = await getWatermark();
+
+ if (!watermark) {
+ canvas.toBlob(resolve, 'image/png');
+ return;
+ }
+
+ const tempCanvas = document.createElement('canvas');
+ const ctx = tempCanvas.getContext('2d');
+ tempCanvas.width = canvas.width;
+ tempCanvas.height = canvas.height;
+
+ ctx.drawImage(canvas, 0, 0);
+
+ const margin = canvas.width * 0.04;
+ const h = canvas.width * 0.05;
+ const w = (h / watermark.height) * watermark.width;
+ ctx.globalAlpha = 0.7;
+ ctx.drawImage(watermark, margin, canvas.height - h - margin, w, h);
+ ctx.globalAlpha = 1.0;
+
+ tempCanvas.toBlob(resolve, 'image/png');
});
}
diff --git a/tutorials.html b/tutorials.html
index be09b4c59..4a9844e63 100644
--- a/tutorials.html
+++ b/tutorials.html
@@ -1,38 +1,29 @@
<!doctype html>
-<html lang="en">
+<html lang="en" class="tutorials-page">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>three.ws — Tutorials</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="nirholas" />
- <meta
- name="description"
- content="Tutorials for creating and using 3D agents."
- />
+ <meta name="description" content="Step-by-step tutorials for embedding, customizing, and deploying 3D agents with three.ws." />
<meta name="theme-color" content="#000000" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="three.ws" />
<meta property="og:title" content="three.ws — Tutorials" />
- <meta
- property="og:description"
- content="Tutorials for creating and using 3D agents."
- />
- <meta property="og:url" content="/tutorials.html" />
+ <meta property="og:description" content="Step-by-step tutorials for embedding, customizing, and deploying 3D agents with three.ws." />
+ <meta property="og:url" content="https://three.ws/tutorials.html" />
<meta property="og:image" content="https://three.ws/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="three.ws — Tutorials" />
- <meta
- name="twitter:description"
- content="Tutorials for creating and using 3D agents."
- />
+ <meta name="twitter:description" content="Step-by-step tutorials for embedding, customizing, and deploying 3D agents with three.ws." />
<meta name="twitter:image" content="https://three.ws/og-image.png" />
- <link rel="canonical" href="/tutorials.html" />
+ <link rel="canonical" href="https://three.ws/tutorials.html" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/pwa-192x192.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
@@ -46,8 +37,359 @@
rel="stylesheet"
/>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
+
+ <style>
+ html.tutorials-page,
+ html.tutorials-page body {
+ overflow: auto !important;
+ height: auto !important;
+ }
+
+ .tutorials-page body {
+ display: block;
+ }
+
+ /* ── Page shell ──────────────────────────────────────────────── */
+
+ .tut-page {
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .tut-page header {
+ position: sticky;
+ top: 0;
+ z-index: 200;
+ flex-shrink: 0;
+ }
+
+ /* ── Hero ────────────────────────────────────────────────────── */
+
+ .tut-hero {
+ background: linear-gradient(180deg, #0a0608 0%, #07060b 60%, #06070b 100%);
+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);
+ padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 4vw, 2rem) clamp(2rem, 5vh, 3.5rem);
+ position: relative;
+ overflow: hidden;
+ }
+
+ .tut-hero::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background:
+ radial-gradient(ellipse 60% 80% at 15% 50%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
+ radial-gradient(ellipse 50% 60% at 85% 20%, rgba(255, 215, 106, 0.06) 0%, transparent 55%);
+ pointer-events: none;
+ }
+
+ .tut-hero-inner {
+ position: relative;
+ max-width: 780px;
+ }
+
+ .tut-hero-eyebrow {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 0.7rem;
+ font-weight: 600;
+ letter-spacing: 0.12em;
+ text-transform: uppercase;
+ color: rgba(139, 92, 246, 0.9);
+ margin-bottom: 1rem;
+ }
+
+ .tut-hero-eyebrow::before {
+ content: '';
+ display: block;
+ width: 18px;
+ height: 1px;
+ background: currentColor;
+ }
+
+ .tut-hero h1 {
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: clamp(2rem, 5vw, 3.25rem);
+ font-weight: 700;
+ letter-spacing: -0.025em;
+ color: #fff;
+ margin: 0 0 0.85rem;
+ line-height: 1.12;
+ }
+
+ .tut-hero p {
+ font-size: 1.05rem;
+ color: rgba(255, 255, 255, 0.52);
+ line-height: 1.65;
+ margin: 0;
+ max-width: 56ch;
+ }
+
+ /* ── Content area ────────────────────────────────────────────── */
+
+ .tut-content {
+ flex: 1;
+ background: #06070b;
+ padding: clamp(2.5rem, 6vh, 4rem) clamp(1.25rem, 4vw, 2rem);
+ }
+
+ .tut-content-inner {
+ max-width: 860px;
+ margin: 0 auto;
+ }
+
+ /* ── Tutorial cards ──────────────────────────────────────────── */
+
+ .tut-card {
+ background: rgba(255, 255, 255, 0.018);
+ border: 1px solid rgba(255, 255, 255, 0.07);
+ border-radius: 12px;
+ overflow: hidden;
+ transition: border-color 0.25s ease;
+ margin-bottom: 1.25rem;
+ }
+
+ .tut-card:hover {
+ border-color: rgba(255, 255, 255, 0.12);
+ }
+
+ .tut-card-head {
+ display: flex;
+ align-items: flex-start;
+ gap: 1.1rem;
+ padding: 1.5rem 1.75rem 1.25rem;
+ }
+
+ .tut-step-badge {
+ flex-shrink: 0;
+ width: 28px;
+ height: 28px;
+ border-radius: 8px;
+ background: rgba(139, 92, 246, 0.15);
+ border: 1px solid rgba(139, 92, 246, 0.3);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 0.72rem;
+ font-weight: 700;
+ color: #a78bfa;
+ margin-top: 2px;
+ }
+
+ .tut-card-title {
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 1.1rem;
+ font-weight: 700;
+ color: #fff;
+ letter-spacing: -0.01em;
+ margin: 0 0 0.35rem;
+ line-height: 1.3;
+ }
+
+ .tut-card-desc {
+ font-size: 0.9rem;
+ color: rgba(255, 255, 255, 0.5);
+ line-height: 1.6;
+ margin: 0;
+ }
+
+ .tut-card-desc code {
+ font-family: 'JetBrains Mono', ui-monospace, monospace;
+ font-size: 0.82em;
+ color: #c4b5fd;
+ }
+
+ /* ── Two-column body ─────────────────────────────────────────── */
+
+ .tut-card-body {
+ display: grid;
+ grid-template-columns: 1fr 220px;
+ border-top: 1px solid rgba(255, 255, 255, 0.06);
+ }
+
+ .tut-card-body--full {
+ grid-template-columns: 1fr;
+ }
+
+ /* ── Code block ──────────────────────────────────────────────── */
+
+ .tut-code-wrap {
+ position: relative;
+ background: #0b0c12;
+ border-right: 1px solid rgba(255, 255, 255, 0.06);
+ }
+
+ .tut-card-body--full .tut-code-wrap {
+ border-right: none;
+ }
+
+ .tut-code-wrap pre {
+ margin: 0;
+ padding: 1.25rem 1.5rem;
+ overflow-x: auto;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
+ }
+
+ .tut-code-wrap pre::-webkit-scrollbar { height: 4px; }
+ .tut-code-wrap pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
+
+ .tut-code-wrap code {
+ font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
+ font-size: 0.78rem;
+ line-height: 1.7;
+ color: #c4b5fd;
+ white-space: pre;
+ }
+
+ .tut-copy-btn {
+ position: absolute;
+ top: 0.65rem;
+ right: 0.65rem;
+ display: flex;
+ align-items: center;
+ gap: 0.3rem;
+ padding: 0.3rem 0.6rem;
+ border-radius: 6px;
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ background: rgba(255, 255, 255, 0.04);
+ color: rgba(255, 255, 255, 0.4);
+ font-family: 'Inter', sans-serif;
+ font-size: 0.68rem;
+ font-weight: 500;
+ cursor: pointer;
+ opacity: 0;
+ transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
+ letter-spacing: 0.02em;
+ }
+
+ .tut-code-wrap:hover .tut-copy-btn { opacity: 1; }
+
+ .tut-copy-btn:hover {
+ color: rgba(255, 255, 255, 0.85);
+ background: rgba(255, 255, 255, 0.08);
+ border-color: rgba(255, 255, 255, 0.15);
+ }
+
+ .tut-copy-btn.copied {
+ opacity: 1;
+ color: #4ade80;
+ border-color: rgba(74, 222, 128, 0.3);
+ background: rgba(74, 222, 128, 0.06);
+ }
+
+ .tut-copy-btn svg { width: 11px; height: 11px; flex-shrink: 0; }
+
+ /* ── model-viewer panel ──────────────────────────────────────── */
+
+ .tut-viewer-panel {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #080910;
+ min-height: 200px;
+ }
+
+ .tut-viewer-panel model-viewer {
+ width: 100%;
+ height: 220px;
+ background: transparent;
+ --poster-color: transparent;
+ }
+
+ /* ── CTA row ─────────────────────────────────────────────────── */
+
+ .tut-card-cta {
+ padding: 0.85rem 1.75rem;
+ border-top: 1px solid rgba(255, 255, 255, 0.05);
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ flex-wrap: wrap;
+ }
+
+ .tut-cta-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.35rem;
+ font-family: 'Inter', sans-serif;
+ font-size: 0.82rem;
+ font-weight: 500;
+ color: #a78bfa;
+ text-decoration: none;
+ transition: color 0.15s ease;
+ }
+
+ .tut-cta-link:hover { color: #c4b5fd; }
+ .tut-cta-link svg { width: 12px; height: 12px; transition: transform 0.15s ease; }
+ .tut-cta-link:hover svg { transform: translateX(2px); }
+
+ .tut-cta-sep { color: rgba(255, 255, 255, 0.15); font-size: 0.75rem; }
+
+ /* ── Step list (no-code tutorial) ────────────────────────────── */
+
+ .tut-steps {
+ padding: 1.25rem 1.75rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.85rem;
+ }
+
+ .tut-step-item {
+ display: flex;
+ gap: 0.9rem;
+ align-items: flex-start;
+ }
+
+ .tut-step-num {
+ flex-shrink: 0;
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ background: rgba(139, 92, 246, 0.12);
+ border: 1px solid rgba(139, 92, 246, 0.25);
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 0.62rem;
+ font-weight: 700;
+ color: #a78bfa;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 2px;
+ }
+
+ .tut-step-text {
+ font-size: 0.88rem;
+ color: rgba(255, 255, 255, 0.62);
+ line-height: 1.55;
+ margin: 0;
+ }
+
+ .tut-step-text strong { color: rgba(255, 255, 255, 0.88); font-weight: 600; }
+ .tut-step-text a { color: #a78bfa; text-decoration: none; }
+ .tut-step-text a:hover { color: #c4b5fd; }
+ .tut-step-text code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85em; color: #c4b5fd; }
+
+ /* ── Responsive ──────────────────────────────────────────────── */
+
+ @media (max-width: 640px) {
+ .tut-card-body { grid-template-columns: 1fr; }
+ .tut-viewer-panel {
+ border-top: 1px solid rgba(255, 255, 255, 0.06);
+ border-right: none;
+ }
+ .tut-viewer-panel model-viewer { height: 180px; }
+ }
+ </style>
</head>
- <body>
+ <body class="home-page tutorials-page tut-page">
+ <div class="cursor" id="cursor" aria-hidden="true"></div>
+ <a href="#main-content" class="h-skip-link">Skip to main content</a>
+
<header>
<h1>
<a href="/" aria-label="three.ws home"
@@ -61,135 +403,70 @@
<nav class="home-nav" aria-label="Primary">
<ul class="nav-root" role="menubar">
<li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
+ <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false" role="menuitem">
Build<span class="nav-caret" aria-hidden="true">▾</span>
</button>
<ul class="nav-menu" role="menu" aria-label="Build">
<li role="none">
- <a href="/create" role="menuitem"
- ><span class="nav-mi-title">Create agent</span
- ><span class="nav-mi-sub">Avatar + brain wizard</span></a
- >
+ <a href="/create" role="menuitem"><span class="nav-mi-title">Create agent</span><span class="nav-mi-sub">Avatar + brain wizard</span></a>
</li>
<li role="none">
- <a href="/app" role="menuitem"
- ><span class="nav-mi-title">Viewer</span
- ><span class="nav-mi-sub">Drag-and-drop GLB</span></a
- >
+ <a href="/app" role="menuitem"><span class="nav-mi-title">Viewer</span><span class="nav-mi-sub">Drag-and-drop GLB</span></a>
</li>
<li role="none">
- <a href="/validation" role="menuitem"
- ><span class="nav-mi-title">glTF Validator</span
- ><span class="nav-mi-sub">Khronos spec check</span></a
- >
- </li>
- <li role="none">
- <a href="/playground.html" role="menuitem"
- ><span class="nav-mi-title">Playground</span
- ><span class="nav-mi-sub">Experiment with agents</span></a
- >
+ <a href="/validation" role="menuitem"><span class="nav-mi-title">glTF Validator</span><span class="nav-mi-sub">Khronos spec check</span></a>
</li>
</ul>
</li>
<li role="none"><a href="/discover" role="menuitem">Discover</a></li>
<li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
+ <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false" role="menuitem">
Solana<span class="nav-caret" aria-hidden="true">▾</span>
</button>
<ul class="nav-menu" role="menu" aria-label="Solana">
<li role="none">
- <a href="/pumpfun" role="menuitem"
- ><span class="nav-mi-title">Pump.fun stream</span
- ><span class="nav-mi-sub">Mint agent tokens</span></a
- >
+ <a href="/pumpfun" role="menuitem"><span class="nav-mi-title">Pump.fun stream</span><span class="nav-mi-sub">Mint agent tokens</span></a>
</li>
<li role="none">
- <a href="/vanity-wallet" role="menuitem"
- ><span class="nav-mi-title">Vanity wallet</span
- ><span class="nav-mi-sub">Grind a Solana address</span></a
- >
+ <a href="/vanity-wallet" role="menuitem"><span class="nav-mi-title">Vanity wallet</span><span class="nav-mi-sub">Grind a Solana address</span></a>
</li>
<li role="none">
- <a href="/strategy-lab" role="menuitem"
- ><span class="nav-mi-title">Strategy Lab</span
- ><span class="nav-mi-sub">DCA + subscriptions</span></a
- >
+ <a href="/strategy-lab" role="menuitem"><span class="nav-mi-title">Strategy Lab</span><span class="nav-mi-sub">DCA + subscriptions</span></a>
</li>
<li role="none">
- <a href="/pump-live.html" role="menuitem"
- ><span class="nav-mi-title">Live launches</span
- ><span class="nav-mi-sub">Real-time mint feed</span></a
- >
+ <a href="/pump-live.html" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a>
</li>
<li role="none">
- <a href="/pump-dashboard.html" role="menuitem"
- ><span class="nav-mi-title">Pump Dashboard</span
- ><span class="nav-mi-sub">Watches · scanner · quotes</span></a
- >
+ <a href="/pump-dashboard.html" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a>
</li>
<li role="none">
- <a href="/docs#solana" role="menuitem"
- ><span class="nav-mi-title">Solana SDK</span
- ><span class="nav-mi-sub">Attestations + agent-kit</span></a
- >
+ <a href="/docs#solana" role="menuitem"><span class="nav-mi-title">Solana SDK</span><span class="nav-mi-sub">Attestations + agent-kit</span></a>
</li>
</ul>
</li>
<li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
+ <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false" role="menuitem">
Embed<span class="nav-caret" aria-hidden="true">▾</span>
</button>
<ul class="nav-menu" role="menu" aria-label="Embed">
<li role="none">
- <a href="/studio" role="menuitem"
- ><span class="nav-mi-title">Widget Studio</span
- ><span class="nav-mi-sub">Pick avatar → copy snippet</span></a
- >
+ <a href="/studio" role="menuitem"><span class="nav-mi-title">Widget Studio</span><span class="nav-mi-sub">Pick avatar → copy snippet</span></a>
</li>
<li role="none">
- <a href="/artifact" role="menuitem"
- ><span class="nav-mi-title">Artifact viewer</span
- ><span class="nav-mi-sub">Claude artifact bundle</span></a
- >
+ <a href="/artifact" role="menuitem"><span class="nav-mi-title">Artifact viewer</span><span class="nav-mi-sub">Claude artifact bundle</span></a>
</li>
<li role="none">
- <a href="/docs#embedding" role="menuitem"
- ><span class="nav-mi-title">Embed docs</span
- ><span class="nav-mi-sub">iframe + oEmbed</span></a
- >
+ <a href="/docs#embedding" role="menuitem"><span class="nav-mi-title">Embed docs</span><span class="nav-mi-sub">iframe + oEmbed</span></a>
</li>
<li role="none">
- <a href="/docs#web-component" role="menuitem"
- ><span class="nav-mi-title">&lt;agent-3d&gt;</span
- ><span class="nav-mi-sub">Web component reference</span></a
- >
+ <a href="/docs#web-component" role="menuitem"><span class="nav-mi-title">&lt;agent-3d&gt;</span><span class="nav-mi-sub">Web component reference</span></a>
</li>
</ul>
</li>
+ <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
<li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
- <li class="nav-item" role="none"><a href="/docs" role="menuitem">Docs</a></li>
- <li class="nav-item" role="none">
- <a href="/features" role="menuitem">Features</a>
- </li>
- <li class="nav-item" role="none"><a href="/tutorials.html" role="menuitem">Tutorials</a></li>
+ <li class="nav-item" role="none"><a href="/features" role="menuitem">Features</a></li>
+ <li class="nav-item" role="none"><a href="/tutorials.html" role="menuitem" aria-current="page">Tutorials</a></li>
<li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>
<a href="/my-agents" id="home-nav-my-agents" role="menuitem">My Agents</a>
</li>
@@ -197,76 +474,475 @@
<a href="/dashboard" id="home-nav-user" class="nav-user" role="menuitem"></a>
</li>
<li class="nav-item" role="none">
- <a href="/login" class="nav-cta" id="home-nav-cta" role="menuitem"
- >Get started</a
- >
+ <a href="/login" class="nav-cta" id="home-nav-cta" role="menuitem">Get started</a>
</li>
</ul>
</nav>
</header>
- <main id="main-content" class="h-container">
- <section>
- <h1>Tutorials</h1>
- <p>Here you will find tutorials on how to create and use 3D agents.</p>
-
- <h2>1. Basic Embedding</h2>
- <p>Embed your 3D agent into any web page with a simple script tag.</p>
- <div style="display: flex; gap: 1rem;">
- <div style="flex-grow: 1;">
- <pre><code>&lt;script src="https://three.ws/cdn/agent-3d.js" data-agent-id="YOUR_AGENT_ID"&gt;&lt;/script&gt;</code></pre>
- </div>
- <div style="width: 200px; height: 200px;">
- <model-viewer src="/animations/robotexpressive.glb" camera-controls auto-rotate></model-viewer>
- </div>
+
+ <main id="main-content">
+ <div class="tut-hero">
+ <div class="tut-hero-inner">
+ <p class="tut-hero-eyebrow">Tutorials</p>
+ <h1>Build with 3D agents</h1>
+ <p>From a one-liner embed to on-chain identity — everything you need to ship a 3D agent in your app.</p>
</div>
+ </div>
+
+ <div class="tut-content">
+ <div class="tut-content-inner">
+
+ <!-- 1. Embed in 30 seconds -->
+ <article class="tut-card">
+ <div class="tut-card-head">
+ <div class="tut-step-badge" aria-hidden="true">1</div>
+ <div>
+ <h2 class="tut-card-title">Embed in 30 seconds</h2>
+ <p class="tut-card-desc">Drop one script tag into any HTML page. Your agent loads, auto-sizes, and starts animating immediately.</p>
+ </div>
+ </div>
+ <div class="tut-card-body">
+ <div class="tut-code-wrap">
+ <button class="tut-copy-btn" aria-label="Copy code">
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="4" y="4" width="9" height="11" rx="1.5"/><path d="M3 11V3a1 1 0 0 1 1-1h8"/></svg>
+ Copy
+ </button>
+ <pre><code>&lt;!-- Paste before &lt;/body&gt; on any page --&gt;
+&lt;script
+ src="https://three.ws/cdn/agent-3d.js"
+ data-agent-id="YOUR_AGENT_ID"
+&gt;&lt;/script&gt;</code></pre>
+ </div>
+ <div class="tut-viewer-panel">
+ <model-viewer
+ src="/animations/robotexpressive.glb"
+ camera-controls
+ auto-rotate
+ auto-rotate-delay="1000"
+ rotation-per-second="18deg"
+ interaction-prompt="none"
+ shadow-intensity="0"
+ exposure="0.85"
+ environment-image="neutral"
+ camera-orbit="0deg 75deg 5m"
+ field-of-view="35deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ </div>
+ <div class="tut-card-cta">
+ <a href="/create" class="tut-cta-link">
+ Create your agent
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ <span class="tut-cta-sep">·</span>
+ <a href="/docs#embedding" class="tut-cta-link">
+ Full embedding docs
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ </div>
+ </article>
+
+ <!-- 2. Customization -->
+ <article class="tut-card">
+ <div class="tut-card-head">
+ <div class="tut-step-badge" aria-hidden="true">2</div>
+ <div>
+ <h2 class="tut-card-title">Customize appearance</h2>
+ <p class="tut-card-desc">Control size, background, corner placement, and animation speed entirely through <code>data-*</code> attributes — no JavaScript required.</p>
+ </div>
+ </div>
+ <div class="tut-card-body">
+ <div class="tut-code-wrap">
+ <button class="tut-copy-btn" aria-label="Copy code">
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="4" y="4" width="9" height="11" rx="1.5"/><path d="M3 11V3a1 1 0 0 1 1-1h8"/></svg>
+ Copy
+ </button>
+ <pre><code>&lt;script
+ src="https://three.ws/cdn/agent-3d.js"
+ data-agent-id="YOUR_AGENT_ID"
+ data-size="320"
+ data-background-color="transparent"
+ data-position="bottom-right"
+ data-rotation-speed="20"
+&gt;&lt;/script&gt;</code></pre>
+ </div>
+ <div class="tut-viewer-panel">
+ <model-viewer
+ src="/animations/soldier.glb"
+ camera-controls
+ auto-rotate
+ auto-rotate-delay="800"
+ rotation-per-second="22deg"
+ interaction-prompt="none"
+ shadow-intensity="0"
+ exposure="0.9"
+ environment-image="neutral"
+ camera-orbit="0deg 80deg 4.5m"
+ field-of-view="38deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ </div>
+ <div class="tut-card-cta">
+ <a href="/studio" class="tut-cta-link">
+ Open Widget Studio
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ <span class="tut-cta-sep">·</span>
+ <a href="/docs#web-component" class="tut-cta-link">
+ All data attributes
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ </div>
+ </article>
+
+ <!-- 3. JavaScript API -->
+ <article class="tut-card">
+ <div class="tut-card-head">
+ <div class="tut-step-badge" aria-hidden="true">3</div>
+ <div>
+ <h2 class="tut-card-title">JavaScript API</h2>
+ <p class="tut-card-desc">Listen for the <code>ready</code> event, trigger animations, and send speech — drive your agent from any app logic.</p>
+ </div>
+ </div>
+ <div class="tut-card-body">
+ <div class="tut-code-wrap">
+ <button class="tut-copy-btn" aria-label="Copy code">
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="4" y="4" width="9" height="11" rx="1.5"/><path d="M3 11V3a1 1 0 0 1 1-1h8"/></svg>
+ Copy
+ </button>
+ <pre><code>&lt;script
+ src="https://three.ws/cdn/agent-3d.js"
+ data-agent-id="YOUR_AGENT_ID"
+ id="my-agent"
+&gt;&lt;/script&gt;
- <h2>2. Customization</h2>
- <p>Customize your agent's appearance and behavior using data attributes.</p>
- <div style="display: flex; gap: 1rem;">
- <div style="flex-grow: 1;">
- <pre><code>&lt;script src="https://three.ws/cdn/agent-3d.js"
- data-agent-id="YOUR_AGENT_ID"
- data-size="300"
- data-background-color="#000000"&gt;&lt;/script&gt;</code></pre>
+&lt;script&gt;
+ const agent = document.getElementById('my-agent');
+
+ agent.addEventListener('ready', () => {
+ agent.playAnimation('wave');
+ });
+
+ // Trigger from anywhere in your app
+ document.querySelector('#checkout-btn')
+ .addEventListener('click', () => {
+ agent.speak('Order placed! Check your inbox.');
+ agent.playAnimation('celebrate');
+ });
+&lt;/script&gt;</code></pre>
+ </div>
+ <div class="tut-viewer-panel">
+ <model-viewer
+ src="/avatars/cz.glb"
+ camera-controls
+ auto-rotate
+ auto-rotate-delay="2000"
+ rotation-per-second="12deg"
+ interaction-prompt="auto"
+ shadow-intensity="0"
+ exposure="0.85"
+ environment-image="neutral"
+ camera-orbit="0deg 78deg 5m"
+ field-of-view="36deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ </div>
+ <div class="tut-card-cta">
+ <a href="/docs#js-api" class="tut-cta-link">
+ Full JS API reference
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ </div>
+ </article>
+
+ <!-- 4. Widget Studio -->
+ <article class="tut-card">
+ <div class="tut-card-head">
+ <div class="tut-step-badge" aria-hidden="true">4</div>
+ <div>
+ <h2 class="tut-card-title">Widget Studio — no code</h2>
+ <p class="tut-card-desc">Pick an avatar visually, configure behavior with toggles, then copy a ready-to-paste snippet. Zero typing required.</p>
+ </div>
+ </div>
+ <div class="tut-card-body tut-card-body--full">
+ <div class="tut-steps">
+ <div class="tut-step-item">
+ <div class="tut-step-num">1</div>
+ <p class="tut-step-text">Go to <strong><a href="/studio">Widget Studio</a></strong> — browse the avatar gallery and click the one you want.</p>
+ </div>
+ <div class="tut-step-item">
+ <div class="tut-step-num">2</div>
+ <p class="tut-step-text">Use the panel on the right to set <strong>size, position, background,</strong> and the greeting message your agent will say on load.</p>
+ </div>
+ <div class="tut-step-item">
+ <div class="tut-step-num">3</div>
+ <p class="tut-step-text">Click <strong>Copy snippet</strong>. Paste the script tag before the closing <code>&lt;/body&gt;</code> of your page. Done.</p>
+ </div>
+ <div class="tut-step-item">
+ <div class="tut-step-num">4</div>
+ <p class="tut-step-text">Changes to your agent's name, avatar, or behavior sync live — no need to update the snippet on your site.</p>
+ </div>
+ </div>
+ </div>
+ <div class="tut-card-cta">
+ <a href="/studio" class="tut-cta-link">
+ Open Widget Studio
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ </div>
+ </article>
+
+ <!-- 5. On-chain identity -->
+ <article class="tut-card">
+ <div class="tut-card-head">
+ <div class="tut-step-badge" aria-hidden="true">5</div>
+ <div>
+ <h2 class="tut-card-title">On-chain agent identity</h2>
+ <p class="tut-card-desc">Give your agent a verifiable Solana identity. Mint a token on Pump.fun, link your wallet, and publish an ERC-8004 attestation — all from three.ws.</p>
+ </div>
+ </div>
+ <div class="tut-card-body">
+ <div class="tut-code-wrap">
+ <button class="tut-copy-btn" aria-label="Copy code">
+ <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="4" y="4" width="9" height="11" rx="1.5"/><path d="M3 11V3a1 1 0 0 1 1-1h8"/></svg>
+ Copy
+ </button>
+ <pre><code>// Resolve on-chain identity from the SDK
+import { resolveAgent } from 'https://three.ws/sdk/agent-resolver.js';
+
+const agent = await resolveAgent('YOUR_AGENT_ID');
+
+console.log(agent.wallet); // Solana pubkey
+console.log(agent.tokenMint); // Pump.fun mint address
+console.log(agent.attestation); // ERC-8004 attestation URI</code></pre>
+ </div>
+ <div class="tut-viewer-panel">
+ <model-viewer
+ src="/animations/robotexpressive.glb"
+ camera-controls
+ auto-rotate
+ auto-rotate-delay="1500"
+ rotation-per-second="15deg"
+ interaction-prompt="none"
+ shadow-intensity="0"
+ exposure="0.75"
+ environment-image="neutral"
+ camera-orbit="20deg 70deg 6m"
+ field-of-view="40deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ </div>
+ <div class="tut-card-cta">
+ <a href="/pumpfun" class="tut-cta-link">
+ Pump.fun stream
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ <span class="tut-cta-sep">·</span>
+ <a href="/vanity-wallet" class="tut-cta-link">
+ Vanity wallet
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ <span class="tut-cta-sep">·</span>
+ <a href="/docs#solana" class="tut-cta-link">
+ Solana SDK docs
+ <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
+ </a>
+ </div>
+ </article>
+
+ </div>
+ </div>
+ </main>
+
+ <footer class="h-footer h-footer-horizon">
+ <div class="h-footer-glow-line" aria-hidden="true"></div>
+ <div class="h-footer-floor" aria-hidden="true"></div>
+ <div class="h-footer-haze" aria-hidden="true"></div>
+ <div class="h-footer-watermark" aria-hidden="true">three.ws</div>
+ <div class="h-footer-avatar" aria-hidden="true">
+ <model-viewer
+ src="/animations/robotexpressive.glb"
+ auto-rotate
+ auto-rotate-delay="0"
+ rotation-per-second="20deg"
+ interaction-prompt="none"
+ camera-controls="false"
+ disable-zoom
+ shadow-intensity="0"
+ exposure="0.7"
+ environment-image="neutral"
+ camera-orbit="0deg 80deg 9m"
+ field-of-view="45deg"
+ loading="lazy"
+ ></model-viewer>
+ </div>
+ <div class="h-footer-cta">
+ <div class="h-footer-newsletter">
+ <h3>Stay in the loop</h3>
+ <p>Get updates on new features, agent tooling, and protocol changes.</p>
+ <form class="h-footer-newsletter-form" data-newsletter-form novalidate>
+ <input
+ type="email"
+ class="h-footer-newsletter-input"
+ name="email"
+ placeholder="Enter your email"
+ aria-label="Email address"
+ autocomplete="email"
+ required
+ />
+ <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">
+ <svg viewBox="0 0 16 16" aria-hidden="true">
+ <path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4" />
+ </svg>
+ </button>
+ </form>
+ <p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>
+ </div>
+ <div class="h-footer-community">
+ <h3>Join the community</h3>
+ <p>Follow along for builds, demos, and conversations with the team.</p>
+ <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener">
+ <svg viewBox="0 0 24 24" aria-hidden="true">
+ <path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
+ </svg>
+ Follow on X
+ </a>
+ </div>
+ </div>
+ <div class="h-footer-inner">
+ <div class="h-footer-brand-col">
+ <div class="h-footer-brand">
+ <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />
+ <span class="wordmark-dot" aria-hidden="true"></span>
+ <span>three.ws</span>
</div>
- <div style="width: 200px; height: 200px;">
- <model-viewer src="/animations/soldier.glb" camera-controls auto-rotate></model-viewer>
+ <p class="h-footer-tagline">Give your AI a body.</p>
+ <div class="h-footer-socials">
+ <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener" aria-label="three.ws on X">
+ <svg viewBox="0 0 24 24" aria-hidden="true">
+ <path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
+ </svg>
+ </a>
+ <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener" aria-label="three.ws on GitHub">
+ <svg viewBox="0 0 16 16" aria-hidden="true">
+ <path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z" />
+ </svg>
+ </a>
</div>
</div>
-
- <h2>3. Interactive Examples</h2>
- <p>Use JavaScript to interact with your agent.</p>
- <div style="display: flex; gap: 1rem;">
- <div style="flex-grow: 1;">
- <pre><code>
- &lt;script src="https://three.ws/cdn/agent-3d.js" data-agent-id="YOUR_AGENT_ID"&gt;&lt;/script&gt;
- &lt;script&gt;
- const agent = document.querySelector('agent-3d');
- agent.addEventListener('ready', () => {
- agent.playAnimation('wave');
- });
- &lt;/script&gt;
- </code></pre>
+ <nav class="h-footer-links" aria-label="Footer">
+ <div class="h-footer-link-col">
+ <h4 class="h-footer-link-heading">Product</h4>
+ <a href="/create">Create</a>
+ <a href="/studio">Studio</a>
+ <a href="/widgets.html">Widgets</a>
+ <a href="/discover">Discover</a>
</div>
- <div style="width: 200px; height: 200px;">
- <model-viewer id="interactive-agent" src="/avatars/cz.glb" camera-controls></model-viewer>
- <button onclick="document.getElementById('interactive-agent').animationName = 'wave';">Wave</button>
+ <div class="h-footer-link-col">
+ <h4 class="h-footer-link-heading">Developers</h4>
+ <a href="/docs">Docs</a>
+ <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>
+ <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>
</div>
+ <div class="h-footer-link-col">
+ <h4 class="h-footer-link-heading">Resources</h4>
+ <a href="/features">Features</a>
+ <a href="/tutorials.html" aria-current="page">Tutorials</a>
+ <a href="/dashboard">Dashboard</a>
+ </div>
+ </nav>
+ </div>
+ <div class="h-footer-bottom">
+ <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
+ <div class="h-footer-legal-links">
+ <a href="/legal/privacy">Privacy Policy</a>
+ <a href="/legal/tos">Terms of Use</a>
</div>
-
- <h2>4. "Claude, integrate this"</h2>
- <p>To simplify integration, you can use the following command to have Claude help you embed an agent. Just say "Claude, integrate agent with ID YOUR_AGENT_ID".</p>
- <button id="claude-integrate-button" class="button-primary">Try it</button>
-
- </section>
- </main>
- <footer class="h-footer">
+ </div>
</footer>
+
<script>
- document.getElementById('claude-integrate-button').addEventListener('click', () => {
- // We can't actually trigger Claude, so we'll just log to the console.
- console.log("Imagine Claude is helping you integrate your agent now.");
- alert("Imagine Claude is helping you integrate your agent now.");
+ // Custom cursor
+ (function () {
+ const cursor = document.getElementById('cursor');
+ if (!cursor || !window.matchMedia('(hover: hover)').matches) return;
+ let x = 0, y = 0, tx = 0, ty = 0;
+ document.addEventListener('mousemove', (e) => { tx = e.clientX; ty = e.clientY; });
+ (function loop() {
+ x += (tx - x) * 0.18;
+ y += (ty - y) * 0.18;
+ cursor.style.transform = `translate(${x - 5}px,${y - 5}px)`;
+ requestAnimationFrame(loop);
+ })();
+ document.querySelectorAll('a,button').forEach((el) => {
+ el.addEventListener('mouseenter', () => cursor.classList.add('cursor--hover'));
+ el.addEventListener('mouseleave', () => cursor.classList.remove('cursor--hover'));
+ });
+ })();
+
+ // Auth-aware nav CTA
+ (function () {
+ try {
+ const raw = localStorage.getItem('3dagent:auth-hint');
+ if (!raw) return;
+ const { authed, name } = JSON.parse(raw);
+ if (!authed) return;
+ const cta = document.getElementById('home-nav-cta');
+ if (cta) { cta.textContent = 'Dashboard'; cta.href = '/dashboard'; }
+ const myAgentsLi = document.getElementById('home-nav-my-agents-li');
+ if (myAgentsLi) myAgentsLi.hidden = false;
+ const userLi = document.getElementById('home-nav-user-li');
+ const userEl = document.getElementById('home-nav-user');
+ if (userEl && userLi && name) { userEl.textContent = name; userLi.hidden = false; }
+ } catch (_) {}
+ })();
+
+ // Dropdown nav
+ (function () {
+ const triggers = document.querySelectorAll('.home-nav .nav-trigger');
+ if (!triggers.length) return;
+ function closeAll(except) {
+ triggers.forEach((t) => { if (t !== except) t.setAttribute('aria-expanded', 'false'); });
+ }
+ triggers.forEach((trigger) => {
+ trigger.addEventListener('click', (e) => {
+ e.stopPropagation();
+ const open = trigger.getAttribute('aria-expanded') === 'true';
+ closeAll(open ? null : trigger);
+ trigger.setAttribute('aria-expanded', open ? 'false' : 'true');
+ if (!open) trigger.nextElementSibling?.querySelector('a')?.focus();
+ });
+ const menu = trigger.nextElementSibling;
+ if (!menu) return;
+ menu.addEventListener('keydown', (e) => {
+ const items = Array.from(menu.querySelectorAll('a'));
+ const idx = items.indexOf(document.activeElement);
+ if (e.key === 'ArrowDown') { e.preventDefault(); items[(idx + 1) % items.length]?.focus(); }
+ else if (e.key === 'ArrowUp') { e.preventDefault(); items[(idx - 1 + items.length) % items.length]?.focus(); }
+ else if (e.key === 'Escape') { trigger.setAttribute('aria-expanded', 'false'); trigger.focus(); }
+ });
+ });
+ document.addEventListener('click', (e) => { if (!e.target.closest('.home-nav')) closeAll(null); });
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape') closeAll(null); });
+ })();
+
+ // Copy-to-clipboard
+ document.querySelectorAll('.tut-copy-btn').forEach((btn) => {
+ btn.addEventListener('click', () => {
+ const code = btn.closest('.tut-code-wrap').querySelector('code');
+ navigator.clipboard.writeText(code.textContent.trim()).then(() => {
+ btn.classList.add('copied');
+ btn.innerHTML = `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M2 9l4 4 8-8"/></svg> Copied`;
+ setTimeout(() => {
+ btn.classList.remove('copied');
+ btn.innerHTML = `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="4" y="4" width="9" height="11" rx="1.5"/><path d="M3 11V3a1 1 0 0 1 1-1h8"/></svg> Copy`;
+ }, 2000);
+ });
+ });
});
</script>
</body>