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(duels): keep names and results readable on narrow screens and say plainly when the network is down

nirholas6388266b6b47
diff --git a/src/duel.js b/src/duel.js
index 9462308ca..522f97bb3 100644
--- a/src/duel.js
+++ b/src/duel.js
@@ -53,7 +53,7 @@ async function load({ quiet = false } = {}) {
contentEl.innerHTML = `
<div class="sy-state" role="alert">
<h2>This duel did not load</h2>
- <p>${esc(err.message || 'Check your connection.')} If you already made a call it is safe: calls are stored with the duel and settle on schedule.</p>
+ <p>${esc(err instanceof TypeError ? 'Could not reach three.ws. Check your connection.' : err.message)} If you already made a call it is safe: calls are stored with the duel and settle on schedule.</p>
<button type="button" class="sy-btn primary" id="dxRetry">Try again</button>
</div>`;
document.getElementById('dxRetry').addEventListener('click', () => load());
@@ -298,7 +298,7 @@ function resultPanel() {
else if (c) mine = '<p style="margin-top:10px">Your call is settling.</p>';
const body = d.phase === 'void'
? `<h2>Void</h2><p>${esc(VOID_TEXT[d.void_reason] || 'Every call was refunded.')}</p>`
- : `<h2><span style="color:var(--dx-${d.winner})">${esc(name(d.winner))}</span> won</h2><p>${esc(name(d.winner))} booked more realized profit in the window. Final numbers are on each trader card, measured ${esc(fmtUtc(d.resolved_at || d.resolves_at))}.</p>`;
+ : `<h2><span style="color:var(--dx-${d.winner})">${esc(name(d.winner))}</span> won</h2><p>${esc(name(d.winner))} finished ahead on realized P&L in the window. Final numbers are on each trader card, measured ${esc(fmtUtc(d.resolved_at || d.resolves_at))}.</p>`;
return `
<section class="sy-panel dx-result" aria-live="polite">
${body}
@@ -346,6 +346,7 @@ function wireCall() {
for (const r of form.querySelectorAll('input[name="side"]')) {
r.addEventListener('change', () => {
side = r.value;
+ document.getElementById('dxErr').hidden = true;
payoffText();
});
}
diff --git a/src/duels.css b/src/duels.css
index 1428e5034..6e04f8806 100644
--- a/src/duels.css
+++ b/src/duels.css
@@ -31,7 +31,7 @@
}
/* ── board ───────────────────────────────────────────────── */
-.dx-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
+.dx-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.dx-card {
display: flex; flex-direction: column; gap: 14px; height: 100%;
background: var(--sy-panel); border: 1px solid var(--sy-line); border-radius: var(--sy-radius);
@@ -46,8 +46,8 @@
.dx-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.dx-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dx-side.b { flex-direction: row-reverse; text-align: right; }
-.dx-side b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.dx-side small { display: block; font-size: 12px; color: var(--sy-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+.dx-side b { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; font-size: 15px; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; }
+.dx-side small { display: block; font-size: 12px; color: var(--sy-faint); margin-top: 2px; line-height: 1.35; }
.dx-side > div { min-width: 0; }
.dx-side.win b::after { content: ' ✓'; color: var(--sy-green); }
.dx-vs-mark { font-size: 12px; font-weight: 900; letter-spacing: .1em; color: var(--sy-faint); text-transform: uppercase; }
@@ -88,11 +88,13 @@
.dx-lb a { text-decoration: none; }
.dx-lb a:hover b { color: var(--sy-accent-2); }
.dx-lb .net { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
-.dx-calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
+.dx-calls { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
+.dx-calls li { min-width: 0; }
.dx-calls a { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-decoration: none; padding: 10px 12px; border-radius: 11px; background: var(--sy-panel-2); border: 1px solid var(--sy-line); font-size: 13.5px; transition: border-color var(--sy-fast); }
.dx-calls a:hover { border-color: var(--sy-accent); }
.dx-calls a:focus-visible { outline: 2px solid var(--sy-accent-2); outline-offset: 2px; }
-.dx-calls span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.dx-calls a > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.dx-calls a > :last-child { flex: none; white-space: nowrap; }
.dx-two { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .dx-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
@@ -133,7 +135,7 @@
.dx-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dx-pick:has(input:checked) { border-color: var(--dx-side); background: color-mix(in srgb, var(--dx-side) 12%, var(--sy-panel-2)); }
.dx-pick:has(input:focus-visible) { outline: 2px solid var(--sy-accent-2); outline-offset: 2px; }
-.dx-pick b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
+.dx-pick b { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 14px; line-height: 1.25; }
.dx-stake { display: grid; gap: 10px; margin-top: 16px; }
.dx-stake-row { display: flex; align-items: center; gap: 12px; }
.dx-stake-row input[type='range'] { flex: 1; accent-color: var(--sy-accent); min-width: 0; height: 28px; }
@@ -152,6 +154,9 @@
@media (max-width: 520px) {
.dx-pickers { grid-template-columns: minmax(0, 1fr); }
+ .dx-vs { grid-template-columns: minmax(0, 1fr); gap: 6px; }
+ .dx-side.b { flex-direction: row; text-align: left; }
+ .dx-vs-mark { padding-left: 50px; }
.dx-lb li { grid-template-columns: 28px 26px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; }
}
diff --git a/src/duels.js b/src/duels.js
index fb15ca927..fb84c06b1 100644
--- a/src/duels.js
+++ b/src/duels.js
@@ -86,7 +86,7 @@ async function loadBoard() {
listEl.innerHTML = `
<div class="sy-state" role="alert">
<h2>Duels did not load</h2>
- <p>${esc(err.message || 'Check your connection.')} Calls you already made are safe: they are stored with the duel and settle on schedule.</p>
+ <p>${esc(err instanceof TypeError ? 'Could not reach three.ws. Check your connection.' : err.message)} Calls you already made are safe: they are stored with the duel and settle on schedule.</p>
<button type="button" class="sy-btn primary" id="dxRetry">Try again</button>
</div>`;
document.getElementById('dxRetry').addEventListener('click', loadBoard);
@@ -220,7 +220,7 @@ function renderMe() {
<div class="sy-panel" style="display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;margin-bottom:22px">
<div style="min-width:0;max-width:62ch">
<b style="font-size:16px">Sign in to make calls</b>
- <p class="sy-muted" style="margin:4px 0 0;line-height:1.5">You get ${esc(pts(me.rules.daily_allowance))} free every day. Correct calls earn points, XP and badges. ${esc(FREE_LINE)}</p>
+ <p class="sy-muted" style="margin:4px 0 0;line-height:1.5">You get ${esc(pts(me.rules.daily_allowance))} free every day. Correct calls earn points, XP and badges.</p>
</div>
<div class="sy-actions"><a class="sy-btn primary" href="/login?next=${next}">Sign in</a><a class="sy-btn" href="/register?next=${next}">Create an account</a></div>
</div>`;
@@ -302,7 +302,7 @@ async function loadLeaderboard() {
: '<div class="sy-chart-empty">No duel has settled this season yet. The first correct call takes the top spot.</div>'}`;
hydrateAvatars(lbEl);
} catch (err) {
- lbEl.innerHTML = `<h2 class="sy-h2">Season predictors</h2><div class="sy-err" role="alert">${esc(err.message)} <button type="button" class="sy-btn sm" id="dxLbRetry">Retry</button></div>`;
+ lbEl.innerHTML = `<h2 class="sy-h2">Season predictors</h2><div class="sy-err" role="alert">${esc(err instanceof TypeError ? 'Could not reach three.ws.' : err.message)} <button type="button" class="sy-btn sm" id="dxLbRetry">Retry</button></div>`;
document.getElementById('dxLbRetry').addEventListener('click', loadLeaderboard);
}
}