f26ac15712
$10 one-time DraftPosition purchases (sponsor 25%, L2-5 5%, 10% Best Coach pot, 45% company) with keeper-signed hub-line vouchers; pure draft engine with a mocked clock; no contact data anywhere; Telegram to an outbox unless TG_LIVE=1. Unit 60/60, smoke 156/156 (Playwright 1280/390). Not deployed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
1.7 KiB
JavaScript
19 lines
1.7 KiB
JavaScript
// Card Collection: trading cards that level up as the picks do (Rookie, Starter, Pro, All-Star, Hall of Fame). Public cards show
|
|
// milestones, never earnings. ?u=<coach> shows that coach's team; signed in, your own team; otherwise the five tiers explained.
|
|
(async function () {
|
|
FX.renderNav('/cards'); FX.renderFooter();
|
|
const $ = FX.$, esc = FX.esc;
|
|
const TIERS = [['rookie', 'Rookie', 'Drafted'], ['starter', 'Starter', 'Wallet linked'], ['pro', 'Pro', 'Payouts switched on'], ['allstar', 'All-Star', 'First purchase'], ['hof', 'Hall of Fame', 'Built a team of their own']];
|
|
$('tiers').innerHTML = TIERS.map(t => FX.card({ tier: t[0], tierName: t[1], username: t[1].toLowerCase().replace(/[^a-z]/g, ''), coach: 'your team', milestone: t[2], plays: null, kind: 'draft', round: null })).join('');
|
|
let u = new URLSearchParams(location.search).get('u') || '';
|
|
let title = '', list = [];
|
|
if (!/^[A-Za-z0-9_.-]{2,40}$/.test(u)) {
|
|
const me = await FX.getJSON('/api/me').catch(() => ({}));
|
|
if (me.signedIn) { const d = await FX.getJSON('/api/my'); if (!d.error) { list = (d.picks || []).filter(p => p.status !== 'returned').map(p => ({ tier: p.tier, tierName: p.tierName, username: p.username, coach: d.username || 'me', round: p.round, kind: p.kind, milestone: TIERS.find(t => t[0] === p.tier)[2], plays: p.plays, status: p.status })); title = 'My team'; } }
|
|
} else {
|
|
const d = await FX.getJSON('/api/coach?u=' + encodeURIComponent(u));
|
|
if (!d.error) { list = d.team; title = '@' + d.username + '\'s team'; }
|
|
}
|
|
if (title) { $('mine').hidden = false; $('mineTitle').textContent = title; $('mineCards').innerHTML = list.length ? list.map(x => FX.card(x)).join('') : '<p class="muted">No cards yet: they appear with the first pick.</p>'; }
|
|
})();
|