// 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= 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('') : '

No cards yet: they appear with the first pick.

'; } })();