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.

fix(creations): stop gallery previews from stealing scroll, and show the leaderboards loading

nirholas4579e965a47d
diff --git a/src/creations.css b/src/creations.css
index 29e60a422..5757ee060 100644
--- a/src/creations.css
+++ b/src/creations.css
@@ -49,6 +49,7 @@ a.cr-lb-row:focus-visible { outline: 2px solid var(--accent, #fff); outline-offs
.cr-lb-title { display: block; font-size: var(--text-sm, .82rem); font-weight: 600; color: var(--ink-bright, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-lb-meta { display: block; font-size: var(--text-2xs, .68rem); color: var(--ink-faint, #666); }
.cr-lb-stat { flex: 0 0 auto; font-family: var(--font-mono, monospace); font-size: var(--text-xs, .74rem); font-weight: 700; color: var(--ink, #ccc); white-space: nowrap; }
+.cr-lb-skeleton { height: 46px; margin: 2px 0; border-radius: var(--radius-md, 10px); background: linear-gradient(90deg, var(--surface-1, rgba(255,255,255,.03)) 25%, var(--surface-2, rgba(255,255,255,.06)) 37%, var(--surface-1, rgba(255,255,255,.03)) 63%); background-size: 400% 100%; animation: cr-shimmer 1.4s ease infinite; }
.cr-lb-empty { padding: var(--space-md, 16px) 6px; font-size: var(--text-sm, .82rem); color: var(--ink-faint, #666); }
.cr-lb-empty a { color: var(--ink-bright, #fff); }
@@ -56,7 +57,7 @@ a.cr-lb-row:focus-visible { outline: 2px solid var(--accent, #fff); outline-offs
.cr-controls { margin-bottom: var(--space-lg, 24px); display: flex; flex-direction: column; gap: 10px; }
.cr-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cr-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: var(--surface-1, rgba(255,255,255,.03)); border: 1px solid var(--stroke, rgba(255,255,255,.1)); border-radius: var(--radius-pill, 999px); padding: 9px 16px; color: var(--ink-faint, #777); transition: border-color .14s ease; }
-.cr-search:focus-within { border-color: var(--stroke-strong, rgba(255,255,255,.24)); color: var(--ink, #ccc); }
+.cr-search:focus-within { border-color: var(--stroke-strong, rgba(255,255,255,.24)); color: var(--ink, #ccc); outline: 2px solid var(--accent, #fff); outline-offset: 2px; }
.cr-search input { flex: 1; border: none; background: transparent; outline: none; font: inherit; font-size: var(--text-sm, .85rem); color: var(--ink-bright, #fff); min-width: 0; }
.cr-search input::placeholder { color: var(--ink-faint, #666); }
.cr-select { flex: 0 0 auto; font: inherit; font-size: var(--text-sm, .82rem); color: var(--ink, #e8e8e8); background: var(--surface-1, rgba(255,255,255,.03)); border: 1px solid var(--stroke, rgba(255,255,255,.1)); border-radius: var(--radius-pill, 999px); padding: 9px 14px; cursor: pointer; }
diff --git a/src/creations.js b/src/creations.js
index 3717775e5..6906548a6 100644
--- a/src/creations.js
+++ b/src/creations.js
@@ -68,6 +68,14 @@ function truncate(s, n) {
// ── card rendering ───────────────────────────────────────────────────────────
+// A gallery thumbnail is deliberately control-free. model-viewer reads
+// `camera-controls` as a boolean attribute, so the old `camera-controls="false"`
+// switched controls ON: every card drag-orbited (and stayed wherever it was
+// flung), and on touch the mesh swallowed the vertical drag that scrolls the
+// grid, so the feed could not be scrolled past the first row. Dropping the
+// attribute leaves auto-rotate, which needs no controls, and lets a drag over a
+// leaderboard row reach the link that wraps it. The `disable-*` attributes went
+// with it; they only ever qualified camera-controls.
function thumbHTML(glbUrl, alt, posterUrl) {
if (!glbUrl) return `<div class="cr-card-noglb" aria-hidden="true">3D</div>`;
// The feed ships a rendered still alongside every GLB, so paint that first
@@ -79,11 +87,7 @@ function thumbHTML(glbUrl, alt, posterUrl) {
class="cr-card-mv"
reveal="auto"
loading="lazy"
- disable-zoom
- disable-pan
- disable-tap
interaction-prompt="none"
- camera-controls="false"
auto-rotate
rotation-per-second="16deg"
environment-image="neutral"
@@ -207,6 +211,9 @@ async function loadFeed({ reset = false } = {}) {
if (reset && host) {
host.setAttribute('aria-busy', 'true');
host.innerHTML = skeleton();
+ // The old tally belongs to the slice being replaced; leaving it up next
+ // to a grid of skeletons reads as a count of the skeletons.
+ updateCount();
// The open lineage belongs to a card that this reload may drop.
$('cr-lineage-panel')?.classList.add('is-hidden');
}
@@ -515,9 +522,20 @@ function creatorRowHTML(row, i) {
`;
}
+function lbSkeleton(rows) {
+ return Array.from({ length: rows })
+ .map(() => `<li class="cr-lb-skeleton" aria-hidden="true"></li>`)
+ .join('');
+}
+
async function loadLeaderboards() {
const trendingHost = $('cr-trending-list');
const creatorsHost = $('cr-creators-list');
+ // Both columns start as empty <ol aria-busy>, which paints a 54px void for
+ // the length of the fetch. Fill them with the same skeleton language the
+ // feed uses so the page reads as loading rather than as already empty.
+ if (trendingHost) trendingHost.innerHTML = lbSkeleton(4);
+ if (creatorsHost) creatorsHost.innerHTML = lbSkeleton(4);
try {
const res = await fetch('/api/creations-leaderboard?limit=6', { headers: { accept: 'application/json' } });
const data = await res.json().catch(() => ({}));