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.

style: format bounty likes/judge files and finish /go judge-results UI

nirholas47c7e211b24e
diff --git a/api/_lib/bounty-judge.js b/api/_lib/bounty-judge.js
index 111cb68da..522b3db46 100644
--- a/api/_lib/bounty-judge.js
+++ b/api/_lib/bounty-judge.js
@@ -29,10 +29,8 @@ export function buildJudgePrompt(bounty, subs) {
? `[${s.media_type || 'link'} attached: ${String(s.media_url).slice(0, 300)}]`
: '[no media attached]';
const text =
- (s.content || '')
- .replace(/\s+/g, ' ')
- .trim()
- .slice(0, CONTENT_CAP) || '(no description)';
+ (s.content || '').replace(/\s+/g, ' ').trim().slice(0, CONTENT_CAP) ||
+ '(no description)';
return [
`Submission ${i + 1}`,
`id: ${s.id}`,
@@ -66,7 +64,10 @@ export function extractJson(text) {
if (!text) return null;
let t = String(text).trim();
// Strip a leading/trailing markdown code fence if present.
- t = t.replace(/^```(?:json)?\s*/i, '').replace(/\s*```$/i, '').trim();
+ t = t
+ .replace(/^```(?:json)?\s*/i, '')
+ .replace(/\s*```$/i, '')
+ .trim();
try {
return JSON.parse(t);
} catch {
@@ -112,7 +113,8 @@ export function normalizeJudgement(rawText, validIds) {
let recommendedId = typeof parsed.recommended_id === 'string' ? parsed.recommended_id : '';
if (!valid.has(recommendedId)) recommendedId = rankings[0].submission_id;
- const summary = typeof parsed.summary === 'string' ? parsed.summary.trim().slice(0, SUMMARY_CAP) : '';
+ const summary =
+ typeof parsed.summary === 'string' ? parsed.summary.trim().slice(0, SUMMARY_CAP) : '';
return { summary, recommended_id: recommendedId, rankings };
}
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index fd63305d8..7b8f27660 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -60,8 +60,7 @@ function getLimiter(name, opts) {
const key = `${name}:${opts.limit}:${opts.window}`;
if (limiters.has(key)) return limiters.get(key);
if (!redis) {
- const lim =
- opts.critical && IS_PRODUCTION ? failClosedLimiter(opts) : memoryLimiter(opts);
+ const lim = opts.critical && IS_PRODUCTION ? failClosedLimiter(opts) : memoryLimiter(opts);
limiters.set(key, lim);
return lim;
}
@@ -176,21 +175,28 @@ export const limits = {
// Paid MCP tools — each call runs real compute (glTF validation / inspection
// / optimization on a fetched model). Marked critical so they fail closed in
// prod without Redis rather than allowing unbounded paid work per instance.
- mcpValidate: (key) => getLimiter('mcp:validate', { limit: 10, window: '1 m', critical: true }).limit(key),
- mcpInspect: (key) => getLimiter('mcp:inspect', { limit: 30, window: '1 m', critical: true }).limit(key),
- mcpOptimize: (key) => getLimiter('mcp:optimize', { limit: 10, window: '1 m', critical: true }).limit(key),
+ mcpValidate: (key) =>
+ getLimiter('mcp:validate', { limit: 10, window: '1 m', critical: true }).limit(key),
+ mcpInspect: (key) =>
+ getLimiter('mcp:inspect', { limit: 30, window: '1 m', critical: true }).limit(key),
+ mcpOptimize: (key) =>
+ getLimiter('mcp:optimize', { limit: 10, window: '1 m', critical: true }).limit(key),
// 3D Studio MCP. Generation submits a real GPU job on Replicate (text→image
// and/or image→3D reconstruction) that costs real money, so it gets a hard
// hourly ceiling per principal. Status polling is cheap and frequent.
- mcp3dGenerate: (key) => getLimiter('mcp3d:generate', { limit: 12, window: '1 h', critical: true }).limit(key),
+ mcp3dGenerate: (key) =>
+ getLimiter('mcp3d:generate', { limit: 12, window: '1 h', critical: true }).limit(key),
mcp3dStatus: (key) => getLimiter('mcp3d:status', { limit: 240, window: '1 m' }).limit(key),
// x402 Bazaar MCP. Discovery calls fan out to external facilitators, so cap
// per principal to keep that egress bounded without throttling normal use.
- mcpBazaar: (key) => getLimiter('mcp:bazaar', { limit: 60, window: '1 m', critical: true }).limit(key),
+ mcpBazaar: (key) =>
+ getLimiter('mcp:bazaar', { limit: 60, window: '1 m', critical: true }).limit(key),
// threews-agent MCP. Read/discovery calls are cheap; pay_and_call moves real
// money, so it gets a much tighter ceiling on top of the per-spend caps.
- mcpAgent: (key) => getLimiter('mcp:agent', { limit: 60, window: '1 m', critical: true }).limit(key),
- mcpAgentPay: (key) => getLimiter('mcp:agent:pay', { limit: 20, window: '1 m', critical: true }).limit(key),
+ mcpAgent: (key) =>
+ getLimiter('mcp:agent', { limit: 60, window: '1 m', critical: true }).limit(key),
+ mcpAgentPay: (key) =>
+ getLimiter('mcp:agent:pay', { limit: 20, window: '1 m', critical: true }).limit(key),
oauthToken: (clientId) =>
getLimiter('oauth:token', { limit: 120, window: '1 m' }).limit(clientId),
upload: (userId) => getLimiter('upload', { limit: 60, window: '1 h' }).limit(userId),
@@ -218,7 +224,9 @@ export const limits = {
// balance as the global ceiling.
x402PayIp: (ip) => getLimiter('x402:pay:ip', { limit: 6, window: '1 m' }).limit(ip),
x402PayGlobal: () =>
- getLimiter('x402:pay:global', { limit: 600, window: '1 h', critical: true }).limit('global'),
+ getLimiter('x402:pay:global', { limit: 600, window: '1 h', critical: true }).limit(
+ 'global',
+ ),
checkName: (ip) => getLimiter('check-name:ip', { limit: 60, window: '1 m' }).limit(ip),
ensResolve: (ip) => getLimiter('ens:resolve:ip', { limit: 60, window: '1 m' }).limit(ip),
snsResolve: (ip) => getLimiter('sns:resolve:ip', { limit: 60, window: '1 m' }).limit(ip),
@@ -252,11 +260,13 @@ export const limits = {
// to one Granite Guardian classifier pass per risk against the server watsonx
// key, so cap the per-IP burst and keep a global hourly ceiling as a cost cap.
guardianIp: (ip) => getLimiter('guardian:ip', { limit: 30, window: '1 m' }).limit(ip),
- guardianGlobal: () => getLimiter('guardian:global', { limit: 1200, window: '1 h' }).limit('global'),
+ guardianGlobal: () =>
+ getLimiter('guardian:global', { limit: 1200, window: '1 h' }).limit('global'),
// Granite identity-integrity check (api/agents/identity-check). Each call does
// one Granite embedding + a fan-out of Guardian passes against the server key,
// so keep the per-IP burst tight and add a global hourly ceiling as a cost cap.
- identityCheckIp: (ip) => getLimiter('identity-check:ip', { limit: 20, window: '1 m' }).limit(ip),
+ identityCheckIp: (ip) =>
+ getLimiter('identity-check:ip', { limit: 20, window: '1 m' }).limit(ip),
identityCheckGlobal: () =>
getLimiter('identity-check:global', { limit: 600, window: '1 h' }).limit('global'),
// Skills marketplace browse — isolated bucket so traffic on other public endpoints
@@ -285,7 +295,8 @@ export const limits = {
}).limit(agentId),
// Autonomous agent skill purchases: 10 per hour per buyer agent to prevent runaway spending.
// Critical (moves real money) — fail closed in prod without Redis.
- agentBuy: (agentId) => getLimiter('agent:buy', { limit: 10, window: '1 h', critical: true }).limit(agentId),
+ agentBuy: (agentId) =>
+ getLimiter('agent:buy', { limit: 10, window: '1 h', critical: true }).limit(agentId),
// Gas-spending endpoints: 10 redeems per 5 minutes per IP
strict: (key) =>
getLimiter('permissions:redeem:strict', { limit: 10, window: '5 m' }).limit(key),
@@ -313,7 +324,8 @@ export const limits = {
newsletterIp: (ip) => getLimiter('newsletter:ip', { limit: 5, window: '1 h' }).limit(ip),
// Voice cloning: expensive ElevenLabs API call — 3 per user per day.
// Critical (real per-call cost) — fail closed in prod without Redis.
- voiceClone: (userId) => getLimiter('voice:clone', { limit: 3, window: '1 d', critical: true }).limit(userId),
+ voiceClone: (userId) =>
+ getLimiter('voice:clone', { limit: 3, window: '1 d', critical: true }).limit(userId),
// Persona extraction: Claude API call — 5 per user per day.
personaExtract: (userId) =>
getLimiter('persona:extract', { limit: 5, window: '1 d' }).limit(userId),
diff --git a/api/bounties.js b/api/bounties.js
index 339e1a66e..1cbbbec90 100644
--- a/api/bounties.js
+++ b/api/bounties.js
@@ -106,15 +106,26 @@ export default wrap(async (req, res) => {
if (req.method === 'POST') {
let user;
- try { user = await getSessionUser(req); } catch {
+ try {
+ user = await getSessionUser(req);
+ } catch {
return error(res, 401, 'unauthorized', 'sign in to post a bounty');
}
const body = await readJson(req);
- const { title, description, reward_sol, reward_tokens, coin_symbol, coin_mint, expires_in_days } = body;
+ const {
+ title,
+ description,
+ reward_sol,
+ reward_tokens,
+ coin_symbol,
+ coin_mint,
+ expires_in_days,
+ } = body;
if (!title?.trim()) return error(res, 400, 'bad_request', 'title is required');
- if (!reward_sol && !reward_tokens) return error(res, 400, 'bad_request', 'set a reward (SOL or tokens)');
+ if (!reward_sol && !reward_tokens)
+ return error(res, 400, 'bad_request', 'set a reward (SOL or tokens)');
const rewardSol = reward_sol ? parseFloat(reward_sol) : null;
const rewardUsd = rewardSol ? parseFloat((rewardSol * SOL_USD_FALLBACK).toFixed(2)) : null;
diff --git a/api/bounties/[id]/judge.js b/api/bounties/[id]/judge.js
index 4d430a395..12232ef45 100644
--- a/api/bounties/[id]/judge.js
+++ b/api/bounties/[id]/judge.js
@@ -34,7 +34,8 @@ export default wrap(async (req, res) => {
if (!user) return error(res, 401, 'unauthorized', 'sign in to use the AI judge');
const rl = await limits.bountyJudge(user.id);
- if (!rl.success) return error(res, 429, 'rate_limited', 'AI judge limit reached — try again later');
+ if (!rl.success)
+ return error(res, 429, 'rate_limited', 'AI judge limit reached — try again later');
const [bounty] = await sql`
SELECT id, user_id, title, description, status
@@ -67,7 +68,12 @@ export default wrap(async (req, res) => {
let result;
try {
const { system, user: userPrompt } = buildJudgePrompt(bounty, subs);
- const out = await llmComplete({ system, user: userPrompt, maxTokens: 1400, timeoutMs: 30_000 });
+ const out = await llmComplete({
+ system,
+ user: userPrompt,
+ maxTokens: 1400,
+ timeoutMs: 30_000,
+ });
result = normalizeJudgement(out.text, validIds);
result.model = out.model;
result.provider = out.provider;
@@ -75,7 +81,12 @@ export default wrap(async (req, res) => {
if (e instanceof LlmUnavailableError) {
return error(res, 503, 'llm_unavailable', 'AI judge is unavailable right now');
}
- return error(res, 502, 'judge_failed', e?.message || 'the judge could not score this field');
+ return error(
+ res,
+ 502,
+ 'judge_failed',
+ e?.message || 'the judge could not score this field',
+ );
}
// Decorate each ranking with display context the client needs (author,
diff --git a/api/bounties/[id]/likes.js b/api/bounties/[id]/likes.js
index 76f6730b9..2d72c934d 100644
--- a/api/bounties/[id]/likes.js
+++ b/api/bounties/[id]/likes.js
@@ -15,7 +15,8 @@ export default wrap(async (req, res) => {
if (!method(req, res, ['POST'])) return;
const bountyId = req.query?.id;
- if (!bountyId || !isUuid(bountyId)) return error(res, 400, 'bad_request', 'valid bounty id required');
+ if (!bountyId || !isUuid(bountyId))
+ return error(res, 400, 'bad_request', 'valid bounty id required');
const user = await getSessionUser(req).catch(() => null);
if (!user) return error(res, 401, 'unauthorized', 'sign in to like submissions');
diff --git a/api/bounties/[id]/submissions.js b/api/bounties/[id]/submissions.js
index 40e4a4501..e18801f7b 100644
--- a/api/bounties/[id]/submissions.js
+++ b/api/bounties/[id]/submissions.js
@@ -29,7 +29,9 @@ export default wrap(async (req, res) => {
if (req.method === 'POST') {
let user;
- try { user = await getSessionUser(req); } catch {
+ try {
+ user = await getSessionUser(req);
+ } catch {
return error(res, 401, 'unauthorized', 'sign in to submit');
}
@@ -50,7 +52,8 @@ export default wrap(async (req, res) => {
}
const validTypes = ['image', 'video', 'link'];
- const mtype = media_type && validTypes.includes(media_type) ? media_type : (media_url ? 'link' : null);
+ const mtype =
+ media_type && validTypes.includes(media_type) ? media_type : media_url ? 'link' : null;
const username = user.display_name || user.email?.split('@')[0] || 'anon';
const [submission] = await sql`
diff --git a/pages/go.html b/pages/go.html
index ee5e2118c..bd2590263 100644
--- a/pages/go.html
+++ b/pages/go.html
@@ -1,500 +1,1096 @@
<!doctype html>
<html lang="en">
-<head>
- <meta charset="utf-8" />
- <title>GO · Bounties · three.ws</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
- <meta name="description" content="Post bounties, submit proof, earn rewards. The three.ws bounty board powered by $THREE." />
- <meta name="theme-color" content="#0a0a0f" />
- <meta property="og:type" content="website" />
- <meta property="og:site_name" content="three.ws" />
- <meta property="og:title" content="GO · Bounties · three.ws" />
- <meta property="og:description" content="Post bounties, submit proof, earn rewards on-chain." />
- <meta property="og:url" content="https://three.ws/go" />
- <meta name="twitter:card" content="summary_large_image" />
- <style>
- * { margin: 0; padding: 0; box-sizing: border-box; }
- :root {
- --bg: #0a0a0f;
- --surface: #111118;
- --panel: rgba(255,255,255,0.04);
- --panel-hover: rgba(255,255,255,0.07);
- --border: rgba(255,255,255,0.08);
- --text: #f0f0f8;
- --muted: rgba(240,240,248,0.5);
- --muted-2: rgba(240,240,248,0.32);
- --accent: #7c5cff;
- --accent-glow: rgba(124,92,255,0.18);
- --green: #22c55e;
- --green-bg: rgba(34,197,94,0.12);
- --amber: #f59e0b;
- --amber-bg: rgba(245,158,11,0.12);
- --blue: #3b82f6;
- --blue-bg: rgba(59,130,246,0.12);
- --sol: #9945ff;
- --radius: 12px;
- }
- html, body { background: var(--bg); color: var(--text); min-height: 100vh; }
- body {
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
- -webkit-font-smoothing: antialiased;
- background:
- radial-gradient(900px 500px at 70% -5%, rgba(124,92,255,0.12), transparent 60%),
- radial-gradient(700px 400px at 0% 30%, rgba(34,197,94,0.06), transparent 55%),
- var(--bg);
- }
- a { color: inherit; text-decoration: none; }
- button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
+ <head>
+ <meta charset="utf-8" />
+ <title>GO · Bounties · three.ws</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
+ <meta
+ name="description"
+ content="Post bounties, submit proof, earn rewards. The three.ws bounty board powered by $THREE."
+ />
+ <meta name="theme-color" content="#0a0a0f" />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:title" content="GO · Bounties · three.ws" />
+ <meta
+ property="og:description"
+ content="Post bounties, submit proof, earn rewards on-chain."
+ />
+ <meta property="og:url" content="https://three.ws/go" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <style>
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+ :root {
+ --bg: #0a0a0f;
+ --surface: #111118;
+ --panel: rgba(255, 255, 255, 0.04);
+ --panel-hover: rgba(255, 255, 255, 0.07);
+ --border: rgba(255, 255, 255, 0.08);
+ --text: #f0f0f8;
+ --muted: rgba(240, 240, 248, 0.5);
+ --muted-2: rgba(240, 240, 248, 0.32);
+ --accent: #7c5cff;
+ --accent-glow: rgba(124, 92, 255, 0.18);
+ --green: #22c55e;
+ --green-bg: rgba(34, 197, 94, 0.12);
+ --amber: #f59e0b;
+ --amber-bg: rgba(245, 158, 11, 0.12);
+ --blue: #3b82f6;
+ --blue-bg: rgba(59, 130, 246, 0.12);
+ --sol: #9945ff;
+ --radius: 12px;
+ }
+ html,
+ body {
+ background: var(--bg);
+ color: var(--text);
+ min-height: 100vh;
+ }
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ background:
+ radial-gradient(
+ 900px 500px at 70% -5%,
+ rgba(124, 92, 255, 0.12),
+ transparent 60%
+ ),
+ radial-gradient(
+ 700px 400px at 0% 30%,
+ rgba(34, 197, 94, 0.06),
+ transparent 55%
+ ),
+ var(--bg);
+ }
+ a {
+ color: inherit;
+ text-decoration: none;
+ }
+ button {
+ cursor: pointer;
+ border: none;
+ background: none;
+ color: inherit;
+ font: inherit;
+ }
- /* ── Top bar ─────────────────────────────────────────── */
- .topbar {
- display: flex; align-items: center; justify-content: space-between; gap: 12px;
- padding: 14px clamp(16px, 4vw, 40px);
- position: sticky; top: 0; z-index: 20;
- backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
- background: linear-gradient(180deg, rgba(10,10,15,0.9) 70%, transparent);
- border-bottom: 1px solid var(--border);
- }
- .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.5px; }
- .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
- .brand .go-badge {
- font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
- background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 5px;
- text-transform: uppercase;
- }
- .topbar-right { display: flex; align-items: center; gap: 8px; }
- .btn {
- display: inline-flex; align-items: center; gap: 6px;
- padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
- transition: opacity .15s, transform .1s;
- }
- .btn:active { transform: scale(0.97); }
- .btn-primary { background: var(--accent); color: #fff; }
- .btn-primary:hover { opacity: 0.88; }
- .btn-ghost { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
- .btn-ghost:hover { background: var(--panel-hover); }
- .btn-sm { padding: 6px 12px; font-size: 12px; }
- #user-btn { display: none; }
+ /* ── Top bar ─────────────────────────────────────────── */
+ .topbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ padding: 14px clamp(16px, 4vw, 40px);
+ position: sticky;
+ top: 0;
+ z-index: 20;
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+ background: linear-gradient(180deg, rgba(10, 10, 15, 0.9) 70%, transparent);
+ border-bottom: 1px solid var(--border);
+ }
+ .brand {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ font-weight: 800;
+ font-size: 17px;
+ letter-spacing: -0.5px;
+ }
+ .brand .dot {
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ background: var(--accent);
+ box-shadow: 0 0 12px var(--accent);
+ }
+ .brand .go-badge {
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.08em;
+ background: var(--accent);
+ color: #fff;
+ padding: 2px 8px;
+ border-radius: 5px;
+ text-transform: uppercase;
+ }
+ .topbar-right {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+ .btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 8px 16px;
+ border-radius: 8px;
+ font-size: 13px;
+ font-weight: 600;
+ transition:
+ opacity 0.15s,
+ transform 0.1s;
+ }
+ .btn:active {
+ transform: scale(0.97);
+ }
+ .btn-primary {
+ background: var(--accent);
+ color: #fff;
+ }
+ .btn-primary:hover {
+ opacity: 0.88;
+ }
+ .btn-ghost {
+ background: var(--panel);
+ color: var(--text);
+ border: 1px solid var(--border);
+ }
+ .btn-ghost:hover {
+ background: var(--panel-hover);
+ }
+ .btn-sm {
+ padding: 6px 12px;
+ font-size: 12px;
+ }
+ #user-btn {
+ display: none;
+ }
- /* ── Layout ──────────────────────────────────────────── */
- .layout {
- display: grid;
- grid-template-columns: 1fr 300px;
- gap: 0;
- max-width: 1200px;
- margin: 0 auto;
- padding: 0 clamp(12px, 3vw, 32px) 80px;
- align-items: start;
- }
- @media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { display: none; } }
+ /* ── Layout ──────────────────────────────────────────── */
+ .layout {
+ display: grid;
+ grid-template-columns: 1fr 300px;
+ gap: 0;
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 0 clamp(12px, 3vw, 32px) 80px;
+ align-items: start;
+ }
+ @media (max-width: 900px) {
+ .layout {
+ grid-template-columns: 1fr;
+ }
+ .sidebar {
+ display: none;
+ }
+ }
- /* ── Feed column ─────────────────────────────────────── */
- .feed-col { border-right: 1px solid var(--border); min-height: 100vh; }
+ /* ── Feed column ─────────────────────────────────────── */
+ .feed-col {
+ border-right: 1px solid var(--border);
+ min-height: 100vh;
+ }
- /* Tabs */
- .tabs {
- display: flex; gap: 0; border-bottom: 1px solid var(--border);
- position: sticky; top: 57px; z-index: 10;
- backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
- background: rgba(10,10,15,0.85);
- }
- .tab-btn {
- flex: 1; padding: 14px 0; font-size: 13px; font-weight: 600; color: var(--muted);
- border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
- text-align: center; letter-spacing: 0.02em;
- }
- .tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
- .tab-btn:hover:not(.active) { color: var(--text); }
+ /* Tabs */
+ .tabs {
+ display: flex;
+ gap: 0;
+ border-bottom: 1px solid var(--border);
+ position: sticky;
+ top: 57px;
+ z-index: 10;
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ background: rgba(10, 10, 15, 0.85);
+ }
+ .tab-btn {
+ flex: 1;
+ padding: 14px 0;
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--muted);
+ border-bottom: 2px solid transparent;
+ transition:
+ color 0.15s,
+ border-color 0.15s;
+ text-align: center;
+ letter-spacing: 0.02em;
+ }
+ .tab-btn.active {
+ color: var(--text);
+ border-bottom-color: var(--accent);
+ }
+ .tab-btn:hover:not(.active) {
+ color: var(--text);
+ }
- /* Feed */
- #feed { padding: 0; }
+ /* Feed */
+ #feed {
+ padding: 0;
+ }
- /* ── Card ────────────────────────────────────────────── */
- .card {
- border-bottom: 1px solid var(--border);
- padding: 18px 20px;
- transition: background .12s;
- }
- .card:hover { background: var(--panel); }
+ /* ── Card ────────────────────────────────────────────── */
+ .card {
+ border-bottom: 1px solid var(--border);
+ padding: 18px 20px;
+ transition: background 0.12s;
+ }
+ .card:hover {
+ background: var(--panel);
+ }
- .card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
- .badge {
- display: inline-flex; align-items: center;
- font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
- padding: 3px 8px; border-radius: 5px; flex-shrink: 0; margin-top: 2px;
- }
- .badge-open { background: var(--green-bg); color: var(--green); }
- .badge-resolving{ background: var(--amber-bg); color: var(--amber); }
- .badge-closed { background: var(--panel); color: var(--muted); }
- .badge-sub { background: var(--blue-bg); color: var(--blue); }
+ .card-header {
+ display: flex;
+ align-items: flex-start;
+ gap: 10px;
+ margin-bottom: 10px;
+ }
+ .badge {
+ display: inline-flex;
+ align-items: center;
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ padding: 3px 8px;
+ border-radius: 5px;
+ flex-shrink: 0;
+ margin-top: 2px;
+ }
+ .badge-open {
+ background: var(--green-bg);
+ color: var(--green);
+ }
+ .badge-resolving {
+ background: var(--amber-bg);
+ color: var(--amber);
+ }
+ .badge-closed {
+ background: var(--panel);
+ color: var(--muted);
+ }
+ .badge-sub {
+ background: var(--blue-bg);
+ color: var(--blue);
+ }
- .card-meta { flex: 1; min-width: 0; }
- .card-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
- .card-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 8px;
- display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
+ .card-meta {
+ flex: 1;
+ min-width: 0;
+ }
+ .card-title {
+ font-size: 14px;
+ font-weight: 600;
+ line-height: 1.4;
+ margin-bottom: 4px;
+ }
+ .card-desc {
+ font-size: 13px;
+ color: var(--muted);
+ line-height: 1.5;
+ margin-bottom: 8px;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ }
- .card-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
- .poster { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
- .poster-avatar {
- width: 20px; height: 20px; border-radius: 50%;
- background: linear-gradient(135deg, var(--accent), var(--green));
- display: flex; align-items: center; justify-content: center;
- font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0;
- }
- .reward {
- display: flex; align-items: center; gap: 4px;
- font-size: 13px; font-weight: 700; color: var(--green);
- }
- .reward-token { font-size: 11px; color: var(--muted); font-weight: 500; }
- .time-left { font-size: 12px; color: var(--muted-2); }
- .sub-count {
- font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px;
- }
- .coin-tag {
- display: inline-flex; align-items: center; gap: 4px;
- font-size: 11px; color: var(--muted); background: var(--panel);
- border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px;
- }
+ .card-footer {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ flex-wrap: wrap;
+ }
+ .poster {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ font-size: 12px;
+ color: var(--muted);
+ }
+ .poster-avatar {
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ background: linear-gradient(135deg, var(--accent), var(--green));
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 9px;
+ font-weight: 700;
+ color: #fff;
+ flex-shrink: 0;
+ }
+ .reward {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ font-size: 13px;
+ font-weight: 700;
+ color: var(--green);
+ }
+ .reward-token {
+ font-size: 11px;
+ color: var(--muted);
+ font-weight: 500;
+ }
+ .time-left {
+ font-size: 12px;
+ color: var(--muted-2);
+ }
+ .sub-count {
+ font-size: 12px;
+ color: var(--muted);
+ display: flex;
+ align-items: center;
+ gap: 3px;
+ }
+ .coin-tag {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: 11px;
+ color: var(--muted);
+ background: var(--panel);
+ border: 1px solid var(--border);
+ border-radius: 5px;
+ padding: 2px 7px;
+ }
- /* Submission card specific */
- .sub-card { background: rgba(59,130,246,0.03); }
- .sub-to { font-size: 11px; color: var(--muted-2); margin-bottom: 6px; }
- .sub-to span { color: var(--blue); }
- .sub-content { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 8px;
- display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
- .sub-media {
- width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px;
- background: var(--surface); margin-bottom: 8px; display: block;
- }
- .sub-actions { display: flex; gap: 6px; margin-top: 8px; }
- .submit-btn {
- margin-left: auto; font-size: 12px; font-weight: 600;
- padding: 5px 12px; border-radius: 6px;
- background: var(--accent); color: #fff; transition: opacity .15s;
- }
- .submit-btn:hover { opacity: 0.85; }
- .resolve-btn {
- font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 6px;
- background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.2);
- transition: background .15s;
- }
- .resolve-btn:hover { background: rgba(34,197,94,0.2); }
+ /* Submission card specific */
+ .sub-card {
+ background: rgba(59, 130, 246, 0.03);
+ }
+ .sub-to {
+ font-size: 11px;
+ color: var(--muted-2);
+ margin-bottom: 6px;
+ }
+ .sub-to span {
+ color: var(--blue);
+ }
+ .sub-content {
+ font-size: 13px;
+ color: var(--muted);
+ line-height: 1.5;
+ margin-bottom: 8px;
+ display: -webkit-box;
+ -webkit-line-clamp: 3;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ }
+ .sub-media {
+ width: 100%;
+ max-height: 200px;
+ object-fit: cover;
+ border-radius: 8px;
+ background: var(--surface);
+ margin-bottom: 8px;
+ display: block;
+ }
+ .sub-actions {
+ display: flex;
+ gap: 6px;
+ margin-top: 8px;
+ }
+ .submit-btn {
+ margin-left: auto;
+ font-size: 12px;
+ font-weight: 600;
+ padding: 5px 12px;
+ border-radius: 6px;
+ background: var(--accent);
+ color: #fff;
+ transition: opacity 0.15s;
+ }
+ .submit-btn:hover {
+ opacity: 0.85;
+ }
+ .resolve-btn {
+ font-size: 12px;
+ font-weight: 600;
+ padding: 5px 12px;
+ border-radius: 6px;
+ background: var(--green-bg);
+ color: var(--green);
+ border: 1px solid rgba(34, 197, 94, 0.2);
+ transition: background 0.15s;
+ }
+ .resolve-btn:hover {
+ background: rgba(34, 197, 94, 0.2);
+ }
- /* Empty + Loading */
- .empty {
- padding: 60px 20px; text-align: center; color: var(--muted);
- display: flex; flex-direction: column; align-items: center; gap: 12px;
- }
- .empty-icon { font-size: 40px; opacity: 0.4; }
- .empty h3 { font-size: 16px; color: var(--text); }
- .empty p { font-size: 13px; max-width: 280px; line-height: 1.5; }
- .skeleton {
- background: linear-gradient(90deg, var(--panel) 25%, var(--panel-hover) 50%, var(--panel) 75%);
- background-size: 200% 100%;
- animation: shimmer 1.4s infinite;
- border-radius: 6px;
- }
- @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
- .skel-block { height: 14px; margin-bottom: 8px; }
- .skel-card { padding: 18px 20px; border-bottom: 1px solid var(--border); }
+ /* Empty + Loading */
+ .empty {
+ padding: 60px 20px;
+ text-align: center;
+ color: var(--muted);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 12px;
+ }
+ .empty-icon {
+ font-size: 40px;
+ opacity: 0.4;
+ }
+ .empty h3 {
+ font-size: 16px;
+ color: var(--text);
+ }
+ .empty p {
+ font-size: 13px;
+ max-width: 280px;
+ line-height: 1.5;
+ }
+ .skeleton {
+ background: linear-gradient(
+ 90deg,
+ var(--panel) 25%,
+ var(--panel-hover) 50%,
+ var(--panel) 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.4s infinite;
+ border-radius: 6px;
+ }
+ @keyframes shimmer {
+ 0% {
+ background-position: 200% 0;
+ }
+ 100% {
+ background-position: -200% 0;
+ }
+ }
+ .skel-block {
+ height: 14px;
+ margin-bottom: 8px;
+ }
+ .skel-card {
+ padding: 18px 20px;
+ border-bottom: 1px solid var(--border);
+ }
- /* Load more */
- .load-more-btn {
- width: 100%; padding: 16px; text-align: center; font-size: 13px;
- color: var(--muted); border-top: 1px solid var(--border);
- transition: color .15s, background .15s;
- }
- .load-more-btn:hover { color: var(--text); background: var(--panel); }
+ /* Load more */
+ .load-more-btn {
+ width: 100%;
+ padding: 16px;
+ text-align: center;
+ font-size: 13px;
+ color: var(--muted);
+ border-top: 1px solid var(--border);
+ transition:
+ color 0.15s,
+ background 0.15s;
+ }
+ .load-more-btn:hover {
+ color: var(--text);
+ background: var(--panel);
+ }
- /* ── Sidebar ─────────────────────────────────────────── */
- .sidebar { padding: 24px 0 24px 24px; display: flex; flex-direction: column; gap: 24px; }
- .sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
- .sidebar-title {
- font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
- color: var(--muted); padding: 12px 14px 10px; border-bottom: 1px solid var(--border);
- }
- .leaderboard-row {
- display: flex; align-items: center; gap: 10px;
- padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px;
- }
- .leaderboard-row:last-child { border-bottom: none; }
- .rank { font-weight: 700; color: var(--muted-2); width: 16px; flex-shrink: 0; }
- .rank.gold { color: #f59e0b; }
- .rank.silver { color: #94a3b8; }
- .rank.bronze { color: #b45309; }
- .lb-info { flex: 1; min-width: 0; }
- .lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
- .lb-sub { font-size: 11px; color: var(--muted); }
- .lb-amount { font-weight: 700; color: var(--green); font-size: 13px; flex-shrink: 0; }
- .top-bounty-row {
- display: flex; align-items: flex-start; gap: 8px;
- padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px;
- }
- .top-bounty-row:last-child { border-bottom: none; }
- .tb-rank { font-weight: 700; color: var(--muted-2); width: 16px; flex-shrink: 0; padding-top: 1px; }
- .tb-info { flex: 1; min-width: 0; }
- .tb-title { font-weight: 600; font-size: 12px; line-height: 1.4; margin-bottom: 3px;
- display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
- .tb-meta { font-size: 11px; color: var(--muted); }
- .tb-reward { font-weight: 700; color: var(--green); font-size: 13px; flex-shrink: 0; }
+ /* ── Sidebar ─────────────────────────────────────────── */
+ .sidebar {
+ padding: 24px 0 24px 24px;
+ display: flex;
+ flex-direction: column;
+ gap: 24px;
+ }
+ .sidebar-card {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ overflow: hidden;
+ }
+ .sidebar-title {
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--muted);
+ padding: 12px 14px 10px;
+ border-bottom: 1px solid var(--border);
+ }
+ .leaderboard-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 10px 14px;
+ border-bottom: 1px solid var(--border);
+ font-size: 13px;
+ }
+ .leaderboard-row:last-child {
+ border-bottom: none;
+ }
+ .rank {
+ font-weight: 700;
+ color: var(--muted-2);
+ width: 16px;
+ flex-shrink: 0;
+ }
+ .rank.gold {
+ color: #f59e0b;
+ }
+ .rank.silver {
+ color: #94a3b8;
+ }
+ .rank.bronze {
+ color: #b45309;
+ }
+ .lb-info {
+ flex: 1;
+ min-width: 0;
+ }
+ .lb-name {
+ font-weight: 600;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .lb-sub {
+ font-size: 11px;
+ color: var(--muted);
+ }
+ .lb-amount {
+ font-weight: 700;
+ color: var(--green);
+ font-size: 13px;
+ flex-shrink: 0;
+ }
+ .top-bounty-row {
+ display: flex;
+ align-items: flex-start;
+ gap: 8px;
+ padding: 10px 14px;
+ border-bottom: 1px solid var(--border);
+ font-size: 13px;
+ }
+ .top-bounty-row:last-child {
+ border-bottom: none;
+ }
+ .tb-rank {
+ font-weight: 700;
+ color: var(--muted-2);
+ width: 16px;
+ flex-shrink: 0;
+ padding-top: 1px;
+ }
+ .tb-info {
+ flex: 1;
+ min-width: 0;
+ }
+ .tb-title {
+ font-weight: 600;
+ font-size: 12px;
+ line-height: 1.4;
+ margin-bottom: 3px;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ }
+ .tb-meta {
+ font-size: 11px;
+ color: var(--muted);
+ }
+ .tb-reward {
+ font-weight: 700;
+ color: var(--green);
+ font-size: 13px;
+ flex-shrink: 0;
+ }
- /* ── Create bounty modal ─────────────────────────────── */
- .modal-overlay {
- position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100;
- display: flex; align-items: center; justify-content: center;
- backdrop-filter: blur(4px); padding: 20px;
- opacity: 0; pointer-events: none; transition: opacity .2s;
- }
- .modal-overlay.open { opacity: 1; pointer-events: auto; }
- .modal {
- background: var(--surface); border: 1px solid var(--border);
- border-radius: 16px; width: 100%; max-width: 520px;
- max-height: 90vh; overflow-y: auto;
- transform: translateY(12px); transition: transform .2s;
- }
- .modal-overlay.open .modal { transform: translateY(0); }
- .modal-header {
- display: flex; align-items: center; justify-content: space-between;
- padding: 20px 22px 16px; border-bottom: 1px solid var(--border);
- }
- .modal-title { font-size: 16px; font-weight: 700; }
- .modal-close { color: var(--muted); font-size: 18px; padding: 4px; border-radius: 6px; transition: color .12s; }
- .modal-close:hover { color: var(--text); }
- .modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
- .field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.03em; }
- .field input, .field textarea, .field select {
- width: 100%; background: var(--bg); border: 1px solid var(--border);
- border-radius: 8px; color: var(--text); font: inherit; font-size: 14px;
- padding: 10px 12px; outline: none; transition: border-color .15s;
- resize: vertical;
- }
- .field input:focus, .field textarea:focus, .field select:focus {
- border-color: var(--accent);
- }
- .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
- .modal-footer { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); }
- .form-error { font-size: 12px; color: #f87171; background: rgba(248,113,113,0.1); border-radius: 6px; padding: 8px 12px; }
+ /* ── Create bounty modal ─────────────────────────────── */
+ .modal-overlay {
+ position: fixed;
+ inset: 0;
+ background: rgba(0, 0, 0, 0.7);
+ z-index: 100;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ backdrop-filter: blur(4px);
+ padding: 20px;
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity 0.2s;
+ }
+ .modal-overlay.open {
+ opacity: 1;
+ pointer-events: auto;
+ }
+ .modal {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 16px;
+ width: 100%;
+ max-width: 520px;
+ max-height: 90vh;
+ overflow-y: auto;
+ transform: translateY(12px);
+ transition: transform 0.2s;
+ }
+ .modal-overlay.open .modal {
+ transform: translateY(0);
+ }
+ .modal-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 20px 22px 16px;
+ border-bottom: 1px solid var(--border);
+ }
+ .modal-title {
+ font-size: 16px;
+ font-weight: 700;
+ }
+ .modal-close {
+ color: var(--muted);
+ font-size: 18px;
+ padding: 4px;
+ border-radius: 6px;
+ transition: color 0.12s;
+ }
+ .modal-close:hover {
+ color: var(--text);
+ }
+ .modal-body {
+ padding: 20px 22px;
+ display: flex;
+ flex-direction: column;
+ gap: 14px;
+ }
+ .field label {
+ display: block;
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--muted);
+ margin-bottom: 6px;
+ letter-spacing: 0.03em;
+ }
+ .field input,
+ .field textarea,
+ .field select {
+ width: 100%;
+ background: var(--bg);
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ color: var(--text);
+ font: inherit;
+ font-size: 14px;
+ padding: 10px 12px;
+ outline: none;
+ transition: border-color 0.15s;
+ resize: vertical;
+ }
+ .field input:focus,
+ .field textarea:focus,
+ .field select:focus {
+ border-color: var(--accent);
+ }
+ .field-row {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 10px;
+ }
+ .modal-footer {
+ padding: 14px 22px 20px;
+ display: flex;
+ gap: 8px;
+ justify-content: flex-end;
+ border-top: 1px solid var(--border);
+ }
+ .form-error {
+ font-size: 12px;
+ color: #f87171;
+ background: rgba(248, 113, 113, 0.1);
+ border-radius: 6px;
+ padding: 8px 12px;
+ }
- /* Resolve modal: submission picker */
- .sub-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
- .sub-pick {
- border: 2px solid var(--border); border-radius: 8px; padding: 12px 14px;
- cursor: pointer; transition: border-color .12s, background .12s;
- }
- .sub-pick:hover { border-color: var(--accent); background: var(--accent-glow); }
- .sub-pick.selected { border-color: var(--accent); background: var(--accent-glow); }
- .sub-pick-user { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
- .sub-pick-content { font-size: 13px; }
+ /* Resolve modal: submission picker */
+ .sub-pick-list {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ max-height: 300px;
+ overflow-y: auto;
+ }
+ .sub-pick {
+ border: 2px solid var(--border);
+ border-radius: 8px;
+ padding: 12px 14px;
+ cursor: pointer;
+ transition:
+ border-color 0.12s,
+ background 0.12s;
+ }
+ .sub-pick:hover {
+ border-color: var(--accent);
+ background: var(--accent-glow);
+ }
+ .sub-pick.selected {
+ border-color: var(--accent);
+ background: var(--accent-glow);
+ }
+ .sub-pick-user {
+ font-size: 12px;
+ color: var(--muted);
+ margin-bottom: 4px;
+ }
+ .sub-pick-content {
+ font-size: 13px;
+ }
- /* Toast */
- .toast {
- position: fixed; bottom: 24px; right: 24px; z-index: 200;
- background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
- padding: 12px 18px; font-size: 13px; font-weight: 600;
- transform: translateY(8px); opacity: 0; transition: all .2s;
- pointer-events: none; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
- }
- .toast.show { transform: translateY(0); opacity: 1; }
- .toast.success { border-color: rgba(34,197,94,0.4); color: var(--green); }
- .toast.fail { border-color: rgba(248,113,113,0.4); color: #f87171; }
+ /* Toast */
+ .toast {
+ position: fixed;
+ bottom: 24px;
+ right: 24px;
+ z-index: 200;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ padding: 12px 18px;
+ font-size: 13px;
+ font-weight: 600;
+ transform: translateY(8px);
+ opacity: 0;
+ transition: all 0.2s;
+ pointer-events: none;
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
+ }
+ .toast.show {
+ transform: translateY(0);
+ opacity: 1;
+ }
+ .toast.success {
+ border-color: rgba(34, 197, 94, 0.4);
+ color: var(--green);
+ }
+ .toast.fail {
+ border-color: rgba(248, 113, 113, 0.4);
+ color: #f87171;
+ }
- /* ── Likes ───────────────────────────────────────────── */
- .like-btn {
- display: inline-flex; align-items: center; gap: 5px;
- font-size: 12px; font-weight: 600; color: var(--muted);
- background: var(--panel); border: 1px solid var(--border);
- border-radius: 999px; padding: 4px 10px;
- transition: color .14s, border-color .14s, background .14s;
- }
- .like-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
- .like-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
- .like-btn svg { width: 13px; height: 13px; transition: transform .14s; }
- .like-btn.liked { color: #ff6b81; border-color: rgba(255,107,129,0.42); background: rgba(255,107,129,0.10); }
- .like-btn.liked svg { fill: #ff6b81; transform: scale(1.08); }
- .like-btn:active svg { transform: scale(0.8); }
- .like-btn[disabled] { opacity: 0.6; cursor: default; }
- .like-count { font-variant-numeric: tabular-nums; }
+ /* ── Likes ───────────────────────────────────────────── */
+ .like-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--muted);
+ background: var(--panel);
+ border: 1px solid var(--border);
+ border-radius: 999px;
+ padding: 4px 10px;
+ transition:
+ color 0.14s,
+ border-color 0.14s,
+ background 0.14s;
+ }
+ .like-btn:hover {
+ color: var(--text);
+ border-color: rgba(255, 255, 255, 0.18);
+ }
+ .like-btn:focus-visible {
+ outline: 2px solid var(--accent);
+ outline-offset: 2px;
+ }
+ .like-btn svg {
+ width: 13px;
+ height: 13px;
+ transition: transform 0.14s;
+ }
+ .like-btn.liked {
+ color: #ff6b81;
+ border-color: rgba(255, 107, 129, 0.42);
+ background: rgba(255, 107, 129, 0.1);
+ }
+ .like-btn.liked svg {
+ fill: #ff6b81;
+ transform: scale(1.08);
+ }
+ .like-btn:active svg {
+ transform: scale(0.8);
+ }
+ .like-btn[disabled] {
+ opacity: 0.6;
+ cursor: default;
+ }
+ .like-count {
+ font-variant-numeric: tabular-nums;
+ }
- /* ── AI judge (resolve modal) ────────────────────────── */
- .resolve-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
- .resolve-actions .hint { font-size: 12px; color: var(--muted-2); }
- .ai-judge-btn {
- display: inline-flex; align-items: center; gap: 6px;
- font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 8px;
- color: var(--accent); background: var(--accent-glow);
- border: 1px solid rgba(124,92,255,0.32);
- transition: background .14s, opacity .14s;
- }
- .ai-judge-btn:hover { background: rgba(124,92,255,0.22); }
- .ai-judge-btn[disabled] { opacity: 0.7; cursor: default; }
- .ai-summary {
- font-size: 12.5px; line-height: 1.5; color: var(--text);
- background: linear-gradient(90deg, rgba(124,92,255,0.14), rgba(124,92,255,0.03));
- border: 1px solid rgba(124,92,255,0.28); border-radius: 10px;
- padding: 11px 13px; margin-bottom: 12px;
- }
- .ai-summary .ai-badge {
- display: inline-flex; align-items: center; font-size: 9px; font-weight: 800;
- letter-spacing: 0.1em; color: #fff; background: var(--accent);
- border-radius: 4px; padding: 2px 6px; margin-right: 7px; vertical-align: 1px;
- }
- .ai-summary .ai-meta { color: var(--muted-2); }
- .sub-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
- .sub-pick.recommended { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
- .sub-pick-rec {
- display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800;
- letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-top: 6px;
- }
- .ai-score {
- font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff;
- border-radius: 6px; padding: 2px 8px; flex-shrink: 0;
- background: hsl(calc(var(--s, 0) * 1.2) 68% 42%);
- }
- .ai-verdict { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.45; }
- .sp-likes { color: #ff6b81; font-weight: 600; margin-left: 6px; }
- </style>
-</head>
-<body>
-
-<!-- Top bar -->
-<header class="topbar">
- <a href="/" class="brand">
- <span class="dot"></span>
- three.ws
- <span class="go-badge">GO</span>
- </a>
- <div class="topbar-right">
- <a href="/dashboard" class="btn btn-ghost btn-sm">Dashboard</a>
- <button id="create-btn" class="btn btn-primary btn-sm">+ Post Bounty</button>
- <button id="user-btn" class="btn btn-ghost btn-sm"></button>
- </div>
-</header>
+ /* ── AI judge (resolve modal) ────────────────────────── */
+ .resolve-actions {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 10px;
+ margin-bottom: 12px;
+ }
+ .resolve-actions .hint {
+ font-size: 12px;
+ color: var(--muted-2);
+ }
+ .ai-judge-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ font-size: 12px;
+ font-weight: 600;
+ padding: 6px 12px;
+ border-radius: 8px;
+ color: var(--accent);
+ background: var(--accent-glow);
+ border: 1px solid rgba(124, 92, 255, 0.32);
+ transition:
+ background 0.14s,
+ opacity 0.14s;
+ }
+ .ai-judge-btn:hover {
+ background: rgba(124, 92, 255, 0.22);
+ }
+ .ai-judge-btn[disabled] {
+ opacity: 0.7;
+ cursor: default;
+ }
+ .ai-summary {
+ font-size: 12.5px;
+ line-height: 1.5;
+ color: var(--text);
+ background: linear-gradient(
+ 90deg,
+ rgba(124, 92, 255, 0.14),
+ rgba(124, 92, 255, 0.03)
+ );
+ border: 1px solid rgba(124, 92, 255, 0.28);
+ border-radius: 10px;
+ padding: 11px 13px;
+ margin-bottom: 12px;
+ }
+ .ai-summary .ai-badge {
+ display: inline-flex;
+ align-items: center;
+ font-size: 9px;
+ font-weight: 800;
+ letter-spacing: 0.1em;
+ color: #fff;
+ background: var(--accent);
+ border-radius: 4px;
+ padding: 2px 6px;
+ margin-right: 7px;
+ vertical-align: 1px;
+ }
+ .ai-summary .ai-meta {
+ color: var(--muted-2);
+ }
+ .sub-pick-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ }
+ .sub-pick.recommended {
+ border-color: var(--accent);
+ box-shadow: 0 0 0 3px var(--accent-glow);
+ }
+ .sub-pick-rec {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: 10px;
+ font-weight: 800;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ color: var(--accent);
+ margin-top: 6px;
+ }
+ .ai-score {
+ font-size: 12px;
+ font-weight: 800;
+ font-variant-numeric: tabular-nums;
+ color: #fff;
+ border-radius: 6px;
+ padding: 2px 8px;
+ flex-shrink: 0;
+ background: hsl(calc(var(--s, 0) * 1.2) 68% 42%);
+ }
+ .ai-verdict {
+ font-size: 11.5px;
+ color: var(--muted);
+ margin-top: 7px;
+ line-height: 1.45;
+ }
+ .sp-likes {
+ color: #ff6b81;
+ font-weight: 600;
+ margin-left: 6px;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Top bar -->
+ <header class="topbar">
+ <a href="/" class="brand">
+ <span class="dot"></span>
+ three.ws
+ <span class="go-badge">GO</span>
+ </a>
+ <div class="topbar-right">
+ <a href="/dashboard" class="btn btn-ghost btn-sm">Dashboard</a>
+ <button id="create-btn" class="btn btn-primary btn-sm">+ Post Bounty</button>
+ <button id="user-btn" class="btn btn-ghost btn-sm"></button>
+ </div>
+ </header>
-<!-- Main layout -->
-<div class="layout">
- <!-- Feed column -->
- <div class="feed-col">
- <nav class="tabs" role="tablist">
- <button class="tab-btn active" data-tab="feed">Trending</button>
- <button class="tab-btn" data-tab="open">Open</button>
- <button class="tab-btn" data-tab="submissions">Submissions</button>
- </nav>
- <div id="feed"></div>
- </div>
+ <!-- Main layout -->
+ <div class="layout">
+ <!-- Feed column -->
+ <div class="feed-col">
+ <nav class="tabs" role="tablist">
+ <button class="tab-btn active" data-tab="feed">Trending</button>
+ <button class="tab-btn" data-tab="open">Open</button>
+ <button class="tab-btn" data-tab="submissions">Submissions</button>
+ </nav>
+ <div id="feed"></div>
+ </div>
- <!-- Sidebar -->
- <aside class="sidebar">
- <div class="sidebar-card">
- <div class="sidebar-title">Highest Value · Open</div>
- <div id="top-bounties"></div>
- </div>
- <div class="sidebar-card">
- <div class="sidebar-title">Top Earners · 30d</div>
- <div id="top-earners"></div>
- </div>
- <div class="sidebar-card">
- <div class="sidebar-title">Top Spenders · 30d</div>
- <div id="top-spenders"></div>
+ <!-- Sidebar -->
+ <aside class="sidebar">
+ <div class="sidebar-card">
+ <div class="sidebar-title">Highest Value · Open</div>
+ <div id="top-bounties"></div>
+ </div>
+ <div class="sidebar-card">
+ <div class="sidebar-title">Top Earners · 30d</div>
+ <div id="top-earners"></div>
+ </div>
+ <div class="sidebar-card">
+ <div class="sidebar-title">Top Spenders · 30d</div>
+ <div id="top-spenders"></div>
+ </div>
+ </aside>
</div>
- </aside>
-</div>
-<!-- Create bounty modal -->
-<div class="modal-overlay" id="create-modal" role="dialog" aria-modal="true">
- <div class="modal">
- <div class="modal-header">
- <span class="modal-title">Post a Bounty</span>
- <button class="modal-close" data-close="create-modal">✕</button>
- </div>
- <div class="modal-body">
- <div id="create-error" class="form-error" style="display:none"></div>
- <div class="field">
- <label>Title *</label>
- <input id="c-title" type="text" placeholder="What do you want people to do?" maxlength="200" />
- </div>
- <div class="field">
- <label>Description</label>
- <textarea id="c-desc" rows="3" placeholder="Describe the task, rules, and what counts as a valid submission…"></textarea>
- </div>
- <div class="field-row">
- <div class="field">
- <label>Reward (SOL)</label>
- <input id="c-sol" type="number" min="0" step="0.01" placeholder="0.5" />
+ <!-- Create bounty modal -->
+ <div class="modal-overlay" id="create-modal" role="dialog" aria-modal="true">
+ <div class="modal">
+ <div class="modal-header">
+ <span class="modal-title">Post a Bounty</span>
+ <button class="modal-close" data-close="create-modal">✕</button>
+ </div>
+ <div class="modal-body">
+ <div id="create-error" class="form-error" style="display: none"></div>
+ <div class="field">
+ <label>Title *</label>
+ <input
+ id="c-title"
+ type="text"
+ placeholder="What do you want people to do?"
+ maxlength="200"
+ />
+ </div>
+ <div class="field">
+ <label>Description</label>
+ <textarea
+ id="c-desc"
+ rows="3"
+ placeholder="Describe the task, rules, and what counts as a valid submission…"
+ ></textarea>
+ </div>
+ <div class="field-row">
+ <div class="field">
+ <label>Reward (SOL)</label>
+ <input id="c-sol" type="number" min="0" step="0.01" placeholder="0.5" />
+ </div>
+ <div class="field">
+ <label>Expires in (days)</label>
+ <select id="c-days">
+ <option value="3">3 days</option>
+ <option value="7" selected>7 days</option>
+ <option value="14">14 days</option>
+ <option value="30">30 days</option>
+ </select>
+ </div>
+ </div>
</div>
- <div class="field">
- <label>Expires in (days)</label>
- <select id="c-days">
- <option value="3">3 days</option>
- <option value="7" selected>7 days</option>
- <option value="14">14 days</option>
- <option value="30">30 days</option>
- </select>
+ <div class="modal-footer">
+ <button class="btn btn-ghost" data-close="create-modal">Cancel</button>
+ <button id="create-submit" class="btn btn-primary">Post Bounty</button>
</div>
</div>
</div>
- <div class="modal-footer">
- <button class="btn btn-ghost" data-close="create-modal">Cancel</button>
- <button id="create-submit" class="btn btn-primary">Post Bounty</button>
- </div>
- </div>
-</div>
-<!-- Submit proof modal -->
-<div class="modal-overlay" id="submit-modal" role="dialog" aria-modal="true">
- <div class="modal">
- <div class="modal-header">
- <span class="modal-title">Submit Proof</span>
- <button class="modal-close" data-close="submit-modal">✕</button>
- </div>
- <div class="modal-body">
- <div id="submit-error" class="form-error" style="display:none"></div>
- <div id="submit-bounty-title" style="font-size:13px;color:var(--muted);margin-bottom:4px;"></div>
- <div class="field">
- <label>Description</label>
- <textarea id="s-content" rows="3" placeholder="Describe what you did…"></textarea>
- </div>
- <div class="field">
- <label>Media / Link URL</label>
- <input id="s-url" type="url" placeholder="https://x.com/… or https://youtu.be/…" />
+ <!-- Submit proof modal -->
+ <div class="modal-overlay" id="submit-modal" role="dialog" aria-modal="true">
+ <div class="modal">
+ <div class="modal-header">
+ <span class="modal-title">Submit Proof</span>
+ <button class="modal-close" data-close="submit-modal">✕</button>
+ </div>
+ <div class="modal-body">
+ <div id="submit-error" class="form-error" style="display: none"></div>
+ <div
+ id="submit-bounty-title"
+ style="font-size: 13px; color: var(--muted); margin-bottom: 4px"
+ ></div>
+ <div class="field">
+ <label>Description</label>
+ <textarea
+ id="s-content"
+ rows="3"
+ placeholder="Describe what you did…"
+ ></textarea>
+ </div>
+ <div class="field">
+ <label>Media / Link URL</label>
+ <input
+ id="s-url"
+ type="url"
+ placeholder="https://x.com/… or https://youtu.be/…"
+ />
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-ghost" data-close="submit-modal">Cancel</button>
+ <button id="submit-proof-btn" class="btn btn-primary">Submit</button>
+ </div>
</div>
</div>
- <div class="modal-footer">
- <button class="btn btn-ghost" data-close="submit-modal">Cancel</button>
- <button id="submit-proof-btn" class="btn btn-primary">Submit</button>
- </div>
- </div>
-</div>
-<!-- Resolve modal -->
-<div class="modal-overlay" id="resolve-modal" role="dialog" aria-modal="true">
- <div class="modal">
- <div class="modal-header">
- <span class="modal-title">Pick a Winner</span>
- <button class="modal-close" data-close="resolve-modal">✕</button>
- </div>
- <div class="modal-body">
- <div id="resolve-error" class="form-error" style="display:none"></div>
- <div class="resolve-actions">
- <span class="hint">Pick the submission to reward.</span>
- <button id="ai-judge-btn" class="ai-judge-btn" type="button">✨ Rank with AI</button>
- </div>
- <div id="ai-summary" class="ai-summary" style="display:none"></div>
- <div id="resolve-subs" class="sub-pick-list"></div>
- <div class="field" style="margin-top:12px;">
- <label>Solana TX Hash (optional)</label>
- <input id="r-tx" type="text" placeholder="Paste transaction signature after paying…" />
+ <!-- Resolve modal -->
+ <div class="modal-overlay" id="resolve-modal" role="dialog" aria-modal="true">
+ <div class="modal">
+ <div class="modal-header">
+ <span class="modal-title">Pick a Winner</span>
+ <button class="modal-close" data-close="resolve-modal">✕</button>
+ </div>
+ <div class="modal-body">
+ <div id="resolve-error" class="form-error" style="display: none"></div>
+ <div class="resolve-actions">
+ <span class="hint">Pick the submission to reward.</span>
+ <button id="ai-judge-btn" class="ai-judge-btn" type="button">
+ ✨ Rank with AI
+ </button>
+ </div>
+ <div id="ai-summary" class="ai-summary" style="display: none"></div>
+ <div id="resolve-subs" class="sub-pick-list"></div>
+ <div class="field" style="margin-top: 12px">
+ <label>Solana TX Hash (optional)</label>
+ <input
+ id="r-tx"
+ type="text"
+ placeholder="Paste transaction signature after paying…"
+ />
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-ghost" data-close="resolve-modal">Cancel</button>
+ <button id="resolve-submit" class="btn btn-primary">Confirm Winner</button>
+ </div>
</div>
</div>
- <div class="modal-footer">
- <button class="btn btn-ghost" data-close="resolve-modal">Cancel</button>
- <button id="resolve-submit" class="btn btn-primary">Confirm Winner</button>
- </div>
- </div>
-</div>
-<!-- Toast -->
-<div class="toast" id="toast"></div>
+ <!-- Toast -->
+ <div class="toast" id="toast"></div>
-<script type="module" src="/src/go.js"></script>
-</body>
+ <script type="module" src="/src/go.js"></script>
+ </body>
</html>
diff --git a/public/features.json b/public/features.json
index d917f356c..08263703e 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-06T17:39:07.846Z",
+ "generated_at": "2026-06-08T04:05:22.926Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/go.js b/src/go.js
index cc8f1ce32..a20cc36a7 100644
--- a/src/go.js
+++ b/src/go.js
@@ -28,9 +28,12 @@ async function loadUser() {
if (r.ok) {
currentUser = await r.json();
const btn = document.getElementById('user-btn');
- btn.textContent = currentUser.display_name || currentUser.email?.split('@')[0] || 'account';
+ btn.textContent =
+ currentUser.display_name || currentUser.email?.split('@')[0] || 'account';
btn.style.display = '';
- btn.addEventListener('click', () => { location.href = '/dashboard'; });
+ btn.addEventListener('click', () => {
+ location.href = '/dashboard';
+ });
}
} catch {
// unauthenticated — fine
@@ -40,9 +43,9 @@ async function loadUser() {
// ── Tabs ─────────────────────────────────────────────────────────────────────
function bindTabs() {
- document.querySelectorAll('.tab-btn').forEach(btn => {
+ document.querySelectorAll('.tab-btn').forEach((btn) => {
btn.addEventListener('click', () => {
- document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
+ document.querySelectorAll('.tab-btn').forEach((b) => b.classList.remove('active'));
btn.classList.add('active');
currentTab = btn.dataset.tab;
feedOffset = 0;
@@ -129,7 +132,9 @@ function renderSubmissions(el, subs) {
// ── Card renderers ────────────────────────────────────────────────────────────
function renderBountyCard(b) {
- const statusClass = { open: 'badge-open', resolving: 'badge-resolving', closed: 'badge-closed' }[b.status] || 'badge-open';
+ const statusClass =
+ { open: 'badge-open', resolving: 'badge-resolving', closed: 'badge-closed' }[b.status] ||
+ 'badge-open';
const statusLabel = b.status?.toUpperCase() || 'OPEN';
const reward = b.reward_sol ? `◎ ${parseFloat(b.reward_sol).toFixed(2)} SOL` : '';
const rewardUsd = b.reward_usd ? `$${parseFloat(b.reward_usd).toFixed(2)}` : '';
@@ -168,11 +173,12 @@ function renderBountyCard(b) {
function renderSubmissionCard(s) {
const initial = (s.username || '?')[0].toUpperCase();
const ago = timeAgo(s.created_at);
- const mediaEl = s.media_url && isImageUrl(s.media_url)
- ? `<img class="sub-media" src="${esc(s.media_url)}" alt="submission media" loading="lazy" />`
- : s.media_url
- ? `<a href="${esc(s.media_url)}" target="_blank" rel="noopener noreferrer" class="btn btn-ghost btn-sm" style="display:inline-flex;gap:6px;margin-bottom:8px;">🔗 View proof</a>`
- : '';
+ const mediaEl =
+ s.media_url && isImageUrl(s.media_url)
+ ? `<img class="sub-media" src="${esc(s.media_url)}" alt="submission media" loading="lazy" />`
+ : s.media_url
+ ? `<a href="${esc(s.media_url)}" target="_blank" rel="noopener noreferrer" class="btn btn-ghost btn-sm" style="display:inline-flex;gap:6px;margin-bottom:8px;">🔗 View proof</a>`
+ : '';
return `
<article class="card sub-card" data-id="${esc(s.id)}">
@@ -212,8 +218,15 @@ async function loadTopBounties() {
try {
const r = await fetch(`${API}?tab=open&limit=5`);
const { bounties } = await r.json();
- if (!bounties?.length) { el.innerHTML = '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">No open bounties yet</div>'; return; }
- el.innerHTML = bounties.slice(0, 5).map((b, i) => `
+ if (!bounties?.length) {
+ el.innerHTML =
+ '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">No open bounties yet</div>';
+ return;
+ }
+ el.innerHTML = bounties
+ .slice(0, 5)
+ .map(
+ (b, i) => `
<div class="top-bounty-row">
<div class="tb-rank">${i + 1}</div>
<div class="tb-info">
@@ -222,9 +235,12 @@ async function loadTopBounties() {
</div>
${b.reward_usd ? `<div class="tb-reward">$${parseFloat(b.reward_usd).toFixed(0)}</div>` : ''}
</div>
- `).join('');
+ `,
+ )
+ .join('');
} catch {
- el.innerHTML = '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">—</div>';
+ el.innerHTML =
+ '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">—</div>';
}
}
@@ -241,48 +257,66 @@ async function loadLeaderboards() {
spendersEl.innerHTML = renderLeaderboard(spenders);
return;
}
- } catch { /* fall through to placeholder */ }
+ } catch {
+ /* fall through to placeholder */
+ }
// Placeholder until leaderboard endpoint exists
- earnersEl.innerHTML = '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">Data loading…</div>';
- spendersEl.innerHTML = '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">Data loading…</div>';
+ earnersEl.innerHTML =
+ '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">Data loading…</div>';
+ spendersEl.innerHTML =
+ '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">Data loading…</div>';
}
function renderLeaderboard(rows) {
- if (!rows?.length) return '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">No data yet</div>';
+ if (!rows?.length)
+ return '<div class="leaderboard-row" style="color:var(--muted-2);font-size:12px;">No data yet</div>';
const medals = ['gold', 'silver', 'bronze'];
- return rows.slice(0, 3).map((r, i) => `
+ return rows
+ .slice(0, 3)
+ .map(
+ (r, i) =>
+ `
<div class="leaderboard-row">
- <div class="rank ${medals[i] || ''}">🥇🥈🥉`.split('').filter((_, ii) => ii < 2)[i] + `</div>
+ <div class="rank ${medals[i] || ''}">🥇🥈🥉`
+ .split('')
+ .filter((_, ii) => ii < 2)[i] +
+ `</div>
<div class="lb-info">
<div class="lb-name">${esc(r.username || shortAddr(r.user_id))}</div>
<div class="lb-sub">${r.payout_count} payout${r.payout_count !== 1 ? 's' : ''}</div>
</div>
<div class="lb-amount">$${parseFloat(r.total_usd || 0).toFixed(2)}</div>
</div>
- `).join('');
+ `,
+ )
+ .join('');
}
// ── Modals ────────────────────────────────────────────────────────────────────
function bindModals() {
- document.querySelectorAll('[data-close]').forEach(btn => {
+ document.querySelectorAll('[data-close]').forEach((btn) => {
btn.addEventListener('click', () => closeModal(btn.dataset.close));
});
- document.querySelectorAll('.modal-overlay').forEach(overlay => {
- overlay.addEventListener('click', e => {
+ document.querySelectorAll('.modal-overlay').forEach((overlay) => {
+ overlay.addEventListener('click', (e) => {
if (e.target === overlay) closeModal(overlay.id);
});
});
- document.addEventListener('keydown', e => {
- if (e.key === 'Escape') document.querySelectorAll('.modal-overlay.open').forEach(m => closeModal(m.id));
+ document.addEventListener('keydown', (e) => {
+ if (e.key === 'Escape')
+ document.querySelectorAll('.modal-overlay.open').forEach((m) => closeModal(m.id));
});
// Delegate submit/resolve buttons in feed
- document.getElementById('feed').addEventListener('click', e => {
+ document.getElementById('feed').addEventListener('click', (e) => {
const btn = e.target.closest('[data-action]');
if (!btn) return;
- if (!currentUser) { location.href = '/login'; return; }
+ if (!currentUser) {
+ location.href = '/login';
+ return;
+ }
if (btn.dataset.action === 'like') {
toggleLike(btn);
return;
@@ -307,7 +341,10 @@ function closeModal(id) {
function bindCreate() {
document.getElementById('create-btn').addEventListener('click', () => {
- if (!currentUser) { location.href = '/login'; return; }
+ if (!currentUser) {
+ location.href = '/login';
+ return;
+ }
openModal('create-modal');
});
@@ -318,8 +355,14 @@ function bindCreate() {
const days = parseInt(document.getElementById('c-days').value, 10);
const errEl = document.getElementById('create-error');
- if (!title) { showErr(errEl, 'Title is required'); return; }
- if (!sol) { showErr(errEl, 'Set a SOL reward'); return; }
+ if (!title) {
+ showErr(errEl, 'Title is required');
+ return;
+ }
+ if (!sol) {
+ showErr(errEl, 'Set a SOL reward');
+ return;
+ }
errEl.style.display = 'none';
const btn = document.getElementById('create-submit');
@@ -331,7 +374,12 @@ function bindCreate() {
method: 'POST',
credentials: 'include',
headers: { 'content-type': 'application/json' },
- body: JSON.stringify({ title, description: desc || undefined, reward_sol: sol, expires_in_days: days }),
+ body: JSON.stringify({
+ title,
+ description: desc || undefined,
+ reward_sol: sol,
+ expires_in_days: days,
+ }),
});
const data = await r.json();
if (!r.ok) throw new Error(data.error_description || data.error || 'failed');
@@ -350,7 +398,9 @@ function bindCreate() {
}
function resetCreateForm() {
- ['c-title', 'c-desc', 'c-sol'].forEach(id => { document.getElementById(id).value = ''; });
+ ['c-title', 'c-desc', 'c-sol'].forEach((id) => {
+ document.getElementById(id).value = '';
+ });
document.getElementById('c-days').value = '7';
document.getElementById('create-error').style.display = 'none';
}
@@ -372,7 +422,10 @@ function bindSubmit() {
const url = document.getElementById('s-url').value.trim();
const errEl = document.getElementById('submit-error');
- if (!content && !url) { showErr(errEl, 'Add a description or media URL'); return; }
+ if (!content && !url) {
+ showErr(errEl, 'Add a description or media URL');
+ return;
+ }
errEl.style.display = 'none';
const mediaType = url ? guessMediaType(url) : null;
@@ -385,7 +438,11 @@ function bindSubmit() {
method: 'POST',
credentials: 'include',
headers: { 'content-type': 'application/json' },
- body: JSON.stringify({ content: content || undefined, media_url: url || undefined, media_type: mediaType }),
+ body: JSON.stringify({
+ content: content || undefined,
+ media_url: url || undefined,
+ media_type: mediaType,
+ }),
});
const data = await r.json();
if (!r.ok) throw new Error(data.error_description || data.error || 'failed');
@@ -416,16 +473,20 @@ async function openResolveModal(bountyId) {
const judgeBtn = document.getElementById('ai-judge-btn');
judgeBtn.disabled = false;
judgeBtn.textContent = '✨ Rank with AI';
- document.getElementById('resolve-subs').innerHTML = '<div style="color:var(--muted);font-size:13px;">Loading submissions…</div>';
+ document.getElementById('resolve-subs').innerHTML =
+ '<div style="color:var(--muted);font-size:13px;">Loading submissions…</div>';
openModal('resolve-modal');
try {
- const r = await fetch(`${API}/${bountyId}/submissions?limit=50`, { credentials: 'include' });
+ const r = await fetch(`${API}/${bountyId}/submissions?limit=50`, {
+ credentials: 'include',
+ });
const data = await r.json();
resolveSubmissions = data.submissions || [];
renderResolveSubs();
} catch {
- document.getElementById('resolve-subs').innerHTML = '<div style="color:#f87171;font-size:13px;">Failed to load submissions</div>';
+ document.getElementById('resolve-subs').innerHTML =
+ '<div style="color:#f87171;font-size:13px;">Failed to load submissions</div>';
}
}
@@ -435,14 +496,17 @@ function renderResolveSubs() {
el.innerHTML = '<div style="color:var(--muted);font-size:13px;">No submissions yet</div>';
return;
}
- el.innerHTML = resolveSubmissions.map(s => {
- const ai = s._ai;
- const isRec = aiRecommendedId && s.id === aiRecommendedId;
- const likes = s.like_count ? `<span class="sp-likes">♥ ${s.like_count}</span>` : '';
- const score = ai ? `<span class="ai-score" style="--s:${ai.score}">${ai.score}</span>` : '';
- const verdict = ai?.verdict ? `<div class="ai-verdict">${esc(ai.verdict)}</div>` : '';
- const recBadge = isRec ? `<div class="sub-pick-rec">★ AI pick</div>` : '';
- return `
+ el.innerHTML = resolveSubmissions
+ .map((s) => {
+ const ai = s._ai;
+ const isRec = aiRecommendedId && s.id === aiRecommendedId;
+ const likes = s.like_count ? `<span class="sp-likes">♥ ${s.like_count}</span>` : '';
+ const score = ai
+ ? `<span class="ai-score" style="--s:${ai.score}">${ai.score}</span>`
+ : '';
+ const verdict = ai?.verdict ? `<div class="ai-verdict">${esc(ai.verdict)}</div>` : '';
+ const recBadge = isRec ? `<div class="sub-pick-rec">★ AI pick</div>` : '';
+ return `
<div class="sub-pick ${s.id === selectedSubmissionId ? 'selected' : ''} ${isRec ? 'recommended' : ''}" data-sid="${esc(s.id)}">
<div class="sub-pick-head">
<div class="sub-pick-user">${esc(s.username || 'anon')} · ${timeAgo(s.created_at)}${likes}</div>
@@ -452,12 +516,13 @@ function renderResolveSubs() {
${verdict}
${recBadge}
</div>`;
- }).join('');
+ })
+ .join('');
- el.querySelectorAll('.sub-pick').forEach(div => {
+ el.querySelectorAll('.sub-pick').forEach((div) => {
div.addEventListener('click', () => {
selectedSubmissionId = div.dataset.sid;
- el.querySelectorAll('.sub-pick').forEach(d => d.classList.remove('selected'));
+ el.querySelectorAll('.sub-pick').forEach((d) => d.classList.remove('selected'));
div.classList.add('selected');
});
});
@@ -468,7 +533,10 @@ function bindResolve() {
document.getElementById('resolve-submit').addEventListener('click', async () => {
const errEl = document.getElementById('resolve-error');
- if (!selectedSubmissionId) { showErr(errEl, 'Select a winning submission'); return; }
+ if (!selectedSubmissionId) {
+ showErr(errEl, 'Select a winning submission');
+ return;
+ }
const tx = document.getElementById('r-tx').value.trim();
errEl.style.display = 'none';
@@ -481,7 +549,10 @@ function bindResolve() {
method: 'POST',
credentials: 'include',
headers: { 'content-type': 'application/json' },
- body: JSON.stringify({ submission_id: selectedSubmissionId, tx_hash: tx || undefined }),
+ body: JSON.stringify({
+ submission_id: selectedSubmissionId,
+ tx_hash: tx || undefined,
+ }),
});
const data = await r.json();
if (!r.ok) throw new Error(data.error_description || data.error || 'failed');
@@ -504,7 +575,10 @@ function heartSvg() {
}
async function toggleLike(btn) {
- if (!currentUser) { location.href = '/login'; return; }
+ if (!currentUser) {
+ location.href = '/login';
+ return;
+ }
const sid = btn.dataset.id;
const bid = btn.dataset.bounty;
if (!sid || !bid) return;
@@ -544,7 +618,10 @@ async function toggleLike(btn) {
// ── AI judge ──────────────────────────────────────────────────────────────────
async function runJudge() {
- if (!resolveSubmissions.length) { toast('No submissions to rank yet'); return; }
+ if (!resolveSubmissions.length) {
+ toast('No submissions to rank yet');
+ return;
+ }
const btn = document.getElementById('ai-judge-btn');
const banner = document.getElementById('ai-summary');
const prevLabel = btn.textContent;
@@ -552,13 +629,16 @@ async function runJudge() {
btn.textContent = '✨ Judging…';
try {
- const r = await fetch(`${API}/${activeBountyId}/judge`, { method: 'POST', credentials: 'include' });
+ const r = await fetch(`${API}/${activeBountyId}/judge`, {
+ method: 'POST',
+ credentials: 'include',
+ });
const data = await r.json();
if (!r.ok) throw new Error(data.error_description || data.error || 'failed');
- const byId = new Map((data.rankings || []).map(x => [x.submission_id, x]));
+ const byId = new Map((data.rankings || []).map((x) => [x.submission_id, x]));
resolveSubmissions = resolveSubmissions
- .map(s => ({ ...s, _ai: byId.get(s.id) || null }))
+ .map((s) => ({ ...s, _ai: byId.get(s.id) || null }))
.sort((a, b) => (b._ai?.score ?? -1) - (a._ai?.score ?? -1));
aiRecommendedId = data.recommended_id || null;
@@ -570,7 +650,9 @@ async function runJudge() {
btn.textContent = '✨ Re-rank';
toast('AI ranked the submissions', 'success');
} catch (err) {
- const msg = /unavailable/i.test(err.message) ? 'AI judge is unavailable right now' : (err.message || 'Judge failed');
+ const msg = /unavailable/i.test(err.message)
+ ? 'AI judge is unavailable right now'
+ : err.message || 'Judge failed';
toast(msg, 'fail');
btn.textContent = prevLabel;
} finally {
@@ -581,24 +663,34 @@ async function runJudge() {
// ── Helpers ───────────────────────────────────────────────────────────────────
function renderSkeletons(n) {
- return Array.from({ length: n }, () => `
+ return Array.from(
+ { length: n },
+ () => `
<div class="skel-card">
<div class="skeleton skel-block" style="width:60px;height:18px;margin-bottom:12px;"></div>
<div class="skeleton skel-block" style="width:80%;height:16px;"></div>
<div class="skeleton skel-block" style="width:55%;height:13px;"></div>
<div class="skeleton skel-block" style="width:40%;height:12px;"></div>
</div>
- `).join('');
+ `,
+ ).join('');
}
function renderEmpty() {
- const label = { feed: 'No bounties yet', open: 'No open bounties', submissions: 'No submissions yet' }[currentTab] || 'Nothing here yet';
+ const label =
+ { feed: 'No bounties yet', open: 'No open bounties', submissions: 'No submissions yet' }[
+ currentTab
+ ] || 'Nothing here yet';
return `<div class="empty"><div class="empty-icon">🎯</div><h3>${label}</h3><p>Be the first to post a bounty and get community members competing.</p></div>`;
}
function esc(str) {
if (str == null) return '';
- return String(str).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');
+ return String(str)
+ .replace(/&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;');
}
function timeLeftStr(iso) {
@@ -649,7 +741,9 @@ function toast(msg, type = '') {
el.textContent = msg;
el.className = `toast${type ? ' ' + type : ''} show`;
clearTimeout(toastTimer);
- toastTimer = setTimeout(() => { el.classList.remove('show'); }, 3000);
+ toastTimer = setTimeout(() => {
+ el.classList.remove('show');
+ }, 3000);
}
// ── Boot ─────────────────────────────────────────────────────────────────────
diff --git a/tests/bounties-judge.test.js b/tests/bounties-judge.test.js
index 63e5c5122..bbe3f4cf6 100644
--- a/tests/bounties-judge.test.js
+++ b/tests/bounties-judge.test.js
@@ -8,7 +8,11 @@
import { describe, it, expect } from 'vitest';
import { buildJudgePrompt, normalizeJudgement, extractJson } from '../api/_lib/bounty-judge.js';
-const IDS = ['aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'cccccccc-cccc-cccc-cccc-cccccccccccc'];
+const IDS = [
+ 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
+ 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb',
+ 'cccccccc-cccc-cccc-cccc-cccccccccccc',
+];
describe('extractJson', () => {
it('parses a bare JSON object', () => {
@@ -39,7 +43,11 @@ describe('normalizeJudgement', () => {
rankings: [
{ submission_id: IDS[0], score: 40, verdict: 'ok' },
{ submission_id: IDS[1], score: 150, verdict: 'great' }, // clamps to 100
- { submission_id: 'ffffffff-ffff-ffff-ffff-ffffffffffff', score: 99, verdict: 'fake' }, // dropped
+ {
+ submission_id: 'ffffffff-ffff-ffff-ffff-ffffffffffff',
+ score: 99,
+ verdict: 'fake',
+ }, // dropped
{ submission_id: IDS[2], score: -5, verdict: 'bad' }, // clamps to 0
],
});
@@ -74,7 +82,9 @@ describe('normalizeJudgement', () => {
});
it('handles non-numeric scores as 0', () => {
- const raw = JSON.stringify({ rankings: [{ submission_id: IDS[0], score: 'not a number' }] });
+ const raw = JSON.stringify({
+ rankings: [{ submission_id: IDS[0], score: 'not a number' }],
+ });
const out = normalizeJudgement(raw, valid);
expect(out.rankings[0].score).toBe(0);
});
@@ -84,15 +94,27 @@ describe('normalizeJudgement', () => {
});
it('throws when no rankings reference a real submission', () => {
- const raw = JSON.stringify({ rankings: [{ submission_id: 'ffffffff-ffff-ffff-ffff-ffffffffffff', score: 90 }] });
+ const raw = JSON.stringify({
+ rankings: [{ submission_id: 'ffffffff-ffff-ffff-ffff-ffffffffffff', score: 90 }],
+ });
expect(() => normalizeJudgement(raw, valid)).toThrow();
});
});
describe('buildJudgePrompt', () => {
- const bounty = { title: 'Do a backflip on camera', description: 'Must be one continuous shot.' };
+ const bounty = {
+ title: 'Do a backflip on camera',
+ description: 'Must be one continuous shot.',
+ };
const subs = [
- { id: IDS[0], username: 'alice', content: 'Here is my flip', media_url: 'https://x.com/a', media_type: 'link', like_count: 3 },
+ {
+ id: IDS[0],
+ username: 'alice',
+ content: 'Here is my flip',
+ media_url: 'https://x.com/a',
+ media_type: 'link',
+ like_count: 3,
+ },
{ id: IDS[1], username: 'bob', content: '', media_url: null, like_count: 0 },
];