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
chore: features + pump-visualizer rewrites, pump-live/pump-dashboard routes, nav polish
nirholas891dbbbc1dcc
diff --git a/features.html b/features.htmlindex 755895032..5ce225c7f 100644--- a/features.html+++ b/features.html@@ -37,15 +37,23 @@<link rel="apple-touch-icon" href="/pwa-192x192.png" /><link rel="stylesheet" href="/style.css" /><link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/home.css" />+ <link rel="stylesheet" href="/home-polish.css" /><link rel="stylesheet" href="/features.css" />+ <link rel="stylesheet" href="/footer.css" />+ <script defer src="/footer-newsletter.js"></script>+ <script defer src="/home-polish.js"></script><link rel="stylesheet" href="/fonts/fonts.css" /><scripttype="module"src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <script src="/fluid-particles.js" defer></script>+ <script type="module" src="/src/home-act2-viewer.js"></script></head>- <body class="features-page">- <a href="#hero" class="skip-link">Skip to main content</a>+ <body class="home-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"@@ -60,85 +68,419 @@</header><script src="/nav.js"></script>- <main class="features-main">- <!-- Hero -->- <section class="hero" id="hero">- <div class="hero-bg" aria-hidden="true">- <div class="hero-mesh"></div>- <div class="hero-grid"></div>- <div class="hero-glow hero-glow-gold"></div>- <div class="hero-glow hero-glow-cyan"></div>- </div>- <div class="hero-content">- <div class="hero-chip scroll-reveal">- <span class="hero-chip-dot"></span>- <span>Live on Solana</span>- <span class="hero-chip-divider"></span>- <span class="hero-chip-spec">Metaplex Core</span>- </div>- <h2 class="hero-title scroll-reveal">- Give your AI<br />- a <em>body</em>.- </h2>- <p class="hero-subtitle scroll-reveal">- three.ws turns any GLB into a tradable on-chain agent — with voice,- persona, paid skills, and an embed you can drop on any site.- </p>- <div class="hero-cta scroll-reveal">- <a href="/create" class="btn-primary">- <span>Create an agent</span>- <span class="btn-arrow" aria-hidden="true">→</span>- </a>- <a- href="/discover"- class="btn-ghost"- aria-label="Browse agents on three.ws"- >Browse agents</a- >- </div>- <ul class="hero-proof scroll-reveal" aria-label="Stack">- <li>Solana</li>- <li>Metaplex Core</li>- <li>x402</li>- <li>A2A</li>- <li>MCP</li>- </ul>+ <main id="main-content" class="home-parallax">+ <!-- ── Hero (parallax act) ── -->+ <section class="h-hero-act">+ <!-- Depth 8: fluid particles + nebula -->+ <div class="h-layer" style="--depth: 8" aria-hidden="true">+ <div class="h-layer-nebula"></div>+ <canvas id="home-fluid-canvas" class="h-fluid-canvas"></canvas>+ </div>+ <!-- Depth 4: perspective grid -->+ <div class="h-layer" style="--depth: 4" aria-hidden="true">+ <div class="h-hero-grid"></div></div>- <div class="hero-avatar scroll-reveal" aria-hidden="true">- <div class="hero-avatar-ring"></div>- <div class="hero-avatar-pulse"></div>+ <!-- Depth 3: ghost model drifting in background -->+ <div class="h-layer" style="--depth: 3" aria-hidden="true"><model-viewer- class="hero-avatar-viewer"+ class="h-ghost-model"src="/animations/robotexpressive.glb"- alt="Rotating 3D avatar"- aria-label="Rotating 3D avatar"- camera-controls- disable-zoomauto-rotateauto-rotate-delay="0"- rotation-per-second="18deg"+ rotation-per-second="5deg"interaction-prompt="none"- shadow-intensity="0.8"- shadow-softness="1"- exposure="1.05"- tone-mapping="aces"+ camera-controls="false"+ disable-zoom+ shadow-intensity="0"+ exposure="0.5"environment-image="neutral"- camera-orbit="20deg 70deg 6m"- field-of-view="28deg"- loading="eager"+ camera-orbit="15deg 80deg 4m"+ field-of-view="45deg"+ loading="lazy"></model-viewer>- <div class="hero-avatar-tag" aria-hidden="true">- <span class="hero-avatar-tag-label">asset</span>- <span class="hero-avatar-tag-value">Sol…a9f</span>+ </div>+ <!-- Depth 2: atmosphere -->+ <div class="h-layer" style="--depth: 2" aria-hidden="true">+ <div class="h-hero-mesh"></div>+ <div class="h-hero-glow-a"></div>+ <div class="h-hero-glow-b"></div>+ </div>+ <!-- Depth 1: main avatar that waves on load and tracks the cursor -->+ <div class="h-layer" style="--depth: 1">+ <div class="h-avatar-stage">+ <div class="h-avatar-wrap">+ <div class="h-avatar-ring"></div>+ <div class="h-avatar-glow"></div>+ <canvas+ id="hero-avatar"+ class="h-avatar-viewer"+ aria-label="three.ws — interactive 3D agent. Click for surprises."+ ></canvas>+ </div></div></div>- <div class="hero-scroll-hint scroll-reveal" aria-hidden="true">+ <!-- Depth 0.5: vignette closest to camera -->+ <div class="h-layer" style="--depth: 0.5" aria-hidden="true">+ <div class="h-vignette"></div>+ </div>++ <!-- Sticky text pinned to bottom-left -->+ <div class="h-hero-text">+ <div class="h-eyebrow h-reveal">+ <span class="h-eyebrow-dot"></span>+ <span>The 3D layer for onchain AI agents</span>+ </div>+ <h2 class="h-title h-reveal">Every feature.<br />One <em>body</em>.</h2>+ <p class="h-subtitle h-reveal">+ Everything three.ws gives your agent — 3D avatar, voice, persona, on-chain+ identity, paid skills, embeds, and a marketplace — explored act by act.+ </p>+ <div class="h-cta-row h-reveal">+ <a href="/create" class="h-btn-primary">+ <span>Build your agent — free</span>+ <span class="arrow">→</span>+ </a>+ <a href="#pick-animate" class="h-btn-ghost">Try one live ↓</a>+ </div>+ <ul class="h-standards h-reveal" aria-label="Supported formats and standards">+ <li>glTF 2.0</li>+ <li>GLB</li>+ <li>Solana</li>+ <li>Metaplex Core</li>+ <li>A2A</li>+ <li>MCP</li>+ <li>x402</li>+ </ul>+ </div>++ <div class="h-scroll-hint" aria-hidden="true"><span>scroll</span>- <span class="hero-scroll-line"></span>+ <span class="h-scroll-line"></span>+ </div>+ </section>++ <!-- ── Pillars transition band ── -->+ <section class="h-pillars" aria-label="What you get">+ <div class="h-pillars-inner">+ <article class="h-pillar h-reveal">+ <span class="h-pillar-num">01 / Identity</span>+ <h3>A 3D body for any agent</h3>+ <p>+ Drop any GLB into the browser and your AI agent appears as a fully+ rendered 3D avatar — animated, reactive, and ready to embed anywhere you+ can drop a script tag.+ </p>+ </article>+ <article class="h-pillar h-reveal">+ <span class="h-pillar-num">02 / Intelligence</span>+ <h3>Your stack, your brain</h3>+ <p>+ Connect any LLM via MCP or A2A — Claude, GPT, Gemini, or your own.+ Built-in empathy layer for real-time emotion. No SDK on the consumer+ side. No vendor lock-in.+ </p>+ </article>+ <article class="h-pillar h-reveal">+ <span class="h-pillar-num">03 / Ownership</span>+ <h3>Owned on Solana, portable</h3>+ <p>+ Mint your agent as a Metaplex Core asset on Solana — a verifiable,+ onchain identity discoverable by any A2A or MCP client. Your agent.+ Your keys.+ </p>+ </article>+ </div>+ </section>++ <!-- ── Act 2: Pick & Animate ── -->+ <section class="h-act h-act--animate" data-act="2" id="pick-animate">+ <div class="h-act-warp h-act-warp--amber" aria-hidden="true"></div>+ <div class="h-layer" style="--depth: 8" aria-hidden="true">+ <div class="h-layer-bg h-layer-bg--amber"></div>+ <canvas+ class="h-star-canvas"+ data-role="star-canvas"+ data-tint="255,190,80"+ data-count="200"+ ></canvas>+ </div>+ <div class="h-layer" style="--depth: 4" aria-hidden="true">+ <svg+ class="h-layer-words"+ viewBox="0 0 1600 900"+ preserveAspectRatio="xMidYMid slice"+ role="presentation"+ >+ <g+ fill="rgba(255,200,80,0.13)"+ font-family="'Space Grotesk','Inter',sans-serif"+ font-weight="600"+ >+ <text x="80" y="200" font-size="52">Dance</text>+ <text x="1100" y="160" font-size="44">Wave</text>+ <text x="200" y="710" font-size="44">Jump</text>+ <text x="980" y="760" font-size="40">ThumbsUp</text>+ <text x="560" y="440" font-size="96" fill="rgba(255,255,255,0.05)">+ Idle+ </text>+ <text x="55" y="860" font-size="40">Punch</text>+ <text x="1260" y="520" font-size="48">Run</text>+ </g>+ </svg>+ </div>+ <div class="h-layer" style="--depth: 2" aria-hidden="true">+ <div class="h-layer-orb h-layer-orb--amber"></div>+ </div>+ <div class="h-layer" style="--depth: 1">+ <div class="h-avatar-stage">+ <div class="h-avatar-wrap">+ <canvas id="home-act2-canvas" class="h-avatar-viewer"></canvas>+ </div>+ </div>+ </div>+ <div class="h-layer" style="--depth: 0.5" aria-hidden="true">+ <div class="h-vignette"></div>+ </div>++ <div class="h-act-text">+ <div class="h-act-eyebrow">+ <span class="h-act-dot"></span>+ <span>Pick & animate</span>+ </div>+ <h2 class="h-act-title">Your agent.<br /><em>Any move.</em></h2>+ <p class="h-act-lede">+ Choose an avatar, trigger an animation. This is exactly what lives on your+ site.+ </p>++ <div class="h-avatar-picker" role="group" aria-label="Choose avatar">+ <button+ class="h-av-opt"+ data-src="/animations/robotexpressive.glb"+ aria-pressed="true"+ >+ Robot+ </button>+ <button+ class="h-av-opt"+ data-src="/animations/soldier.glb"+ aria-pressed="false"+ >+ Soldier+ </button>+ <button class="h-av-opt" data-src="/avatars/cz.glb" aria-pressed="false">+ CZ+ </button>+ </div>++ <div+ class="h-anim-chips"+ role="group"+ aria-label="Trigger animation"+ data-role="anim-chips"+ ></div>++ <div class="h-act-cta">+ <a href="/app" class="h-btn-primary"+ ><span>Open full viewer</span><span class="arrow">→</span></a+ >+ <a href="/create" class="h-btn-ghost">Create your agent</a>+ </div>+ </div>+ </section>++ <!-- ── Act 3: Deploy on-chain ── -->+ <section class="h-act h-act--deploy" data-act="3" id="deploy-act">+ <div class="h-act-warp h-act-warp--mint" aria-hidden="true"></div>+ <div class="h-layer" style="--depth: 8" aria-hidden="true">+ <div class="h-layer-bg h-layer-bg--mint"></div>+ <canvas+ class="h-star-canvas"+ data-role="star-canvas"+ data-tint="110,231,183"+ data-count="200"+ ></canvas>+ </div>++ <div class="h-layer" style="--depth: 2" aria-hidden="true">+ <div class="h-layer-orb h-layer-orb--mint"></div>+ </div>+ <div class="h-layer" style="--depth: 1" aria-hidden="true">+ <div class="h-avatar-stage h-avatar-stage--trio">+ <div class="h-avatar-wrap h-avatar-wrap--ghost h-avatar-wrap--trio">+ <canvas+ id="act3-avatar-a"+ class="h-avatar-viewer h-avatar-viewer--tall"+ ></canvas>+ </div>+ <div class="h-avatar-wrap h-avatar-wrap--ghost h-avatar-wrap--trio">+ <canvas+ id="act3-avatar-b"+ class="h-avatar-viewer h-avatar-viewer--tall"+ ></canvas>+ </div>+ <div class="h-avatar-wrap h-avatar-wrap--ghost h-avatar-wrap--trio">+ <canvas+ id="act3-avatar-c"+ class="h-avatar-viewer h-avatar-viewer--tall"+ ></canvas>+ </div>+ </div>+ </div>+ <div class="h-layer" style="--depth: 0.5" aria-hidden="true">+ <div class="h-vignette"></div>+ </div>++ <div class="h-act-text">+ <div class="h-act-eyebrow">+ <span class="h-act-dot h-act-dot--mint"></span>+ <span>Metaplex native</span>+ </div>+ <h2 class="h-act-title h-act-title--mint">+ One transaction.<br /><em>One identity.</em>+ </h2>+ <p class="h-act-lede">+ Mint onchain on Solana. Get a portable, verifiable agentId discoverable+ by any A2A or MCP client.+ </p>++ <form class="h-deploy-form" id="home-deploy-form" action="/deploy" method="get">+ <div class="h-form-row">+ <label class="h-form-label" for="agent-name-features">Agent name</label>+ <input+ id="agent-name-features"+ name="name"+ class="h-form-input"+ type="text"+ placeholder="my-agent"+ autocomplete="off"+ spellcheck="false"+ />+ </div>+ <div class="h-form-row">+ <label class="h-form-label" for="network-features">Network</label>+ <select id="network-features" name="network" class="h-form-select">+ <option value="mainnet-beta" selected>Solana Mainnet</option>+ <option value="devnet">Solana Devnet</option>+ </select>+ </div>+ <div class="h-deploy-stats">+ <div>+ <span class="h-stat-label">Chain</span+ ><span class="h-stat-val">Solana</span>+ </div>+ <div>+ <span class="h-stat-label">Standard</span+ ><span class="h-stat-val">Metaplex Core</span>+ </div>+ <div>+ <span class="h-stat-label">Fee</span+ ><span class="h-stat-val">~$0.01</span>+ </div>+ </div>+ <button type="submit" class="h-btn-primary h-btn-deploy">+ <span>Mint your agent</span>+ <span class="arrow">→</span>+ </button>+ </form></div></section>- <!-- How it works -->+ <!-- ── Bento feature grid ── -->+ <section class="h-bento-section">+ <div class="h-bento-header h-reveal">+ <p class="h-section-label">What you get</p>+ <h2 class="h-section-title">+ Everything an agent needs<br />to exist in the world.+ </h2>+ </div>+ <div class="h-bento-grid">+ <!-- Large card: 3D viewer + inline animation panel -->+ <div class="h-bento-card h-bento-card--lg h-reveal">+ <div class="h-bento-visual">+ <canvas id="bento-cz-canvas" class="h-bento-cz-canvas"></canvas>+ </div>+ <div class="h-bento-anim-panel" data-role="bento-anim-panel">+ <div class="h-bento-anim-header">+ <span class="h-bento-anim-title">Animations</span>+ <button+ type="button"+ class="h-bento-anim-stop"+ data-role="bento-anim-stop"+ title="Stop all"+ >+ ⏹+ </button>+ </div>+ <div class="h-bento-anim-grid" data-role="bento-anim-grid"></div>+ </div>+ <div class="h-bento-body">+ <span class="h-bento-tag">Viewer</span>+ <h3>WebGL rendering, zero install.</h3>+ <p>+ Drag any GLB into the browser. Full animations, lighting, and+ materials — instantly, on any device.+ </p>+ <a href="/app" class="h-feature-link">Open viewer →</a>+ </div>+ </div>+ <!-- Small cards -->+ <div class="h-bento-card h-reveal">+ <div class="h-bento-body">+ <span class="h-bento-tag">Embed</span>+ <h3>One iframe. Any site.</h3>+ <p>Notion, Ghost, WordPress, Framer. No SDK on the consumer side.</p>+ <div class="h-bento-code">+ <span class="tag"><agent-3d</span>+ <br /> <span class="attr">agent-id</span>=<span+ class="val"+ >"3DAg…uPL"</span+ >+ <br /><span class="tag">></agent-3d></span>+ </div>+ </div>+ </div>+ <div class="h-bento-card h-reveal">+ <div class="h-bento-body">+ <span class="h-bento-tag h-bento-tag--mint">On-chain</span>+ <h3>Verifiable identity.</h3>+ <p>+ Metaplex Core asset on Solana. One transaction, sub-cent fees.+ Discoverable by any A2A or MCP client.+ </p>+ </div>+ </div>+ <div class="h-bento-card h-reveal">+ <div class="h-bento-body">+ <span class="h-bento-tag h-bento-tag--violet">AI</span>+ <h3>Six emotions. Real time.</h3>+ <p>+ Built-in empathy layer. Your agent reacts — speaking, thinking,+ succeeding, failing.+ </p>+ <ul class="h-bento-emotions" aria-label="Emotion states">+ <li><span class="h-em-dot"></span>Celebration</li>+ <li><span class="h-em-dot"></span>Curiosity</li>+ <li><span class="h-em-dot"></span>Empathy</li>+ <li><span class="h-em-dot"></span>Concern</li>+ </ul>+ </div>+ </div>+ <div class="h-bento-card h-reveal">+ <div class="h-bento-body">+ <span class="h-bento-tag">Widgets</span>+ <h3>5 widget types.</h3>+ <p>+ Turntable · Talking Agent · Animation Gallery · ERC-8004 Passport ·+ Hotspot Tour+ </p>+ <a href="/studio" class="h-feature-link">Widget Studio →</a>+ </div>+ </div>+ </div>+ </section>++ <!-- ── Features deep-dive: How It Works ── --><section class="section" id="how-it-works"><h3 class="section-label scroll-reveal">How It Works</h3><div class="steps">@@ -170,7 +512,7 @@</div></section>- <!-- Agent Card JSON -->+ <!-- ── Agent Card JSON ── --><section class="section section-dark" id="agent-card"><h3 class="section-label scroll-reveal">The Agent Card</h3><p class="section-desc scroll-reveal">@@ -203,7 +545,7 @@</div></section>- <!-- Core capabilities -->+ <!-- ── Core capabilities ── --><section class="section" id="capabilities"><h3 class="section-label scroll-reveal">What an Agent Can Do</h3><div class="registry-grid">@@ -289,7 +631,7 @@</div></section>- <!-- Integration -->+ <!-- ── Built for the Agent Web ── --><section class="section section-dark" id="integration"><h3 class="section-label scroll-reveal">Built for the Agent Web</h3><div class="integration-grid">@@ -325,48 +667,254 @@</div></section>- <!-- CTA -->- <section class="section cta-section" id="cta">- <div class="cta-content scroll-reveal">- <h3>Ready to give your AI a body?</h3>- <p>Spin up a 3D agent in under a minute — no install, no contracts.</p>- <div class="hero-cta">- <a href="/create" class="btn-primary">Create an agent</a>- <a- href="/docs"- class="btn-ghost"- aria-label="Read the three.ws docs"- >Read the docs <span aria-hidden="true">→</span></a- >+ <!-- ── Developer section ── -->+ <div class="h-dev-section h-reveal">+ <div class="h-dev-inner">+ <div class="h-dev-text">+ <p class="h-section-label">For developers</p>+ <h2>Drop one tag.<br />Ship a 3D agent.</h2>+ <p class="h-dev-sub">+ The <code><agent-3d></code> web component lazy-loads, renders+ anywhere, and connects to your existing AI stack via MCP or A2A. No+ framework. No build step.+ </p>+ <div class="h-dev-links">+ <a href="/docs" class="h-feature-link">Read the docs →</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ class="h-feature-link"+ >GitHub →</a+ >+ </div>+ </div>+ <div class="h-dev-code">+ <div class="h-dev-code-bar">+ <span class="h-dev-code-dot"></span>+ <span class="h-dev-code-dot"></span>+ <span class="h-dev-code-dot"></span>+ <span class="h-dev-code-filename">index.html</span>+ </div>+ <pre+ class="h-dev-pre"+ ><code><span class="c"><!-- 1. Load the component --></span>+<span class="tag"><script</span> <span class="attr">type</span>=<span class="val">"module"</span>+ <span class="attr">src</span>=<span class="val">"https://three.ws/agent-3d/latest/agent-3d.js"</span><span class="tag">></script></span>++<span class="c"><!-- 2. Drop the tag --></span>+<span class="tag"><agent-3d</span>+ <span class="attr">agent-id</span>=<span class="val">"3DAg…uPL"</span>+ <span class="attr">kiosk</span>+<span class="tag">></agent-3d></span></code></pre>+ </div>+ </div>+ </div>++ <!-- ── Final CTA ── -->+ <section class="h-cta-section">+ <div class="h-cta-inner h-reveal">+ <h2>Your agent deserves<br />a face.</h2>+ <p>Free to start. No credit card. No install.</p>+ <div class="h-cta-row-center">+ <a href="/create" class="h-btn-primary">+ <span>Create your agent</span>+ <span class="arrow">→</span>+ </a>+ <a href="/app" class="h-btn-ghost">Try the viewer</a></div></div></section>- <footer class="features-footer">- <p>- three.ws ·- <a href="/discover">Discover</a> ·- <a href="/docs">Docs</a> ·- <a- href="https://github.com/nirholas/three.ws"- target="_blank"- rel="noopener"- aria-label="three.ws on GitHub (opens in a new tab)"- >GitHub</a- >- · Built on- <a- href="https://developers.metaplex.com/core"- target="_blank"- rel="noopener"- aria-label="Metaplex Core (opens in a new tab)"- >Metaplex Core</a- >- </p>+ <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>+ <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>+ <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 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://developers.metaplex.com/core"+ target="_blank"+ rel="noopener"+ >Metaplex Core</a+ >+ </div>+ <div class="h-footer-link-col">+ <h4 class="h-footer-link-heading">Resources</h4>+ <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>+ </div></footer></main><script>+ // Devices with < 2 GB RAM get no WebGL viewers — avoids GPU OOM and+ // context-limit issues. navigator.deviceMemory is undefined on Firefox/Safari+ // so we default to "capable" when the API is absent.+ const LOW_MEMORY = typeof navigator.deviceMemory === 'number' && navigator.deviceMemory < 2;+ const REDUCED_MOTION = window.matchMedia('(prefers-reduced-motion: reduce)').matches;+ const SKIP_OFFSCREEN_GL = LOW_MEMORY;++ // Scroll reveal — homepage acts (.h-reveal)+ (function () {+ const els = document.querySelectorAll('.h-reveal');+ const observer = new IntersectionObserver(+ (entries) => {+ entries.forEach((entry) => {+ if (entry.isIntersecting) {+ entry.target.classList.add('revealed');+ observer.unobserve(entry.target);+ }+ });+ },+ { root: null, threshold: 0.12, rootMargin: '0px 0px -50px 0px' },+ );+ els.forEach((el) => {+ const siblings = Array.from(el.parentElement.querySelectorAll('.h-reveal'));+ const idx = siblings.indexOf(el);+ el.style.transitionDelay = idx * 0.09 + 's';+ observer.observe(el);+ });+ })();++ // Scroll reveal — features-specific sections (.scroll-reveal)(function () {const reveals = document.querySelectorAll('.scroll-reveal');const observer = new IntersectionObserver(@@ -378,7 +926,7 @@}});},- { threshold: 0.15, rootMargin: '0px 0px -60px 0px' },+ { root: null, threshold: 0.15, rootMargin: '0px 0px -60px 0px' },);reveals.forEach((el) => {const siblings = Array.from(@@ -389,6 +937,456 @@observer.observe(el);});})();++ // Hero avatar — Act2Viewer with cursor/scroll orbit + click → real animations+ (function () {+ const scrollEl = document.querySelector('.home-parallax');+ const canvas = document.getElementById('hero-avatar');+ const heroAct = document.querySelector('.h-hero-act');+ if (!scrollEl || !canvas || !heroAct) return;++ let mouseX = 0,+ mouseY = 0,+ scrollProgress = 0;+ const BASE_THETA = -45,+ BASE_PHI = 80,+ BASE_R = 20;+ let curTheta = BASE_THETA,+ curPhi = BASE_PHI,+ curR = BASE_R;++ window.addEventListener(+ 'mousemove',+ (e) => {+ mouseX = (e.clientX / innerWidth) * 2 - 1;+ mouseY = (e.clientY / innerHeight) * 2 - 1;+ },+ { passive: true },+ );++ scrollEl.addEventListener(+ 'scroll',+ () => {+ scrollProgress = Math.min(scrollEl.scrollTop / heroAct.offsetHeight, 1);+ },+ { passive: true },+ );++ function whenReady(cb) {+ if (window.Act2Viewer) return cb();+ setTimeout(() => whenReady(cb), 60);+ }++ whenReady(() => {+ const viewer = new window.Act2Viewer(canvas, { fov: 18 });+ let orbitActive = false;++ (function tick() {+ if (orbitActive) {+ const scrollTheta = scrollProgress * 90;+ const scrollPhi = -scrollProgress * 8;+ const scrollR = scrollProgress * 0.8;+ curTheta += (BASE_THETA + scrollTheta + mouseX * 16 - curTheta) * 0.07;+ curPhi += (BASE_PHI + scrollPhi + mouseY * 6 - curPhi) * 0.07;+ curR += (BASE_R + scrollR - curR) * 0.12;+ viewer.setOrbit(curTheta, curPhi, curR);+ }+ requestAnimationFrame(tick);+ })();++ const wrap = canvas.closest('.h-avatar-wrap');++ async function doFalling(alreadyPlaying = false) {+ if (!alreadyPlaying) {+ try {+ await viewer.playClip('falling');+ } catch (_) {}+ }++ const clipDur = viewer.currentAction+ ? viewer.currentAction.getClip().duration * 1000+ : 2200;+ await new Promise((r) => setTimeout(r, clipDur));++ wrap.classList.add('h-avatar-wrap--traversing');+ const SLIDE_DUR = 3200;+ const SLIDE_DIST = 8;+ const t0 = performance.now();+ await new Promise((r) => {+ (function step(now) {+ const t = Math.min((now - t0) / SLIDE_DUR, 1);+ const x = SLIDE_DIST * t;+ if (viewer.model) viewer.model.position.x = x;+ viewer._focusX = x;+ if (t < 1) {+ requestAnimationFrame(step);+ } else {+ r();+ }+ })(performance.now());+ });++ if (viewer.model) viewer.model.position.x = 0;+ viewer._focusX = 0;+ wrap.classList.remove('h-avatar-wrap--traversing');+ viewer.playClip('dance').catch(() => {});+ }++ canvas.style.opacity = '0';+ viewer+ .loadModel('/avatars/cz.glb', { autoPlay: false })+ .then(async () => {+ viewer.model.traverse((node) => {+ if (node.isMesh || node.isGroup) {+ const n = node.name.toLowerCase();+ if (n.includes('ring') || n.includes('circle') || n.includes('halo') || n.includes('orbit') || n.includes('arc')) {+ node.scale.setScalar(2.5);+ }+ }+ });+ viewer._modelFocusY = 1.1;+ viewer.setOrbit(curTheta, curPhi, curR);+ orbitActive = true;+ try {+ await viewer.playClip('falling');+ } catch (_) {}+ canvas.style.transition = 'opacity 0.15s';+ canvas.style.opacity = '1';+ doFalling(true);+ })+ .catch(console.error);++ const FUN = [+ 'falling',+ 'wave',+ 'dance',+ 'celebrate',+ 'jump',+ 'rumba',+ 'capoeira',+ 'thriller',+ 'kiss',+ 'taunt',+ 'pray',+ 'idle',+ 'angry',+ 'defeated',+ 'dying',+ 'reaction',+ 'silly',+ 'sitclap',+ 'sitlaugh',+ 'walk',+ 'dodge',+ 'stepback',+ 'shoved',+ 'standup',+ 'header',+ 'coverstand',+ 'goalkeeper',+ 'jumpdown',+ 'jumpdown2',+ 'jumpdown3',+ 'removing',+ 'falltolanding',+ ];+ let lastAnim = null;+ canvas.style.cursor = 'pointer';+ canvas.addEventListener('click', async () => {+ const pool = FUN.filter((a) => a !== lastAnim);+ const name = pool[Math.floor(Math.random() * pool.length)];+ lastAnim = name;+ if (name === 'falling') {+ doFalling();+ return;+ }+ try {+ await viewer.playClip(name);+ const def = viewer._manifest.find((d) => d.name === name);+ if (def && !def.loop) {+ setTimeout(() => viewer.playClip('dance').catch(() => {}), 2600);+ }+ } catch (_) {}+ });+ });+ })();++ // Act 2 viewer — Three.js + animation manifest, same as /app+ (function () {+ const canvas = document.getElementById('home-act2-canvas');+ const opts = document.querySelectorAll('.h-av-opt');+ const chipsWrap = document.querySelector('[data-role="anim-chips"]');+ if (!canvas || !chipsWrap) return;++ function whenReady(cb) {+ if (window.Act2Viewer) return cb();+ setTimeout(() => whenReady(cb), 60);+ }++ function initAct2() {+ whenReady(() => {+ const viewer = new window.Act2Viewer(canvas);++ function prettyLabel(def) {+ const icon = def.icon || '✨';+ const label = (def.label || def.name).replace(/\s*\([^)]*\)/g, '').trim();+ return icon + ' ' + label;+ }++ function rebuildChips(defs) {+ chipsWrap.innerHTML = '';+ defs.forEach((def, i) => {+ const btn = document.createElement('button');+ btn.type = 'button';+ btn.className = 'h-anim-chip';+ btn.dataset.anim = def.name;+ btn.textContent = prettyLabel(def);+ if (i === 0) btn.dataset.active = 'true';+ btn.addEventListener('click', async () => {+ chipsWrap+ .querySelectorAll('.h-anim-chip')+ .forEach((c) => delete c.dataset.active);+ btn.dataset.active = 'true';+ try {+ await viewer.playClip(def.name);+ } catch (e) {+ /* ignore */+ }+ });+ chipsWrap.appendChild(btn);+ });+ }++ viewer.onClipsReady = rebuildChips;++ viewer.loadModel('/animations/robotexpressive.glb').catch(console.error);++ opts.forEach((btn) => {+ btn.addEventListener('click', async () => {+ opts.forEach((b) => b.setAttribute('aria-pressed', 'false'));+ btn.setAttribute('aria-pressed', 'true');+ try {+ await viewer.loadModel(btn.dataset.src);+ } catch (e) {+ console.error(e);+ }+ });+ });++ let wider = false;+ const NEAR = 22,+ FAR = 36;+ canvas.addEventListener('click', () => {+ wider = !wider;+ viewer.zoom(wider ? FAR : NEAR);+ });+ });+ }++ if (!SKIP_OFFSCREEN_GL) {+ let act2Inited = false;+ const act2Obs = new IntersectionObserver((entries) => {+ if (entries[0].isIntersecting && !act2Inited) {+ act2Inited = true;+ act2Obs.disconnect();+ initAct2();+ }+ }, { threshold: 0, rootMargin: '600px 0px 600px 0px' });+ act2Obs.observe(canvas);+ }+ })();++ // Bento Viewer card+ (function () {+ const canvas = document.getElementById('bento-cz-canvas');+ const grid = document.querySelector('[data-role="bento-anim-grid"]');+ const stopBtn = document.querySelector('[data-role="bento-anim-stop"]');+ if (!canvas || !grid) return;++ function whenReady(cb) {+ if (window.Act2Viewer) return cb();+ setTimeout(() => whenReady(cb), 60);+ }++ function initViewer() {+ whenReady(() => {+ const viewer = new window.Act2Viewer(canvas, { fov: 20 });++ function prettyLabel(def) {+ return (def.label || def.name).replace(/\s*\([^)]*\)/g, '').trim();+ }++ function buildButtons(defs) {+ grid.innerHTML = '';+ defs.forEach((def, i) => {+ const btn = document.createElement('button');+ btn.type = 'button';+ btn.className = 'h-bento-anim-btn';+ btn.dataset.anim = def.name;+ btn.title = def.label || def.name;+ const icon = document.createElement('span');+ icon.className = 'h-bento-anim-btn__icon';+ icon.textContent = def.icon || '✨';+ const label = document.createElement('span');+ label.className = 'h-bento-anim-btn__label';+ label.textContent = prettyLabel(def);+ btn.appendChild(icon);+ btn.appendChild(label);+ if (i === 0) btn.classList.add('h-bento-anim-btn--active');+ btn.addEventListener('click', async () => {+ grid.querySelectorAll('.h-bento-anim-btn').forEach((b) =>+ b.classList.remove('h-bento-anim-btn--active'),+ );+ btn.classList.add('h-bento-anim-btn--active');+ btn.classList.add('h-bento-anim-btn--loading');+ try {+ await viewer.playClip(def.name);+ } catch (_) {}+ btn.classList.remove('h-bento-anim-btn--loading');+ });+ grid.appendChild(btn);+ });+ }++ viewer.onClipsReady = buildButtons;+ viewer+ .loadModel('/avatars/cz.glb', { autoPlay: false })+ .then(() => viewer.playClip('celebrate').catch(() => {}))+ .catch(console.error);++ if (stopBtn) {+ stopBtn.addEventListener('click', () => {+ if (viewer.mixer) viewer.mixer.stopAllAction();+ viewer.currentAction = null;+ grid.querySelectorAll('.h-bento-anim-btn').forEach((b) =>+ b.classList.remove('h-bento-anim-btn--active'),+ );+ });+ }+ });+ }++ if (!SKIP_OFFSCREEN_GL) {+ let inited = false;+ const io = new IntersectionObserver((entries) => {+ if (entries[0].isIntersecting && !inited) {+ inited = true;+ io.disconnect();+ initViewer();+ }+ }, { threshold: 0, rootMargin: '600px 0px 600px 0px' });+ io.observe(canvas);+ }+ })();++ // Custom cursor+ (function () {+ const cursor = document.getElementById('cursor');+ if (!cursor || window.matchMedia('(hover: none)').matches || REDUCED_MOTION) return;+ let cx = -100,+ cy = -100,+ tx = -100,+ ty = -100;+ document.addEventListener('mousemove', (e) => {+ tx = e.clientX;+ ty = e.clientY;+ });+ document.addEventListener('mouseleave', () => {+ tx = cy = -100;+ });+ const hover = 'a,button,[role="button"],.h-av-opt,.h-anim-chip';+ document.querySelectorAll(hover).forEach((el) => {+ el.addEventListener('mouseenter', () => cursor.classList.add('cursor--hover'));+ el.addEventListener('mouseleave', () =>+ cursor.classList.remove('cursor--hover'),+ );+ });+ (function loop() {+ cx += (tx - cx) * 0.18;+ cy += (ty - cy) * 0.18;+ cursor.style.transform = `translate(${cx}px,${cy}px) translate(-50%,-50%)`;+ requestAnimationFrame(loop);+ })();+ })();++ // Act 3 — animated trio of ghost avatars (robot, CZ, soldier)+ (function () {+ const configs = [+ {+ id: 'act3-avatar-a',+ src: '/animations/robotexpressive.glb',+ anim: 'capoeira',+ },+ { id: 'act3-avatar-b', src: '/avatars/cz.glb', anim: 'rumba' },+ { id: 'act3-avatar-c', src: '/animations/soldier.glb', anim: 'wave' },+ ];++ function whenReady(cb) {+ if (window.Act2Viewer) return cb();+ setTimeout(() => whenReady(cb), 60);+ }++ function initAct3() {+ whenReady(() => {+ configs.forEach(({ id, src, anim }) => {+ const canvas = document.getElementById(id);+ if (!canvas) return;+ const viewer = new window.Act2Viewer(canvas, { fov: 22 });+ viewer+ .loadModel(src)+ .then(() => viewer.playClip(anim).catch(() => {}))+ .catch(() => {});+ });+ });+ }++ const firstCanvas = document.getElementById('act3-avatar-a');+ if (firstCanvas && !SKIP_OFFSCREEN_GL) {+ let act3Inited = false;+ const act3Obs = new IntersectionObserver((entries) => {+ if (entries[0].isIntersecting && !act3Inited) {+ act3Inited = true;+ act3Obs.disconnect();+ initAct3();+ }+ }, { threshold: 0, rootMargin: '600px 0px 600px 0px' });+ act3Obs.observe(firstCanvas);+ }+ })();++ // Star field canvas+ (function () {+ for (const canvas of document.querySelectorAll('[data-role="star-canvas"]')) {+ const dpr = Math.min(window.devicePixelRatio || 1, 2);+ const w = window.innerWidth * dpr;+ const h = window.innerHeight * 8 * dpr;+ canvas.width = w;+ canvas.height = h;+ const ctx = canvas.getContext('2d');+ const tint = canvas.dataset.tint || '255,255,255';+ const count = parseInt(canvas.dataset.count || '250', 10);+ for (let i = 0; i < count; i++) {+ const x = Math.random() * w;+ const y = Math.random() * h;+ const r = (Math.random() * 1.4 + 0.3) * dpr;+ ctx.beginPath();+ ctx.arc(x, y, r, 0, Math.PI * 2);+ ctx.fillStyle = `rgba(${tint},${Math.random() * 0.65 + 0.2})`;+ ctx.fill();+ }+ for (let i = 0; i < 10; i++) {+ const x = Math.random() * w,+ y = Math.random() * h;+ const g = ctx.createRadialGradient(x, y, 0, x, y, 6 * dpr);+ g.addColorStop(0, `rgba(${tint},0.9)`);+ g.addColorStop(1, `rgba(${tint},0)`);+ ctx.beginPath();+ ctx.arc(x, y, 6 * dpr, 0, Math.PI * 2);+ ctx.fillStyle = g;+ ctx.fill();+ }+ }+ })();</script></body></html>diff --git a/public/dashboard/actions.html b/public/dashboard/actions.htmlindex c89294dbe..907914717 100644--- a/public/dashboard/actions.html+++ b/public/dashboard/actions.html@@ -314,88 +314,137 @@const params = new URLSearchParams(location.search);const agentId = params.get('agent');- if (!agentId) {- showError('Missing ?agent= parameter.');- document.body.innerHTML = '';- document.body.appendChild(- Object.assign(document.createElement('div'), {- textContent: 'Missing ?agent= parameter. Expected: ?agent=<id>',- style: 'color:#f87171;padding:20px;',- }),- );- }- // Auth check- (async () => {- try {- const r = await fetch(`/api/agents/${agentId}/actions?limit=1`, {- credentials: 'include',- });- if (r.status === 401) {- window.location.href = `/login?next=/dashboard/actions.html?agent=${agentId}`;- return;- }- if (r.status === 403) {- showError('Not authorized to view this agent.');- document.body.removeAttribute('data-auth-pending');- return;- }- if (r.status === 404) {- showError('Agent not found.');- document.body.removeAttribute('data-auth-pending');- return;- }- if (!r.ok) {- showError(`Error ${r.status}`);+ if (!agentId) {+ // No agent id in the URL (e.g. the dashboard sidebar "Action log"+ // link). Resolve the user's default agent and redirect.+ (async () => {+ try {+ const r = await fetch('/api/agents/me', { credentials: 'include' });+ if (r.status === 401) {+ window.location.href = '/login?next=' + encodeURIComponent('/dashboard/actions');+ return;+ }+ if (!r.ok) {+ document.body.removeAttribute('data-auth-pending');+ showError(`Could not load your default agent (HTTP ${r.status}).`);+ return;+ }+ const data = await r.json();+ const id = data?.agent?.id;+ if (!id) {+ document.body.removeAttribute('data-auth-pending');+ showError(+ 'No agent found on this account yet. Create one from the dashboard first.',+ );+ return;+ }+ window.location.replace(+ `/dashboard/actions?agent=${encodeURIComponent(id)}`,+ );+ } catch (e) {document.body.removeAttribute('data-auth-pending');- return;+ showError(`Could not resolve your default agent: ${e.message}`);}+ })();+ } else {+ // Auth check+ (async () => {+ try {+ const r = await fetch(`/api/agents/${agentId}/actions?limit=1`, {+ credentials: 'include',+ });+ if (r.status === 401) {+ window.location.href = `/login?next=/dashboard/actions.html?agent=${agentId}`;+ return;+ }+ if (r.status === 403) {+ showError('Not authorized to view this agent.');+ document.body.removeAttribute('data-auth-pending');+ return;+ }+ if (r.status === 404) {+ showError('Agent not found.');+ document.body.removeAttribute('data-auth-pending');+ return;+ }+ if (!r.ok) {+ showError(`Error ${r.status}`);+ document.body.removeAttribute('data-auth-pending');+ return;+ }- document.body.removeAttribute('data-auth-pending');- const data = await r.json();- const { actions, nextCursor: nc } = data;-- // Fetch agent info- const agentR = await fetch(`/api/agents/${agentId}`, {- credentials: 'include',- });- if (agentR.ok) {- const agentData = await agentR.json();- const agent = agentData.agent;- document.getElementById('agent-name').textContent = agent?.name || agentId;- document.getElementById('agent-id').textContent = `${agentId}${- agent?.wallet_address ? ` · ${agent.wallet_address.slice(0, 10)}…` : ''- }`;-- if (agent?.wallet_address) {- const pill = document.getElementById('signer-pill');- pill.textContent = `Signed by ${agent.wallet_address.slice(0, 10)}…${agent.wallet_address.slice(- -8,- )}`;- pill.className = 'signer-pill verified';- pill.style.display = 'inline-block';+ document.body.removeAttribute('data-auth-pending');+ const data = await r.json();+ const { actions, nextCursor: nc } = data;++ // Fetch agent info+ const agentR = await fetch(`/api/agents/${agentId}`, {+ credentials: 'include',+ });+ if (agentR.ok) {+ const agentData = await agentR.json();+ const agent = agentData.agent;+ document.getElementById('agent-name').textContent = agent?.name || agentId;+ document.getElementById('agent-id').textContent = `${agentId}${+ agent?.wallet_address ? ` · ${agent.wallet_address.slice(0, 10)}…` : ''+ }`;++ if (agent?.wallet_address) {+ const pill = document.getElementById('signer-pill');+ pill.textContent = `Signed by ${agent.wallet_address.slice(0, 10)}…${agent.wallet_address.slice(+ -8,+ )}`;+ pill.className = 'signer-pill verified';+ pill.style.display = 'inline-block';+ }}++ // Load initial page+ nextCursor = nc;+ await loadMore();+ } catch (e) {+ showError(`Fetch failed: ${e.message}`);}+ })();- // Load initial page- nextCursor = nc;- await loadMore();- } catch (e) {- showError(`Fetch failed: ${e.message}`);- }- })();+ // IntersectionObserver for infinite scroll+ const observer = new IntersectionObserver(+ (entries) => {+ if (entries[0].isIntersecting && !isLoading && hasMore) {+ loadMore();+ }+ },+ { rootMargin: '200px' },+ );- // IntersectionObserver for infinite scroll- const observer = new IntersectionObserver(- (entries) => {- if (entries[0].isIntersecting && !isLoading && hasMore) {- loadMore();- }- },- { rootMargin: '200px' },- );+ observer.observe(document.getElementById('scroll-trigger'));++ // Filter changes+ document.querySelectorAll('.filter-chip').forEach((btn) => {+ btn.addEventListener('click', () => {+ document+ .querySelectorAll('.filter-chip')+ .forEach((b) => b.classList.remove('active'));+ btn.classList.add('active');+ currentFilter = btn.dataset.filter;+ render();+ });+ });- observer.observe(document.getElementById('scroll-trigger'));+ // Export+ document.getElementById('export-btn').addEventListener('click', () => {+ const filtered = getFiltered();+ const json = JSON.stringify(filtered, null, 2);+ const blob = new Blob([json], { type: 'application/json' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `actions-${agentId}-${new Date().toISOString().split('T')[0]}.json`;+ a.click();+ URL.revokeObjectURL(url);+ });+ }// Load more actionsasync function loadMore() {@@ -430,31 +479,6 @@}}- // Filter changes- document.querySelectorAll('.filter-chip').forEach((btn) => {- btn.addEventListener('click', () => {- document- .querySelectorAll('.filter-chip')- .forEach((b) => b.classList.remove('active'));- btn.classList.add('active');- currentFilter = btn.dataset.filter;- render();- });- });-- // Export- document.getElementById('export-btn').addEventListener('click', () => {- const filtered = getFiltered();- const json = JSON.stringify(filtered, null, 2);- const blob = new Blob([json], { type: 'application/json' });- const url = URL.createObjectURL(blob);- const a = document.createElement('a');- a.href = url;- a.download = `actions-${agentId}-${new Date().toISOString().split('T')[0]}.json`;- a.click();- URL.revokeObjectURL(url);- });-function getFiltered() {if (currentFilter === 'all') return allActions;return allActions.filter((a) => a.type === currentFilter);diff --git a/public/dashboard/memory.html b/public/dashboard/memory.htmlindex d978d177a..1763d3313 100644--- a/public/dashboard/memory.html+++ b/public/dashboard/memory.html@@ -4,10 +4,23 @@<meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>Agent Memory · three.ws</title>+ <link rel="icon" href="/favicon.ico" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" /><link rel="stylesheet" href="/dashboard/_dash-shell.css" />+ <style>+ .skip-link { position: absolute; left: -9999px; }+ .skip-link:focus { left: 1rem; top: 1rem; padding: .5rem 1rem; background: #0c0c0c; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; z-index: 9999; color: #fff; text-decoration: none; }+ </style></head><body>- <div class="dash-shell">+ <a href="#main-content" class="skip-link">Skip to main content</a>+ <header>+ <div id="nav-container"></div>+ </header>+ <script src="/nav.js"></script>++ <main id="main-content" class="dash-shell"><a class="dash-back" href="/dashboard/agents">← Back to dashboard</a><h1 class="dash-title">Agent Memory</h1><p class="dash-sub">@@ -18,7 +31,7 @@<div id="picker"></div><div id="status"></div><div id="content"></div>- </div>+ </main><script type="module">import { mountAgentPicker } from '/dashboard/_agent-picker.js';@@ -200,5 +213,8 @@onPick: (agentId) => refresh(agentId),});</script>++ <div id="footer-container"></div>+ <script src="/footer.js" defer></script></body></html>diff --git a/public/dashboard/storage.html b/public/dashboard/storage.htmlindex f69ef267e..dceac5de8 100644--- a/public/dashboard/storage.html+++ b/public/dashboard/storage.html@@ -230,12 +230,15 @@<main><h1>Storage</h1><p class="sub">- Manage where <code id="avatar-id-label"></code>'s bytes live and track content+ Manage where <code id="avatar-id-label">your avatar</code>'s bytes live and track contentattestation.</p>+ <div id="picker"></div><div id="status"></div>+ <div id="storage-cards" class="hidden">+<!-- R2 --><div class="card"><fieldset>@@ -307,21 +310,20 @@<div class="actions"><button class="btn sec" id="reload">Reload</button>+ </div>+ <!-- /storage-cards --></div></main><script type="module">- const params = new URL(location.href).searchParams;- const avatarId = params.get('id');+ import { mountAgentPicker } from '/dashboard/_agent-picker.js';+const statusEl = document.getElementById('status');const nameEl = document.getElementById('avatar-name');const labelEl = document.getElementById('avatar-id-label');+ const cardsEl = document.getElementById('storage-cards');+ const pickerEl = document.getElementById('picker');- if (!avatarId) {- statusEl.innerHTML =- '<div class="err">Missing <code>?id=AVATAR_ID</code> in URL.</div>';- throw new Error('no avatar id');- }- labelEl.textContent = avatarId;+ let avatarId = null;async function api(method, path, body) {const res = await fetch(path, {@@ -417,6 +419,7 @@const data = await api('GET', `/api/avatars/${avatarId}`);const av = data.avatar || data;nameEl.textContent = av.name || avatarId;+ labelEl.textContent = av.name || avatarId;} catch (e) {setStatus(`<div class="err">Could not load avatar: ${escapeHtml(e.message)}</div>`,@@ -455,13 +458,45 @@}}+ async function loadForAvatar(id) {+ avatarId = id;+ setStatus('');+ cardsEl.classList.remove('hidden');+ labelEl.textContent = id;+ await loadAvatar();+ await loadMode();+ }++ async function loadForAgent(agent) {+ if (!agent?.avatar_id) {+ cardsEl.classList.add('hidden');+ setStatus(+ `<div class="err">${escapeHtml(agent?.name || 'This agent')} has no avatar attached. Attach one from the agent editor first.</div>`,+ );+ return;+ }+ nameEl.textContent = agent.name || 'Avatar';+ await loadForAvatar(agent.avatar_id);+ }+document.getElementById('pin-btn').addEventListener('click', pinIpfs);document.getElementById('reload').addEventListener('click', loadMode);(async () => {await loadMe();- await loadAvatar();- await loadMode();++ const params = new URLSearchParams(location.search);+ const directAvatarId = params.get('id');++ if (directAvatarId) {+ await loadForAvatar(directAvatarId);+ return;+ }++ await mountAgentPicker({+ host: pickerEl,+ onPick: (_agentId, agent) => loadForAgent(agent),+ });})();</script></body>diff --git a/public/nav.css b/public/nav.cssindex 9d53ccd76..5bc543681 100644--- a/public/nav.css+++ b/public/nav.css@@ -1,5 +1,21 @@/* ── Shared nav styles for .home-nav (used wherever nav.js is loaded) ── */+.site-header-brand .wordmark-logo {+ width: 28px;+ height: 28px;+ display: inline-block;+ vertical-align: middle;+}++.site-header-brand .wordmark-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);+ box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);+ display: inline-block;+}+.home-nav {margin-left: auto;display: flex;diff --git a/public/nav.html b/public/nav.htmlindex bb0a934bc..de018d859 100644--- a/public/nav.html+++ b/public/nav.html@@ -154,6 +154,12 @@><span class="nav-mi-sub">Pick avatar → copy snippet</span></a></li>+ <li role="none">+ <a href="/embed.html" role="menuitem"+ ><span class="nav-mi-title">Embed editor</span+ ><span class="nav-mi-sub">Tune mode, size, position</span></a+ >+ </li><li role="none"><a href="/artifact" role="menuitem"><span class="nav-mi-title">Artifact viewer</spandiff --git a/pump-visualizer.html b/pump-visualizer.htmlindex f05b9bc7c..7fc43a06c 100644--- a/pump-visualizer.html+++ b/pump-visualizer.html@@ -1,59 +1,891 @@-<!DOCTYPE html><html lang="en"><head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>3D-Agent · Pump.fun Visualizer</title>- <meta name="description" content="A real-time 3D visualization of trending tokens on Pump.fun.">- <link rel="stylesheet" href="/style.css">- <style>- body { margin: 0; overflow: hidden; }- canvas { display: block; }- </style>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <script defer src="/footer-newsletter.js"></script>- </head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>3D-Agent · Pump.fun Visualizer</title>+ <meta name="description" content="A real-time 3D visualization of trending tokens on Pump.fun. Each sphere is a live coin, sized by market cap.">+ <link rel="canonical" href="/pump-visualizer">+ <link rel="stylesheet" href="/style.css">+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <script defer src="/footer-newsletter.js"></script>+ <style>+ :root {+ --vz-bg: #05060a;+ --vz-panel: rgba(12, 14, 22, 0.88);+ --vz-border: rgba(139, 92, 246, 0.35);+ --vz-text: #e6e7ee;+ --vz-muted: #8a8fa6;+ --vz-accent: #8b5cf6;+ --vz-green: #34d399;+ --vz-red: #f87171;+ }+ html, body { background: var(--vz-bg); color: var(--vz-text); overflow: hidden; height: 100%; }+ body { margin: 0; }+ .site-header { position: relative; z-index: 20; background: rgba(5, 6, 10, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }++ #vz-stage {+ position: fixed;+ inset: 0;+ z-index: 0;+ }+ #vz-canvas-host {+ position: absolute;+ inset: 0;+ }+ #vz-canvas-host canvas {+ display: block;+ width: 100% !important;+ height: 100% !important;+ cursor: grab;+ }+ #vz-canvas-host canvas:active { cursor: grabbing; }+ #vz-canvas-host.is-pointing canvas { cursor: pointer; }++ .vz-overlay {+ position: absolute;+ pointer-events: none;+ z-index: 10;+ }+ .vz-overlay > * { pointer-events: auto; }++ /* ── Top status bar ───────────────────────────── */+ .vz-status {+ top: calc(var(--header-h, 3.5rem) + 12px);+ left: 16px;+ display: flex;+ align-items: center;+ gap: 10px;+ background: var(--vz-panel);+ border: 1px solid var(--vz-border);+ border-radius: 10px;+ padding: 8px 14px;+ font-family: var(--font-mono);+ font-size: 12px;+ letter-spacing: 0.04em;+ color: var(--vz-text);+ }+ .vz-status .dot {+ width: 8px; height: 8px; border-radius: 50%;+ background: #555; box-shadow: 0 0 8px rgba(0,0,0,0.4);+ }+ .vz-status[data-state="loading"] .dot { background: #f59e0b; animation: vzPulse 1.2s ease-in-out infinite; }+ .vz-status[data-state="ready"] .dot { background: var(--vz-green); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }+ .vz-status[data-state="error"] .dot { background: var(--vz-red); }+ @keyframes vzPulse {+ 0%, 100% { opacity: 0.4; }+ 50% { opacity: 1; }+ }+ .vz-status button {+ background: transparent;+ border: 1px solid var(--vz-border);+ color: var(--vz-text);+ border-radius: 6px;+ padding: 4px 10px;+ font: inherit;+ cursor: pointer;+ margin-left: 4px;+ }+ .vz-status button:hover { background: var(--accent-soft); }+ .vz-status button:disabled { opacity: 0.5; cursor: not-allowed; }++ /* ── Help / hint ──────────────────────────────── */+ .vz-hint {+ top: calc(var(--header-h, 3.5rem) + 12px);+ right: 16px;+ background: var(--vz-panel);+ border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 10px;+ padding: 8px 12px;+ font-family: var(--font-mono);+ font-size: 11px;+ color: var(--vz-muted);+ max-width: 240px;+ line-height: 1.6;+ }+ .vz-hint b { color: var(--vz-text); font-weight: 600; }++ /* ── Hover tooltip (follows cursor) ───────────── */+ .vz-tooltip {+ position: fixed;+ z-index: 15;+ pointer-events: none;+ background: rgba(5, 6, 10, 0.95);+ border: 1px solid var(--vz-border);+ border-radius: 8px;+ padding: 8px 12px;+ font-family: var(--font-mono);+ font-size: 12px;+ color: var(--vz-text);+ transform: translate(12px, 12px);+ opacity: 0;+ transition: opacity 0.12s ease;+ white-space: nowrap;+ }+ .vz-tooltip.is-visible { opacity: 1; }+ .vz-tooltip .name { color: var(--vz-accent); font-weight: 600; }+ .vz-tooltip .mcap { color: var(--vz-green); }++ /* ── Detail panel ─────────────────────────────── */+ .vz-detail {+ position: absolute;+ top: 0;+ right: 0;+ bottom: 0;+ width: 360px;+ max-width: 90vw;+ background: var(--vz-panel);+ border-left: 1px solid var(--vz-border);+ backdrop-filter: blur(12px);+ -webkit-backdrop-filter: blur(12px);+ padding: calc(var(--header-h, 3.5rem) + 20px) 20px 20px;+ overflow-y: auto;+ transform: translateX(100%);+ transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);+ display: flex;+ flex-direction: column;+ gap: 14px;+ }+ .vz-detail.is-open { transform: translateX(0); }+ .vz-detail .close {+ position: absolute;+ top: calc(var(--header-h, 3.5rem) + 12px);+ right: 12px;+ width: 28px; height: 28px;+ border: 1px solid rgba(255,255,255,0.15);+ background: rgba(255,255,255,0.04);+ color: var(--vz-text);+ border-radius: 50%;+ cursor: pointer;+ font-size: 16px;+ line-height: 1;+ }+ .vz-detail .close:hover { background: var(--accent-soft); }+ .vz-detail .head { display: flex; align-items: center; gap: 12px; }+ .vz-detail .avatar {+ width: 56px; height: 56px; border-radius: 50%;+ background: #111; border: 1px solid var(--vz-border);+ object-fit: cover; flex-shrink: 0;+ }+ .vz-detail .title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }+ .vz-detail .title .name {+ font-family: var(--font-display);+ font-size: 18px; font-weight: 600;+ color: var(--vz-text);+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;+ }+ .vz-detail .title .symbol {+ font-family: var(--font-mono);+ font-size: 13px; color: var(--vz-accent);+ }+ .vz-detail .stats {+ display: grid; grid-template-columns: 1fr 1fr; gap: 10px;+ padding: 12px; border-radius: 8px;+ background: rgba(255,255,255,0.03);+ border: 1px solid rgba(255,255,255,0.06);+ }+ .vz-detail .stat .label {+ font-family: var(--font-mono);+ font-size: 10px; letter-spacing: 0.08em;+ color: var(--vz-muted); text-transform: uppercase;+ }+ .vz-detail .stat .value {+ font-family: var(--font-mono);+ font-size: 14px; color: var(--vz-text); margin-top: 2px;+ }+ .vz-detail .stat .value.green { color: var(--vz-green); }+ .vz-detail .description {+ font-size: 13px; line-height: 1.55; color: var(--vz-muted);+ max-height: 140px; overflow-y: auto;+ padding: 10px; border-radius: 8px;+ background: rgba(255,255,255,0.02);+ border: 1px solid rgba(255,255,255,0.05);+ }+ .vz-detail .description:empty { display: none; }+ .vz-detail .mint {+ font-family: var(--font-mono);+ font-size: 11px; color: var(--vz-muted);+ word-break: break-all;+ padding: 8px 10px;+ background: rgba(0,0,0,0.4);+ border: 1px solid rgba(255,255,255,0.05);+ border-radius: 6px;+ }+ .vz-detail .links { display: flex; flex-wrap: wrap; gap: 6px; }+ .vz-detail .links a {+ display: inline-flex; align-items: center; gap: 4px;+ padding: 6px 10px; font-size: 12px;+ border-radius: 6px;+ border: 1px solid var(--vz-border);+ color: var(--vz-text);+ text-decoration: none;+ background: rgba(139, 92, 246, 0.08);+ transition: background 0.15s;+ }+ .vz-detail .links a:hover { background: var(--accent-soft); }+ .vz-detail .links a.primary {+ background: var(--vz-accent); color: #fff; border-color: var(--vz-accent);+ }+ .vz-detail .live-badge {+ display: inline-flex; align-items: center; gap: 6px;+ padding: 3px 8px; font-size: 10px; letter-spacing: 0.06em;+ text-transform: uppercase;+ background: rgba(248, 113, 113, 0.15);+ color: var(--vz-red);+ border: 1px solid rgba(248, 113, 113, 0.4);+ border-radius: 20px;+ margin-top: 4px;+ width: max-content;+ }+ .vz-detail .live-badge::before {+ content: ''; width: 6px; height: 6px; border-radius: 50%;+ background: var(--vz-red); animation: vzPulse 1.2s ease-in-out infinite;+ }++ /* ── Legend (bottom-left rank list) ───────────── */+ .vz-legend {+ bottom: 16px;+ left: 16px;+ background: var(--vz-panel);+ border: 1px solid rgba(255,255,255,0.08);+ border-radius: 10px;+ padding: 10px 12px;+ max-height: 220px;+ overflow-y: auto;+ width: 240px;+ font-family: var(--font-mono);+ font-size: 12px;+ }+ .vz-legend .head {+ color: var(--vz-muted);+ font-size: 10px; letter-spacing: 0.1em;+ text-transform: uppercase;+ padding-bottom: 6px; margin-bottom: 6px;+ border-bottom: 1px solid rgba(255,255,255,0.06);+ }+ .vz-legend ol { list-style: none; padding: 0; margin: 0; }+ .vz-legend li {+ display: flex; align-items: center; gap: 8px;+ padding: 4px 2px; border-radius: 4px;+ cursor: pointer;+ color: var(--vz-text);+ }+ .vz-legend li:hover { background: rgba(255,255,255,0.04); }+ .vz-legend li.is-selected { background: var(--accent-soft); }+ .vz-legend li .rank { color: var(--vz-muted); width: 22px; }+ .vz-legend li .sym { color: var(--vz-accent); }+ .vz-legend li .name {+ flex: 1; min-width: 0;+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;+ }++ /* ── Error overlay ────────────────────────────── */+ .vz-error {+ position: absolute;+ top: 50%; left: 50%;+ transform: translate(-50%, -50%);+ background: var(--vz-panel);+ border: 1px solid rgba(248, 113, 113, 0.4);+ border-radius: 10px;+ padding: 20px 28px;+ text-align: center;+ max-width: 360px;+ }+ .vz-error h3 { margin: 0 0 8px; color: var(--vz-red); font-family: var(--font-display); }+ .vz-error p { margin: 0 0 14px; color: var(--vz-muted); font-size: 13px; }+ .vz-error button {+ background: var(--vz-accent);+ color: #fff;+ border: none;+ border-radius: 6px;+ padding: 8px 18px;+ font: inherit;+ cursor: pointer;+ }++ @media (max-width: 720px) {+ .vz-hint { display: none; }+ .vz-legend { width: 180px; max-height: 160px; bottom: 12px; left: 12px; }+ .vz-detail { width: 100%; }+ }+ </style>+</head><body>- <header class="site-header">- <h1 class="site-header-brand">- <a href="/" aria-label="three.ws home"><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span class="wordmark-dot" aria-hidden="true"></span>three.ws</a>- </h1>- <div id="nav-container"></div>- </header>- <script src="/nav.js"></script>-- <script type="module">- import * as THREE from 'three';-- // Scene setup- const scene = new THREE.Scene();- const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);- const renderer = new THREE.WebGLRenderer();- renderer.setSize(window.innerWidth, window.innerHeight);- document.body.appendChild(renderer.domElement);-- // Placeholder object- const geometry = new THREE.BoxGeometry();- const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });- const cube = new THREE.Mesh(geometry, material);- scene.add(cube);-- camera.position.z = 5;-- // Animation loop- function animate() {- requestAnimationFrame(animate);- cube.rotation.x += 0.01;- cube.rotation.y += 0.01;- renderer.render(scene, camera);- }-- animate();- </script>-- <div id="footer-container"></div>- <script src="/footer.js"></script>+ <header class="site-header">+ <h1 class="site-header-brand">+ <a href="/" aria-label="three.ws home"><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span class="wordmark-dot" aria-hidden="true"></span>three.ws</a>+ </h1>+ <div id="nav-container"></div>+ </header>+ <script src="/nav.js"></script>++ <div id="vz-stage">+ <div id="vz-canvas-host"></div>++ <div class="vz-overlay vz-status" id="vz-status" data-state="loading" role="status" aria-live="polite">+ <span class="dot"></span>+ <span id="vz-status-text">Loading trending tokens…</span>+ <button id="vz-refresh" type="button" title="Refresh data" disabled>↻ Refresh</button>+ </div>++ <div class="vz-overlay vz-hint" aria-hidden="true">+ <b>Drag</b> to rotate · <b>Scroll</b> to zoom · <b>Click</b> a sphere for details+ </div>++ <aside class="vz-overlay vz-legend" id="vz-legend" hidden>+ <div class="head">Top 20 by Market Cap</div>+ <ol id="vz-legend-list"></ol>+ </aside>++ <aside class="vz-overlay vz-detail" id="vz-detail" aria-hidden="true">+ <button class="close" type="button" id="vz-detail-close" aria-label="Close details">×</button>+ <div class="head">+ <img class="avatar" id="vz-detail-avatar" alt="" />+ <div class="title">+ <span class="name" id="vz-detail-name"></span>+ <span class="symbol" id="vz-detail-symbol"></span>+ </div>+ </div>+ <div class="live-badge" id="vz-detail-live" hidden>Live now</div>+ <div class="stats">+ <div class="stat"><div class="label">Market cap</div><div class="value green" id="vz-detail-mcap"></div></div>+ <div class="stat"><div class="label">ATH market cap</div><div class="value" id="vz-detail-ath"></div></div>+ <div class="stat"><div class="label">Replies</div><div class="value" id="vz-detail-replies"></div></div>+ <div class="stat"><div class="label">Age</div><div class="value" id="vz-detail-age"></div></div>+ </div>+ <div class="description" id="vz-detail-description"></div>+ <div class="mint" id="vz-detail-mint" title="Token mint address"></div>+ <div class="links" id="vz-detail-links"></div>+ </aside>++ <div class="vz-tooltip" id="vz-tooltip">+ <div class="name" id="vz-tt-name"></div>+ <div class="mcap" id="vz-tt-mcap"></div>+ </div>++ <div class="vz-error" id="vz-error" hidden>+ <h3>Could not load trending tokens</h3>+ <p id="vz-error-message"></p>+ <button type="button" id="vz-error-retry">Retry</button>+ </div>+ </div>++ <script type="module">+ import * as THREE from 'three';+ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';++ const TRENDING_API = '/api/pump/trending?limit=50';+ const SPHERE_RADIUS = 28;+ const MIN_TOKEN_R = 0.9;+ const MAX_TOKEN_R = 3.2;++ const host = document.getElementById('vz-canvas-host');+ const statusEl = document.getElementById('vz-status');+ const statusText = document.getElementById('vz-status-text');+ const refreshBtn = document.getElementById('vz-refresh');+ const tooltip = document.getElementById('vz-tooltip');+ const ttName = document.getElementById('vz-tt-name');+ const ttMcap = document.getElementById('vz-tt-mcap');+ const detailEl = document.getElementById('vz-detail');+ const detailClose = document.getElementById('vz-detail-close');+ const legendEl = document.getElementById('vz-legend');+ const legendList = document.getElementById('vz-legend-list');+ const errorEl = document.getElementById('vz-error');+ const errorMessage = document.getElementById('vz-error-message');+ const errorRetry = document.getElementById('vz-error-retry');++ // ── three.js scene ────────────────────────────────────────────+ const scene = new THREE.Scene();+ scene.background = new THREE.Color(0x05060a);+ scene.fog = new THREE.Fog(0x05060a, 80, 220);++ const camera = new THREE.PerspectiveCamera(55, 1, 0.1, 500);+ camera.position.set(0, 8, 70);++ const renderer = new THREE.WebGLRenderer({ antialias: true, powerPreference: 'high-performance' });+ renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ host.appendChild(renderer.domElement);++ const controls = new OrbitControls(camera, renderer.domElement);+ controls.enableDamping = true;+ controls.dampingFactor = 0.06;+ controls.rotateSpeed = 0.6;+ controls.zoomSpeed = 0.7;+ controls.minDistance = 8;+ controls.maxDistance = 160;+ controls.autoRotate = true;+ controls.autoRotateSpeed = 0.35;++ // Lights+ scene.add(new THREE.AmbientLight(0xffffff, 0.55));+ const key = new THREE.DirectionalLight(0xc4b5fd, 0.9);+ key.position.set(40, 60, 50);+ scene.add(key);+ const rim = new THREE.DirectionalLight(0x6366f1, 0.45);+ rim.position.set(-50, -20, -40);+ scene.add(rim);++ // Starfield+ (function buildStars() {+ const count = 2500;+ const geom = new THREE.BufferGeometry();+ const positions = new Float32Array(count * 3);+ for (let i = 0; i < count; i++) {+ const r = 180 + Math.random() * 140;+ const t = Math.random() * Math.PI * 2;+ const p = Math.acos(2 * Math.random() - 1);+ positions[i * 3 + 0] = r * Math.sin(p) * Math.cos(t);+ positions[i * 3 + 1] = r * Math.sin(p) * Math.sin(t);+ positions[i * 3 + 2] = r * Math.cos(p);+ }+ geom.setAttribute('position', new THREE.BufferAttribute(positions, 3));+ const mat = new THREE.PointsMaterial({ size: 0.6, color: 0xaaaaff, transparent: true, opacity: 0.7, sizeAttenuation: true });+ scene.add(new THREE.Points(geom, mat));+ })();++ // Centerpiece — accent core+ const core = new THREE.Mesh(+ new THREE.IcosahedronGeometry(1.6, 1),+ new THREE.MeshStandardMaterial({ color: 0x8b5cf6, emissive: 0x4c1d95, emissiveIntensity: 0.5, roughness: 0.35, metalness: 0.7, wireframe: false })+ );+ scene.add(core);+ const coreGlow = new THREE.Mesh(+ new THREE.SphereGeometry(2.4, 32, 32),+ new THREE.MeshBasicMaterial({ color: 0x8b5cf6, transparent: true, opacity: 0.12 })+ );+ scene.add(coreGlow);++ // Token meshes+ const tokensGroup = new THREE.Group();+ scene.add(tokensGroup);++ const tokenMeshes = []; // { mesh, ring, data, baseScale }+ const textureLoader = new THREE.TextureLoader();+ textureLoader.crossOrigin = 'anonymous';++ function fibonacciSphere(n) {+ const points = [];+ const phi = Math.PI * (Math.sqrt(5) - 1);+ for (let i = 0; i < n; i++) {+ const y = 1 - (i / (n - 1)) * 2;+ const r = Math.sqrt(1 - y * y);+ const theta = phi * i;+ points.push({ x: Math.cos(theta) * r, y, z: Math.sin(theta) * r });+ }+ return points;+ }++ // Fallback canvas-textured material when the token image fails to load.+ // Renders the symbol on a tinted background so the sphere is never blank.+ function fallbackTexture(symbol, seedMint) {+ const size = 256;+ const c = document.createElement('canvas');+ c.width = size; c.height = size;+ const ctx = c.getContext('2d');+ const hue = hashStr(seedMint || symbol || 'pump') % 360;+ const grad = ctx.createRadialGradient(size / 2, size / 2, size / 8, size / 2, size / 2, size / 2);+ grad.addColorStop(0, `hsl(${hue}, 70%, 55%)`);+ grad.addColorStop(1, `hsl(${(hue + 40) % 360}, 70%, 25%)`);+ ctx.fillStyle = grad;+ ctx.fillRect(0, 0, size, size);+ ctx.fillStyle = '#fff';+ ctx.font = 'bold 88px "Space Grotesk", system-ui, sans-serif';+ ctx.textAlign = 'center';+ ctx.textBaseline = 'middle';+ const label = ((symbol || '?').slice(0, 4)).toUpperCase();+ ctx.fillText(label, size / 2, size / 2 + 6);+ const tex = new THREE.CanvasTexture(c);+ tex.colorSpace = THREE.SRGBColorSpace;+ tex.anisotropy = 4;+ return tex;+ }++ function hashStr(s) {+ let h = 0;+ for (let i = 0; i < s.length; i++) h = ((h << 5) - h + s.charCodeAt(i)) | 0;+ return Math.abs(h);+ }++ function loadTokenTexture(url, fallback) {+ return new Promise((resolve) => {+ if (!url) return resolve(fallback);+ textureLoader.load(+ url,+ (tex) => {+ tex.colorSpace = THREE.SRGBColorSpace;+ tex.anisotropy = 4;+ resolve(tex);+ },+ undefined,+ () => resolve(fallback),+ );+ });+ }++ function buildTokenMesh(token, position, radius) {+ const fallback = fallbackTexture(token.symbol, token.mint);+ const material = new THREE.MeshStandardMaterial({+ map: fallback,+ roughness: 0.45,+ metalness: 0.25,+ emissive: 0x000000,+ emissiveIntensity: 0,+ });+ const geometry = new THREE.SphereGeometry(radius, 28, 28);+ const mesh = new THREE.Mesh(geometry, material);+ mesh.position.copy(position);++ // Selection / hover ring (hidden by default)+ const ringGeo = new THREE.RingGeometry(radius * 1.18, radius * 1.32, 48);+ const ringMat = new THREE.MeshBasicMaterial({+ color: 0x8b5cf6,+ transparent: true,+ opacity: 0,+ side: THREE.DoubleSide,+ depthWrite: false,+ });+ const ring = new THREE.Mesh(ringGeo, ringMat);+ ring.position.copy(position);+ ring.lookAt(0, 0, 0);++ mesh.userData = { token, ring };++ // Swap to real artwork asynchronously; keeps fallback if it fails.+ if (token.image_uri) {+ loadTokenTexture(token.image_uri, null).then((tex) => {+ if (tex) {+ material.map = tex;+ material.needsUpdate = true;+ }+ });+ }++ return { mesh, ring };+ }++ function placeTokens(tokens) {+ // Wipe previous run so refresh swaps cleanly.+ while (tokensGroup.children.length) {+ const child = tokensGroup.children[0];+ tokensGroup.remove(child);+ if (child.geometry) child.geometry.dispose();+ if (child.material) {+ if (child.material.map) child.material.map.dispose();+ child.material.dispose();+ }+ }+ tokenMeshes.length = 0;++ const caps = tokens.map((t) => Math.max(1, Number(t.usd_market_cap) || 0));+ const maxLog = Math.log10(Math.max(...caps, 10));+ const minLog = Math.log10(Math.max(Math.min(...caps), 1));+ const span = Math.max(0.0001, maxLog - minLog);++ const points = fibonacciSphere(tokens.length);++ tokens.forEach((token, i) => {+ const cap = caps[i];+ const t = (Math.log10(cap) - minLog) / span;+ const radius = MIN_TOKEN_R + t * (MAX_TOKEN_R - MIN_TOKEN_R);++ // Wobble each point inward a touch for big caps so they don't all sit on a perfect shell.+ const shellR = SPHERE_RADIUS * (0.82 + (1 - t) * 0.25);+ const p = points[i];+ const position = new THREE.Vector3(p.x * shellR, p.y * shellR, p.z * shellR);++ const { mesh, ring } = buildTokenMesh(token, position, radius);+ tokensGroup.add(mesh);+ tokensGroup.add(ring);+ tokenMeshes.push({ mesh, ring, data: token, baseScale: 1 });+ });+ }++ // ── interactivity ────────────────────────────────────────────+ const raycaster = new THREE.Raycaster();+ const pointer = new THREE.Vector2();+ let hovered = null;+ let selected = null;++ renderer.domElement.addEventListener('pointermove', (ev) => {+ const rect = renderer.domElement.getBoundingClientRect();+ pointer.x = ((ev.clientX - rect.left) / rect.width) * 2 - 1;+ pointer.y = -((ev.clientY - rect.top) / rect.height) * 2 + 1;+ tooltip.style.left = ev.clientX + 'px';+ tooltip.style.top = ev.clientY + 'px';+ });++ // Click vs drag detection — OrbitControls swallows drags but we still+ // want to suppress clicks that came from a long mouse-down or movement.+ let pressStart = null;+ renderer.domElement.addEventListener('pointerdown', (ev) => {+ pressStart = { x: ev.clientX, y: ev.clientY, t: Date.now() };+ });+ renderer.domElement.addEventListener('pointerup', (ev) => {+ if (!pressStart) return;+ const dx = ev.clientX - pressStart.x;+ const dy = ev.clientY - pressStart.y;+ const dt = Date.now() - pressStart.t;+ pressStart = null;+ if (Math.hypot(dx, dy) > 6 || dt > 350) return;+ handleClick();+ });++ function handleClick() {+ raycaster.setFromCamera(pointer, camera);+ const meshes = tokenMeshes.map((t) => t.mesh);+ const hits = raycaster.intersectObjects(meshes, false);+ if (!hits.length) return;+ const data = hits[0].object.userData.token;+ selectToken(data);+ }++ function setHovered(entry) {+ if (hovered === entry) return;+ if (hovered && hovered !== selected) hovered.ring.material.opacity = 0;+ hovered = entry;+ if (entry) {+ if (entry !== selected) entry.ring.material.opacity = 0.55;+ host.classList.add('is-pointing');+ ttName.textContent = (entry.data.name || 'Unknown') + (entry.data.symbol ? ` · $${entry.data.symbol}` : '');+ ttMcap.textContent = formatMcap(entry.data.usd_market_cap);+ tooltip.classList.add('is-visible');+ } else {+ host.classList.remove('is-pointing');+ tooltip.classList.remove('is-visible');+ }+ }++ function selectToken(token) {+ const entry = tokenMeshes.find((t) => t.data.mint === token.mint);+ if (!entry) return;+ if (selected && selected !== entry) selected.ring.material.opacity = 0;+ selected = entry;+ selected.ring.material.color.set(0x34d399);+ selected.ring.material.opacity = 1;+ controls.autoRotate = false;+ renderDetail(token);+ highlightLegend(token.mint);+ }++ function clearSelection() {+ if (selected) {+ selected.ring.material.opacity = 0;+ selected.ring.material.color.set(0x8b5cf6);+ selected = null;+ }+ detailEl.classList.remove('is-open');+ detailEl.setAttribute('aria-hidden', 'true');+ controls.autoRotate = true;+ highlightLegend(null);+ }++ detailClose.addEventListener('click', clearSelection);+ document.addEventListener('keydown', (ev) => {+ if (ev.key === 'Escape') clearSelection();+ });++ // ── detail panel rendering ───────────────────────────────────+ function renderDetail(token) {+ const avatar = document.getElementById('vz-detail-avatar');+ const fallbackAvatar = `https://api.dicebear.com/7.x/shapes/svg?seed=${encodeURIComponent(token.mint || token.symbol || 'x')}`;+ avatar.src = token.image_uri || fallbackAvatar;+ avatar.onerror = () => { avatar.onerror = null; avatar.src = fallbackAvatar; };++ document.getElementById('vz-detail-name').textContent = token.name || 'Unknown';+ document.getElementById('vz-detail-symbol').textContent = token.symbol ? '$' + token.symbol : '';++ document.getElementById('vz-detail-mcap').textContent = formatMcap(token.usd_market_cap);+ document.getElementById('vz-detail-ath').textContent = formatMcap(token.ath_market_cap);+ document.getElementById('vz-detail-replies').textContent = token.reply_count != null ? Number(token.reply_count).toLocaleString() : '—';+ document.getElementById('vz-detail-age').textContent = formatAge(token.created_timestamp);++ const desc = (token.description || '').trim();+ const descEl = document.getElementById('vz-detail-description');+ descEl.textContent = desc.length > 800 ? desc.slice(0, 800) + '…' : desc;++ document.getElementById('vz-detail-mint').textContent = token.mint || '';+ document.getElementById('vz-detail-live').hidden = !token.is_currently_live;++ const linksEl = document.getElementById('vz-detail-links');+ linksEl.innerHTML = '';+ if (token.mint) {+ linksEl.appendChild(linkNode(`https://pump.fun/coin/${token.mint}`, 'Pump.fun ↗', true));+ linksEl.appendChild(linkNode(`https://solscan.io/token/${token.mint}`, 'Solscan ↗'));+ }+ if (token.twitter) linksEl.appendChild(linkNode(token.twitter, 'Twitter ↗'));+ if (token.telegram) linksEl.appendChild(linkNode(token.telegram, 'Telegram ↗'));+ if (token.website) linksEl.appendChild(linkNode(token.website, 'Website ↗'));++ detailEl.classList.add('is-open');+ detailEl.setAttribute('aria-hidden', 'false');+ }++ function linkNode(href, label, primary) {+ const a = document.createElement('a');+ a.href = href;+ a.target = '_blank';+ a.rel = 'noopener noreferrer';+ a.textContent = label;+ if (primary) a.className = 'primary';+ return a;+ }++ // ── formatters ───────────────────────────────────────────────+ function formatMcap(v) {+ const n = Number(v);+ if (!Number.isFinite(n) || n <= 0) return '—';+ if (n >= 1e9) return '$' + (n / 1e9).toFixed(2) + 'B';+ if (n >= 1e6) return '$' + (n / 1e6).toFixed(2) + 'M';+ if (n >= 1e3) return '$' + (n / 1e3).toFixed(1) + 'K';+ return '$' + n.toFixed(2);+ }+ function formatAge(ts) {+ const n = Number(ts);+ if (!Number.isFinite(n) || n <= 0) return '—';+ const ms = Date.now() - n;+ const days = ms / 86_400_000;+ if (days >= 30) return Math.floor(days / 30) + 'mo';+ if (days >= 1) return Math.floor(days) + 'd';+ const hours = ms / 3_600_000;+ if (hours >= 1) return Math.floor(hours) + 'h';+ return Math.max(1, Math.floor(ms / 60_000)) + 'm';+ }++ // ── legend ───────────────────────────────────────────────────+ function renderLegend(tokens) {+ legendList.innerHTML = '';+ tokens.slice(0, 20).forEach((token, i) => {+ const li = document.createElement('li');+ li.dataset.mint = token.mint || '';+ const rank = document.createElement('span');+ rank.className = 'rank';+ rank.textContent = '#' + (i + 1);+ const name = document.createElement('span');+ name.className = 'name';+ name.textContent = token.name || 'Unknown';+ const sym = document.createElement('span');+ sym.className = 'sym';+ sym.textContent = token.symbol ? '$' + token.symbol : '';+ li.appendChild(rank);+ li.appendChild(name);+ li.appendChild(sym);+ li.addEventListener('click', () => focusToken(token));+ legendList.appendChild(li);+ });+ legendEl.hidden = false;+ }+ function highlightLegend(mint) {+ legendList.querySelectorAll('li').forEach((li) => {+ li.classList.toggle('is-selected', !!mint && li.dataset.mint === mint);+ });+ }++ // Camera tween toward a clicked token so the user actually sees it.+ const tween = { active: false, from: new THREE.Vector3(), to: new THREE.Vector3(), target: new THREE.Vector3(), start: 0, duration: 700 };+ function focusToken(token) {+ selectToken(token);+ const entry = tokenMeshes.find((t) => t.data.mint === token.mint);+ if (!entry) return;+ const pos = entry.mesh.position.clone();+ const dir = pos.clone().normalize();+ const dest = pos.clone().add(dir.multiplyScalar(8));+ tween.from.copy(camera.position);+ tween.to.copy(dest);+ tween.target.copy(pos);+ tween.start = performance.now();+ tween.active = true;+ }+ function easeOutCubic(t) { return 1 - Math.pow(1 - t, 3); }++ // ── animation loop ───────────────────────────────────────────+ function animate() {+ requestAnimationFrame(animate);+ const time = performance.now();++ core.rotation.x += 0.003;+ core.rotation.y += 0.005;+ coreGlow.scale.setScalar(1 + Math.sin(time * 0.0015) * 0.04);++ if (tween.active) {+ const t = Math.min(1, (time - tween.start) / tween.duration);+ const e = easeOutCubic(t);+ camera.position.lerpVectors(tween.from, tween.to, e);+ controls.target.lerp(tween.target, e * 0.4);+ if (t >= 1) tween.active = false;+ }++ // Hover raycast+ raycaster.setFromCamera(pointer, camera);+ const hits = raycaster.intersectObjects(tokenMeshes.map((t) => t.mesh), false);+ if (hits.length) {+ const hit = hits[0].object;+ const entry = tokenMeshes.find((t) => t.mesh === hit);+ setHovered(entry || null);+ } else {+ setHovered(null);+ }++ // Subtle pulse on selected ring+ if (selected) {+ const s = 1 + Math.sin(time * 0.005) * 0.06;+ selected.ring.scale.setScalar(s);+ }++ controls.update();+ renderer.render(scene, camera);+ }++ // ── resize ───────────────────────────────────────────────────+ function resize() {+ const w = host.clientWidth || window.innerWidth;+ const h = host.clientHeight || window.innerHeight;+ renderer.setSize(w, h, false);+ camera.aspect = w / h;+ camera.updateProjectionMatrix();+ }+ window.addEventListener('resize', resize);+ resize();+ animate();++ // ── data loading ─────────────────────────────────────────────+ async function loadData() {+ statusEl.dataset.state = 'loading';+ statusText.textContent = 'Loading trending tokens…';+ refreshBtn.disabled = true;+ errorEl.hidden = true;+ try {+ const resp = await fetch(TRENDING_API, { headers: { accept: 'application/json' } });+ if (!resp.ok) throw new Error(`API returned ${resp.status}`);+ const data = await resp.json();+ if (!Array.isArray(data) || !data.length) throw new Error('No trending tokens returned');++ placeTokens(data);+ renderLegend(data);+ statusEl.dataset.state = 'ready';+ statusText.textContent = `${data.length} tokens · live from pump.fun`;+ refreshBtn.disabled = false;+ } catch (err) {+ console.error('[pump-visualizer] load failed', err);+ statusEl.dataset.state = 'error';+ statusText.textContent = 'Failed to load';+ refreshBtn.disabled = false;+ errorMessage.textContent = err.message || 'Unknown error';+ errorEl.hidden = false;+ }+ }++ refreshBtn.addEventListener('click', () => {+ clearSelection();+ loadData();+ });+ errorRetry.addEventListener('click', loadData);++ loadData();+ </script>++ <div id="footer-container"></div>+ <script src="/footer.js"></script></body></html>diff --git a/src/editor/embed-editor.js b/src/editor/embed-editor.jsindex 01416b3ab..891493374 100644--- a/src/editor/embed-editor.js+++ b/src/editor/embed-editor.js@@ -44,6 +44,7 @@ const STYLE = `inset: 0;display: grid;grid-template-columns: 1fr 360px;+ grid-template-rows: minmax(0, 1fr);background: #0b0d10;color: #f4f4f5;font: 14px/1.4 system-ui, -apple-system, sans-serif;@@ -142,6 +143,8 @@ const STYLE = `border-left: 1px solid #1f2937;display: flex;flex-direction: column;+ min-height: 0;+ overflow: hidden;}.panel-header {padding: 16px 20px;diff --git a/vercel.json b/vercel.jsonindex e4d697fe4..e54c26746 100644--- a/vercel.json+++ b/vercel.json@@ -176,6 +176,14 @@"src": "/pump-visualizer/?","dest": "/pump-visualizer.html"},+ {+ "src": "/pump-live/?",+ "dest": "/pump-live.html"+ },+ {+ "src": "/pump-dashboard/?",+ "dest": "/pump-dashboard.html"+ },{"src": "/avatar-artifact/?","dest": "/avatar-artifact.html"