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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
On-chain deploy: cinematic progress UI + post-mint reveal page
nirholas636325b76f65
diff --git a/pages/mint-success.html b/pages/mint-success.htmlnew file mode 100644index 000000000..fb7c6d627--- /dev/null+++ b/pages/mint-success.html@@ -0,0 +1,309 @@+<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />+ <title>Agent deployed · three.ws</title>+ <meta name="robots" content="noindex" />+ <link rel="icon" href="/favicon.ico" sizes="any" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <style>+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }++ html, body {+ height: 100%;+ background: #050508;+ color: #e5e7eb;+ font-family: Inter, system-ui, sans-serif;+ overflow: hidden;+ }++ /* ── starfield ── */+ #starfield {+ position: fixed; inset: 0; z-index: 0;+ opacity: 0; transition: opacity 1.4s ease-out;+ }+ #starfield.show { opacity: 1; }++ /* ── layout ── */+ .shell {+ position: relative; z-index: 1;+ display: flex; flex-direction: column;+ align-items: center; justify-content: center;+ min-height: 100vh; padding: 24px;+ gap: 0;+ }++ /* ── avatar zone ── */+ .avatar-wrap {+ position: relative;+ width: min(320px, 65vw);+ height: min(320px, 65vw);+ flex-shrink: 0;+ opacity: 0; transform: translateY(18px) scale(.96);+ transition: opacity .9s ease-out, transform .9s ease-out;+ }+ .avatar-wrap.show { opacity: 1; transform: none; }++ .avatar-glow {+ position: absolute; inset: -30px;+ border-radius: 50%;+ background: radial-gradient(circle at center, rgba(99,102,241,.28) 0%, transparent 70%);+ opacity: 0; animation: none;+ }+ .avatar-glow.show {+ opacity: 1;+ animation: glow-pulse 2.8s ease-in-out infinite;+ }+ @keyframes glow-pulse {+ 0%,100% { opacity: .5; transform: scale(1); }+ 50% { opacity: 1; transform: scale(1.07); }+ }++ model-viewer, .avatar-placeholder {+ width: 100%; height: 100%;+ border-radius: 50%;+ background: transparent;+ --progress-bar-color: transparent;+ }+ .avatar-placeholder {+ display: flex; align-items: center; justify-content: center;+ background: linear-gradient(135deg, #312e81, #4f46e5);+ font-size: 3.5rem; font-weight: 800; color: rgba(255,255,255,.9);+ border-radius: 50%;+ }++ /* ── text content ── */+ .content { margin-top: 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0; }++ .tag {+ display: inline-flex; align-items: center; gap: 6px;+ font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;+ color: #a5b4fc; padding: 4px 12px; border-radius: 20px;+ border: 1px solid rgba(99,102,241,.4); background: rgba(99,102,241,.08);+ opacity: 0; transform: translateY(10px);+ transition: opacity .6s ease-out, transform .6s ease-out;+ }+ .tag.show { opacity: 1; transform: none; }+ .tag::before { content: '✦'; }++ .agent-name {+ margin-top: 12px;+ font-size: clamp(1.6rem, 5vw, 2.4rem);+ font-weight: 800; line-height: 1.1; color: #f9fafb;+ opacity: 0; transform: translateY(10px);+ transition: opacity .6s ease-out, transform .6s ease-out;+ }+ .agent-name.show { opacity: 1; transform: none; }++ .tx-row {+ margin-top: 20px;+ display: flex; flex-direction: column; align-items: center; gap: 4px;+ opacity: 0; transform: translateY(10px);+ transition: opacity .6s ease-out, transform .6s ease-out;+ }+ .tx-row.show { opacity: 1; transform: none; }++ .chain-badge {+ font-size: 10px; font-weight: 700; letter-spacing: .1em;+ color: #6b7280; background: rgba(255,255,255,.05);+ border: 1px solid rgba(255,255,255,.08);+ padding: 2px 8px; border-radius: 20px;+ }+ .tx-hash {+ font-family: ui-monospace, monospace;+ font-size: 13px; color: #9ca3af;+ }+ .tx-link {+ font-size: 12px; color: #6366f1;+ text-decoration: none;+ transition: color .15s;+ }+ .tx-link:hover { color: #a5b4fc; }++ /* ── CTAs ── */+ .ctas {+ margin-top: 28px;+ display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;+ opacity: 0; transform: translateY(12px);+ transition: opacity .6s ease-out, transform .6s ease-out;+ }+ .ctas.show { opacity: 1; transform: none; }++ .btn {+ display: inline-flex; align-items: center; gap: 6px;+ padding: 11px 22px; border-radius: 10px;+ font-size: 14px; font-weight: 600;+ text-decoration: none; cursor: pointer;+ border: none; transition: opacity .15s, transform .15s;+ }+ .btn:hover { opacity: .88; transform: translateY(-1px); }+ .btn.primary { background: #4f46e5; color: #fff; }+ .btn.ghost { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #d1d5db; }++ @media (max-width: 480px) {+ .avatar-wrap { width: min(240px, 72vw); height: min(240px, 72vw); }+ .ctas { flex-direction: column; align-items: stretch; }+ }+ </style>+</head>+<body>+ <canvas id="starfield" aria-hidden="true"></canvas>++ <div class="shell">+ <div class="avatar-wrap" id="avatarWrap">+ <div class="avatar-glow" id="avatarGlow"></div>+ <div class="avatar-placeholder" id="avatarPlaceholder" aria-hidden="true">?</div>+ </div>++ <div class="content">+ <div class="tag" id="tag">Agent deployed on-chain</div>+ <div class="agent-name" id="agentName">Loading…</div>++ <div class="tx-row" id="txRow">+ <span class="chain-badge" id="chainBadge">SOLANA</span>+ <span class="tx-hash" id="txHash">—</span>+ <a class="tx-link" id="txLink" href="#" target="_blank" rel="noopener">View on explorer ↗</a>+ </div>++ <div class="ctas" id="ctas">+ <a class="btn primary" id="btnView" href="#">View your agent →</a>+ <button class="btn ghost" id="btnShare" type="button">Share</button>+ </div>+ </div>+ </div>++ <script type="module">+ import { agentAvatarGlb } from '/src/shared/agent-3d.js';++ const p = new URLSearchParams(location.search);+ const agentId = p.get('id') || '';+ const txSig = p.get('tx') || '';+ const chain = p.get('chain') || 'solana-mainnet';++ // Starfield+ const canvas = document.getElementById('starfield');+ const ctx = canvas.getContext('2d');+ let stars = [];+ function resizeCanvas() {+ canvas.width = window.innerWidth;+ canvas.height = window.innerHeight;+ }+ function initStars() {+ resizeCanvas();+ stars = Array.from({ length: 38 }, () => ({+ x: Math.random() * canvas.width,+ y: Math.random() * canvas.height,+ r: Math.random() * 1.2 + .4,+ vy: Math.random() * .18 + .05,+ a: Math.random() * .6 + .2,+ }));+ }+ function drawStars() {+ ctx.clearRect(0, 0, canvas.width, canvas.height);+ for (const s of stars) {+ ctx.beginPath();+ ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);+ ctx.fillStyle = `rgba(255,255,255,${s.a})`;+ ctx.fill();+ s.y -= s.vy;+ if (s.y < -2) { s.y = canvas.height + 2; s.x = Math.random() * canvas.width; }+ }+ requestAnimationFrame(drawStars);+ }+ initStars();+ window.addEventListener('resize', initStars);+ drawStars();++ // Staggered reveals+ function after(ms, fn) { setTimeout(fn, ms); }++ after(0, () => canvas.classList.add('show'));+ after(300, () => document.getElementById('avatarWrap').classList.add('show'));+ after(800, () => document.getElementById('avatarGlow').classList.add('show'));+ after(1200, () => document.getElementById('tag').classList.add('show'));+ after(1600, () => document.getElementById('agentName').classList.add('show'));+ after(2000, () => document.getElementById('txRow').classList.add('show'));+ after(2400, () => document.getElementById('ctas').classList.add('show'));++ // Chain label + explorer URL+ function chainLabel(c) {+ if (c === 'solana-mainnet') return 'SOLANA';+ if (c === 'solana-devnet') return 'SOLANA DEVNET';+ return c.toUpperCase().replace(/-/g, ' ');+ }+ function explorerUrl(c, sig) {+ if (c === 'solana-mainnet') return `https://solscan.io/tx/${sig}`;+ if (c === 'solana-devnet') return `https://explorer.solana.com/tx/${sig}?cluster=devnet`;+ return `#`;+ }+ function shortSig(s) {+ if (!s || s.length < 16) return s || '—';+ return `${s.slice(0, 8)}…${s.slice(-8)}`;+ }++ document.getElementById('chainBadge').textContent = chainLabel(chain);+ document.getElementById('txHash').textContent = shortSig(txSig);+ const expUrl = explorerUrl(chain, txSig);+ document.getElementById('txLink').href = expUrl;++ // Agent fetch + avatar+ async function loadAgent() {+ if (!agentId) return;++ let agent;+ try {+ const r = await fetch(`/api/agents/${encodeURIComponent(agentId)}`, { credentials: 'include' });+ if (r.ok) agent = await r.json();+ } catch { /* non-fatal */ }++ const name = agent?.name || 'Agent';+ document.getElementById('agentName').textContent = name;+ document.getElementById('avatarPlaceholder').textContent = (name[0] || 'A').toUpperCase();+ document.title = `${name} deployed · three.ws`;++ // CTA links+ document.getElementById('btnView').href = `/agent/${encodeURIComponent(agentId)}`;+ document.getElementById('btnShare').addEventListener('click', () => {+ const url = `https://three.ws/agent/${encodeURIComponent(agentId)}`;+ const text = `Just deployed my 3D AI Agent on-chain.\n\n${name} is live on Solana.\n\n${url}`;+ if (navigator.share) {+ navigator.share({ title: `${name} — deployed on three.ws`, text, url }).catch(() => {});+ return;+ }+ const tweet = `https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}`;+ window.open(tweet, '_blank', 'noopener');+ });++ // 3D avatar via model-viewer+ const glbUrl = agentAvatarGlb(agent);+ const wrap = document.getElementById('avatarWrap');+ const ph = document.getElementById('avatarPlaceholder');++ const mv = document.createElement('model-viewer');+ mv.setAttribute('src', glbUrl);+ mv.setAttribute('auto-rotate', '');+ mv.setAttribute('auto-rotate-delay', '0');+ mv.setAttribute('rotation-per-second', '24deg');+ mv.setAttribute('camera-controls', '');+ mv.setAttribute('interaction-prompt', 'none');+ mv.setAttribute('environment-image', 'neutral');+ mv.setAttribute('exposure', '0.9');+ mv.setAttribute('shadow-intensity', '0.4');+ mv.setAttribute('ar', '');+ mv.setAttribute('loading', 'eager');+ mv.setAttribute('reveal', 'auto');+ mv.setAttribute('style', 'width:100%;height:100%;background:transparent;border-radius:50%');+ mv.setAttribute('alt', `${name} 3D avatar spinning`);++ mv.addEventListener('load', () => { ph.style.display = 'none'; });+ mv.addEventListener('error', () => { /* placeholder stays visible */ });++ wrap.appendChild(mv);+ }++ loadAgent();+ </script>+</body>+</html>diff --git a/src/erc8004/deploy-button.js b/src/erc8004/deploy-button.jsindex 4c85ca6fa..822c69c2d 100644--- a/src/erc8004/deploy-button.js+++ b/src/erc8004/deploy-button.js@@ -252,22 +252,52 @@ export class DeployButton {}_renderProgress(steps, activeIdx, extra) {- const labels = steps.map((s, i) => {- const cls = i < activeIdx ? 'done' : i === activeIdx ? 'active' : 'pending';- return `<span class="progress-step progress-step--${cls}">${_esc(s)}</span>`;- });+ // Inject keyframes once into the document head+ if (!document.getElementById('db-progress-kf')) {+ const style = document.createElement('style');+ style.id = 'db-progress-kf';+ style.textContent = `+ @keyframes db-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(99,102,241,.7)} 50%{box-shadow:0 0 0 8px rgba(99,102,241,0)} }+ @keyframes db-spin { to{transform:rotate(360deg)} }+ @keyframes db-flow { 0%{stroke-dashoffset:24} 100%{stroke-dashoffset:0} }+ `;+ document.head.appendChild(style);+ }+const liveText = activeIdx < steps.length ? `${steps[activeIdx]}…` : 'Done';+ const tiles = steps.map((s, i) => {+ const done = i < activeIdx;+ const active = i === activeIdx;+ const pending = i > activeIdx;+ const bg = done ? 'rgba(99,102,241,.9)' : active ? 'rgba(99,102,241,.12)' : 'rgba(255,255,255,.04)';+ const bord = done ? 'rgba(99,102,241,.6)' : active ? 'rgba(99,102,241,.8)' : 'rgba(255,255,255,.1)';+ const col = done ? '#fff' : active ? '#a5b4fc' : '#6b7280';+ const anim = active ? 'animation:db-pulse 1.6s ease-in-out infinite' : '';+ const icon = done+ ? `<span style="font-size:15px;line-height:1">✓</span>`+ : active+ ? `<svg width="16" height="16" viewBox="0 0 16 16" style="animation:db-spin .9s linear infinite;flex-shrink:0"><circle cx="8" cy="8" r="6" fill="none" stroke="rgba(165,180,252,.25)" stroke-width="2"/><path d="M8 2A6 6 0 0 1 14 8" fill="none" stroke="#a5b4fc" stroke-width="2" stroke-linecap="round"/></svg>`+ : `<span style="width:16px;height:16px;display:inline-block;border-radius:50%;background:rgba(255,255,255,.06)"></span>`;+ return `<div style="display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:8px;background:${bg};border:1px solid ${bord};color:${col};font-size:12px;font-weight:${active ? '600' : '500'};${anim}">+ ${icon}+ <span>${_esc(s)}</span>+ </div>`;+ }).join(`<svg width="2" height="14" viewBox="0 0 2 14" style="flex-shrink:0;margin:0 2px">+ <line x1="1" y1="0" x2="1" y2="14" stroke="rgba(255,255,255,.1)" stroke-width="1.5" stroke-dasharray="4 3" style="animation:db-flow .7s linear infinite"/>+ </svg>`);+this._root.innerHTML = `- <div class="deploy-progress" role="status" aria-live="polite" aria-label="Deployment progress">- ${labels.join('<span class="progress-sep" aria-hidden="true">→</span>')}+ <div role="status" aria-live="polite" aria-label="Deployment progress"+ style="display:flex;flex-direction:row;align-items:center;gap:4px;flex-wrap:wrap">+ ${tiles}<span class="visually-hidden">${_esc(liveText)}</span></div><div class="deploy-progress-detail" aria-live="polite"- style="margin-top:6px;font-size:12px;color:#555;font-family:ui-monospace,monospace;min-height:1.2em">+ style="margin-top:8px;font-size:11px;color:#6b7280;font-family:ui-monospace,monospace;min-height:1.2em;letter-spacing:.01em">${extra?.text ? _esc(extra.text) : ''}</div>${extra?.cancelable ? `<button class="deploy-cancel-btn" type="button"- style="margin-top:4px;font-size:11px;background:none;border:1px solid #ccc;border-radius:4px;padding:2px 8px;cursor:pointer">cancel</button>` : ''}+ style="margin-top:10px;font-size:12px;font-weight:500;background:none;border:1px solid rgba(255,255,255,.15);border-radius:6px;padding:5px 14px;cursor:pointer;color:#9ca3af;transition:border-color .15s,color .15s">Stop grinding</button>` : ''}`;if (extra?.onCancel) {const cb = this._root.querySelector('.deploy-cancel-btn');@@ -380,6 +410,15 @@ export class DeployButton {_saveVanity(this._agent?.id, ''); // clear after successful deploythis._preGroundSecretKey = null;this._renderSuccessChip(this._chainId, result.txSignature, result.assetPubkey, result.vanityPrefix);++ // Redirect to the cinematic reveal page after a brief success flash+ const agentId = this._agent.id;+ const txSig = result.txSignature || '';+ const assetPk = result.assetPubkey || '';+ const chain = this._chainId;+ setTimeout(() => {+ window.location.href = `/mint-success?id=${encodeURIComponent(agentId)}&tx=${encodeURIComponent(txSig)}&asset=${encodeURIComponent(assetPk)}&chain=${encodeURIComponent(chain)}`;+ }, 900);}async _startDeploy() {@@ -602,6 +641,12 @@ export class DeployButton {this._agent.contractAddress = deployment.identityRegistry;this._agent.erc8004AgentId = onchainAgentId;this._renderSuccessChip(chainId, tx.hash, deployment.identityRegistry);++ // Redirect to the cinematic reveal page after a brief success flash+ const agentId = this._agent.id;+ setTimeout(() => {+ window.location.href = `/mint-success?id=${encodeURIComponent(agentId)}&tx=${encodeURIComponent(tx.hash)}&asset=${encodeURIComponent(deployment.identityRegistry || '')}&chain=${encodeURIComponent(chainId)}`;+ }, 900);}// ─── Error classification ──────────────────────────────────────────────diff --git a/vercel.json b/vercel.jsonindex 601f95370..e7070ae81 100644--- a/vercel.json+++ b/vercel.json@@ -589,6 +589,10 @@"src": "/leaderboard/?","dest": "/leaderboard.html"},+ {+ "src": "/mint-success/?",+ "dest": "/mint-success.html"+ },{"src": "/trades/?","dest": "/trades.html"