Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Agent-detail: collectible hero layout + fullscreen 3D modal + share

nirholas08247cd28e0c
diff --git a/pages/agent-detail.html b/pages/agent-detail.html
index da8060c28..e9f955e14 100644
--- a/pages/agent-detail.html
+++ b/pages/agent-detail.html
@@ -191,7 +191,30 @@
</div>
<section class="ad-hero">
- <img class="ad-hero-avatar" id="ad-avatar" alt="" />
+ <div class="ad-hero-glow" id="ad-hero-glow" aria-hidden="true"></div>
+ <button class="ad-hero-share-float" id="ad-hero-share-float" aria-label="Share this agent" title="Share">
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>
+ </button>
+ <div class="ad-hero-avatar-wrap" id="ad-avatar-wrap" role="button" aria-label="View full 3D model" tabindex="0">
+ <model-viewer
+ id="ad-avatar-3d"
+ class="ad-hero-avatar"
+ auto-rotate
+ camera-controls
+ disable-zoom
+ disable-pan
+ interaction-prompt="none"
+ loading="eager"
+ reveal="auto"
+ shadow-intensity="0"
+ exposure="1.1"
+ alt="Agent 3D avatar"
+ ></model-viewer>
+ <img class="ad-hero-avatar" id="ad-avatar" alt="" style="display:none" />
+ <div class="ad-hero-avatar-overlay" aria-hidden="true">
+ <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>
+ </div>
+ </div>
<div class="ad-hero-body">
<div class="ad-hero-title">
<h1 id="ad-name"></h1>
@@ -562,6 +585,8 @@
</div>
</section>
+ <details class="ad-embed-disclosure">
+ <summary>Developers →</summary>
<section class="ad-card ad-embed-card" id="ad-embed-card" hidden>
<div class="ad-card-head">
<span class="ad-bullet ad-bullet-muted"></span>
@@ -598,6 +623,7 @@
<pre class="ad-embed-code" id="ad-embed-link"></pre>
</div>
</section>
+ </details>
<section class="ad-card ad-versions-card" id="ad-versions-card" hidden>
<div class="ad-card-head">
@@ -708,6 +734,21 @@
</div>
</div>
+ <!-- Fullscreen 3D viewer modal -->
+ <div class="ad-3d-modal hidden" id="ad-3d-modal" role="dialog" aria-modal="true" aria-label="Full-screen 3D viewer">
+ <div class="ad-3d-modal-inner">
+ <button class="ad-3d-modal-close" id="ad-3d-modal-close" aria-label="Close">✕</button>
+ <model-viewer
+ id="ad-avatar-modal-3d"
+ auto-rotate
+ camera-controls
+ shadow-intensity="0"
+ exposure="1.1"
+ alt="Agent 3D avatar — fullscreen"
+ ></model-viewer>
+ </div>
+ </div>
+
<script type="module" src="/src/agent-detail.js"></script>
<script src="/brand.js" defer></script>
<div id="footer-container"></div>
diff --git a/src/agent-detail.css b/src/agent-detail.css
index b59f1ff9c..b12066bab 100644
--- a/src/agent-detail.css
+++ b/src/agent-detail.css
@@ -134,6 +134,14 @@ a {
display: flex;
gap: 8px;
}
+.ad-hero-actions {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+ justify-content: center;
+ margin-top: 12px;
+}
+
.ad-btn {
background: var(--ad-bg-2);
color: var(--ad-text);
@@ -175,34 +183,85 @@ a {
.ad-hero {
display: flex;
- gap: 18px;
- padding: 8px 24px 24px;
- align-items: flex-start;
+ flex-direction: column;
+ align-items: center;
+ gap: 0;
+ padding: 0 24px 24px;
+ position: relative;
}
+
+/* Radial glow banner behind avatar */
+.ad-hero-glow {
+ position: absolute;
+ top: 0; left: 0; right: 0;
+ height: 320px;
+ pointer-events: none;
+ z-index: 0;
+}
+
+/* Avatar container — centered, 280px tall */
+.ad-hero-avatar-wrap {
+ position: relative;
+ width: 240px;
+ height: 280px;
+ z-index: 1;
+ cursor: pointer;
+ margin-top: 16px;
+}
+.ad-hero-avatar-wrap:hover .ad-hero-avatar-overlay { opacity: 1; }
+
+.ad-hero-avatar-overlay {
+ position: absolute;
+ inset: 0;
+ border-radius: 18px;
+ background: rgba(0,0,0,.25);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ opacity: 0;
+ transition: opacity .18s;
+ z-index: 2;
+}
+.ad-hero-avatar-overlay svg { color: #fff; }
+
.ad-hero-avatar {
- width: 84px;
- height: 84px;
- border-radius: 14px;
+ width: 240px;
+ height: 280px;
+ border-radius: 18px;
object-fit: cover;
background: var(--ad-bg-2);
border: 1px solid var(--ad-line);
- flex-shrink: 0;
+ display: block;
+}
+
+model-viewer.ad-hero-avatar {
+ width: 240px;
+ height: 280px;
+ border-radius: 18px;
+ --poster-color: transparent;
+ background: transparent;
+ border: 1px solid var(--ad-line);
}
+
.ad-hero-body {
- flex: 1;
- min-width: 0;
+ width: 100%;
+ max-width: 560px;
+ text-align: center;
+ z-index: 1;
+ margin-top: 16px;
}
.ad-hero-title {
display: flex;
align-items: center;
- gap: 12px;
+ justify-content: center;
+ gap: 10px;
flex-wrap: wrap;
}
.ad-hero-title h1 {
margin: 0;
font-size: 28px;
- font-weight: 600;
- letter-spacing: -0.01em;
+ font-weight: 700;
+ letter-spacing: -0.02em;
}
.ad-status {
display: inline-flex;
@@ -230,9 +289,100 @@ a {
.ad-status.ad-status-inactive::before {
background: var(--ad-dim);
}
+/* Pulsing on-chain badge */
+.ad-onchain-live {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: .06em;
+ text-transform: uppercase;
+ color: #10b981;
+ background: rgba(16,185,129,.1);
+ border: 1px solid rgba(16,185,129,.3);
+ border-radius: 999px;
+ padding: 3px 10px;
+ margin-top: 8px;
+}
+.ad-onchain-live::before {
+ content: '';
+ width: 7px; height: 7px;
+ border-radius: 50%;
+ background: #10b981;
+ animation: ad-dot-pulse 2s ease-in-out infinite;
+}
+@keyframes ad-dot-pulse {
+ 0%,100% { opacity: 1; transform: scale(1); }
+ 50% { opacity: .4; transform: scale(.65); }
+}
+
+/* Share float button in hero */
+.ad-hero-share-float {
+ position: absolute;
+ top: 20px; right: 0;
+ z-index: 2;
+ width: 36px; height: 36px;
+ border-radius: 50%;
+ background: rgba(255,255,255,.06);
+ border: 1px solid rgba(255,255,255,.1);
+ display: flex; align-items: center; justify-content: center;
+ cursor: pointer;
+ color: var(--ad-muted);
+ transition: background .15s, color .15s;
+}
+.ad-hero-share-float:hover {
+ background: rgba(255,255,255,.12);
+ color: var(--ad-text);
+}
+
+/* Fullscreen 3D viewer modal */
+.ad-3d-modal {
+ position: fixed; inset: 0; z-index: 10000;
+ background: rgba(0,0,0,.92);
+ display: flex; align-items: center; justify-content: center;
+}
+.ad-3d-modal.hidden { display: none; }
+.ad-3d-modal-inner {
+ position: relative;
+ width: min(680px, 96vw);
+ height: min(680px, 80vh);
+}
+.ad-3d-modal-close {
+ position: absolute;
+ top: -40px; right: 0;
+ background: none; border: none;
+ color: rgba(255,255,255,.6); font-size: 22px; cursor: pointer;
+ line-height: 1;
+}
+.ad-3d-modal-close:hover { color: #fff; }
+.ad-3d-modal model-viewer {
+ width: 100%; height: 100%;
+ border-radius: 20px;
+ --poster-color: transparent;
+ background: var(--ad-bg-2);
+}
+
+/* Embed disclosure */
+.ad-embed-disclosure summary {
+ cursor: pointer;
+ list-style: none;
+ display: flex; align-items: center; gap: 6px;
+ font-size: 13px; color: var(--ad-muted);
+ padding: 10px 20px;
+ user-select: none;
+}
+.ad-embed-disclosure summary::-webkit-details-marker { display: none; }
+.ad-embed-disclosure summary::before {
+ content: '›'; font-size: 16px; transition: transform .2s;
+}
+.ad-embed-disclosure[open] summary::before { transform: rotate(90deg); }
+.ad-embed-disclosure summary:hover { color: var(--ad-text); }
+
.ad-hero-meta {
display: flex;
align-items: center;
+ justify-content: center;
gap: 8px;
color: var(--ad-muted);
font-size: 13px;
@@ -248,22 +398,28 @@ a {
color: var(--ad-muted);
font-size: 14px;
line-height: 1.55;
- margin: 12px 0 10px;
+ margin: 10px auto 10px;
white-space: pre-wrap;
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ max-width: 440px;
}
.ad-hero-trust {
display: flex;
gap: 8px;
flex-wrap: wrap;
+ justify-content: center;
}
.ad-card {
background: var(--ad-card);
border: 1px solid var(--ad-line);
- border-radius: var(--radius-card);
+ border-radius: 16px;
padding: 18px 20px;
margin: 12px 24px;
- box-shadow: var(--shadow-1);
+ box-shadow: var(--shadow-2);
}
.ad-card-head {
display: flex;
diff --git a/src/agent-detail.js b/src/agent-detail.js
index 64bca5bb3..c6d98d926 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -382,11 +382,13 @@ function render(agent) {
const $ = (id) => document.getElementById(id);
- $('ad-avatar').src = agent.avatar || avatarDataUri(agent.name);
- $('ad-avatar').alt = agent.name;
- $('ad-avatar').onerror = () => {
- $('ad-avatar').src = avatarDataUri(agent.name);
- };
+ // Flat image fallback (hidden when model-viewer works)
+ const avatarImg = $('ad-avatar');
+ if (avatarImg) {
+ avatarImg.src = agent.avatar || avatarDataUri(agent.name);
+ avatarImg.alt = agent.name;
+ avatarImg.onerror = () => { avatarImg.src = avatarDataUri(agent.name); };
+ }
$('ad-name').textContent = agent.name;
// Let visitors save this agent's avatar as their own fork (its wallet is
@@ -425,17 +427,63 @@ function render(agent) {
// enrichment later refreshes this with the canonical GLB if it differs.
renderAgentEmbed({ ...agent, avatar_glb_url: agent.avatar_glb_url || agentAvatarGlb(agent) });
+ // ── Hero 3D avatar ────────────────────────────────────────────────────
+ const glbUrl = agentAvatarGlb(agent);
+ const mv3d = document.getElementById('ad-avatar-3d');
+ if (mv3d) {
+ mv3d.setAttribute('src', glbUrl);
+ mv3d.addEventListener('error', () => {
+ // GLB failed — show the flat image fallback
+ mv3d.style.display = 'none';
+ const img = document.getElementById('ad-avatar');
+ if (img) img.style.display = '';
+ }, { once: true });
+ }
+ // Radial glow behind avatar derived from agent name color
+ const glowEl = document.getElementById('ad-hero-glow');
+ if (glowEl) {
+ const [c1] = GRADIENTS[(agent.name?.charCodeAt(0) || 0) % GRADIENTS.length];
+ glowEl.style.background = `radial-gradient(ellipse 60% 55% at 50% 40%, ${c1}22 0%, transparent 70%)`;
+ }
+ // Fullscreen modal
+ const mvModal = document.getElementById('ad-avatar-modal-3d');
+ if (mvModal) mvModal.setAttribute('src', glbUrl);
+ const modal = document.getElementById('ad-3d-modal');
+ const avatarWrap = document.getElementById('ad-avatar-wrap');
+ if (modal && avatarWrap && !avatarWrap._modalWired) {
+ avatarWrap._modalWired = true;
+ avatarWrap.addEventListener('click', () => modal.classList.remove('hidden'));
+ avatarWrap.addEventListener('keydown', (e) => {
+ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); modal.classList.remove('hidden'); }
+ });
+ document.getElementById('ad-3d-modal-close')?.addEventListener('click', () =>
+ modal.classList.add('hidden'),
+ );
+ modal.addEventListener('click', (e) => {
+ if (e.target === modal) modal.classList.add('hidden');
+ });
+ }
+
const status = $('ad-status');
status.textContent = agent.active ? 'Active' : 'Inactive';
status.classList.toggle('ad-status-inactive', !agent.active);
- // On-chain badge sits beside the live/inactive status. Re-rendered safely if
- // render() runs twice (e.g. avatar refresh) — drop any prior badge first.
+ // On-chain badge sits directly below the name as a pulsing pill.
+ // Re-rendered safely if render() runs twice — drop any prior badge first.
document.getElementById('ad-onchain-badge')?.remove();
const onchainBadge = onchainBadgeEl(agent.rawMetadata || agent, { size: 'md' });
if (onchainBadge) {
onchainBadge.id = 'ad-onchain-badge';
- status.insertAdjacentElement('afterend', onchainBadge);
+ if (agent.onchain || agent.txHash || agent.contractAddress) {
+ onchainBadge.classList.add('ad-onchain-live');
+ }
+ // Insert right after the title row for prominence
+ const titleRow = document.querySelector('.ad-hero-title');
+ if (titleRow) {
+ titleRow.insertAdjacentElement('afterend', onchainBadge);
+ } else {
+ status.insertAdjacentElement('afterend', onchainBadge);
+ }
}
// Validation attestation badge — only for EVM ERC-8004 agents, read
@@ -1450,27 +1498,30 @@ function makeSnsResolver(inputEl, statusEl) {
}
function wireShareButton(agent) {
+ const origin = location.origin;
+ const shareUrl = `${origin}/agent/${agent.id}`;
+ const remixUrl = `${origin}/create`;
+ const shareData = {
+ kind: 'agent',
+ id: agent.id,
+ title: agent.name || 'Agent',
+ description: agent.description || '',
+ shareUrl,
+ remixUrl,
+ };
+
+ // Hero float button (above the fold)
+ const floatBtn = document.getElementById('ad-hero-share-float');
+ if (floatBtn && !floatBtn._wired) {
+ floatBtn._wired = true;
+ floatBtn.addEventListener('click', () => showSharePanel(shareData, floatBtn));
+ }
+
const btn = document.getElementById('ad-share-btn');
if (!btn) return;
- const origin = location.origin;
- const shareUrl = `${origin}/agents/${agent.id}`;
- const remixUrl = `${origin}/create`;
-
btn.style.display = '';
- btn.addEventListener('click', () => {
- showSharePanel(
- {
- kind: 'agent',
- id: agent.id,
- title: agent.name || 'Agent',
- description: agent.description || '',
- shareUrl,
- remixUrl,
- },
- btn,
- );
- });
+ btn.addEventListener('click', () => showSharePanel(shareData, btn));
}
// ── Owner action bar (hero) + inline deploy slot (BLOCKCHAIN DETAILS) ────────