From 414aceb69540ae62e1639ef391fa38129dcaa076 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 18:19:09 +0000 Subject: [PATCH 1/9] Back Room: a mini badge for whoever tops each game's main board leaderboard.js works out the leader of each game's main board (Elo, or best score, time or streak; Stackfall Classic and Sand) after every read, with a floor, ties, merged accounts as one player and removed accounts never counting, and hands the uids over in the same lb:tops answer as the #1 tags. miles.js draws them as small shields after every existing badge, folding into a +N chip where a row has no room. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DfCR7RPoK1UNAvb7iRuPWn --- e63334287a3deaa3/leaderboard.js | 95 +++++++++++++++++- e63334287a3deaa3/miles.js | 171 ++++++++++++++++++++++++++++++-- 2 files changed, 256 insertions(+), 10 deletions(-) diff --git a/e63334287a3deaa3/leaderboard.js b/e63334287a3deaa3/leaderboard.js index 992f9d5f..ea8a4540 100644 --- a/e63334287a3deaa3/leaderboard.js +++ b/e63334287a3deaa3/leaderboard.js @@ -127,6 +127,14 @@ 'Most waves held': 'Más oleadas aguantadas', 'Daily puzzles finished': 'Puzles diarios terminados', 'Best daily streak (any puzzle)': 'Mejor racha diaria (cualquier puzle)', 'Perfect days': 'Días perfectos', 'Perfect days (no mistakes)': 'Días perfectos (sin errores)', 'Clean daily solves': 'Resueltos limpios diarios', 'Daily clues solved': 'Pistas diarias resueltas', 'No hints': 'Sin pistas', 'Solved with no hints': 'Resuelto sin pistas', 'Daily puzzles solved': 'Puzles diarios resueltos', 'Guesses to spare': 'Intentos de sobra', 'Mistakes to spare': 'Errores de sobra', + // A game's main board: who holds its mini badge (miles.js). Names and values are filled in as they are. + '{who}, with {v}. Whoever is first on this board holds its badge (at least {m}).': '{who}, con {v}. Quien esté primero en esta tabla tiene su insignia (al menos {m}).', + '{who}, with {v} each. Whoever is first on this board holds its badge (at least {m}).': '{who}, con {v} cada uno. Quien esté primero en esta tabla tiene su insignia (al menos {m}).', + '{who}, with {v}. Whoever is first on this board holds its badge (at most {m}).': '{who}, con {v}. Quien esté primero en esta tabla tiene su insignia (como máximo {m}).', + '{who}, with {v} each. Whoever is first on this board holds its badge (at most {m}).': '{who}, con {v} cada uno. Quien esté primero en esta tabla tiene su insignia (como máximo {m}).', + 'unclaimed. Whoever is first on this board holds its badge (at least {m}).': 'sin dueño. Quien esté primero en esta tabla tiene su insignia (al menos {m}).', + 'unclaimed. Whoever is first on this board holds its badge (at most {m}).': 'sin dueño. Quien esté primero en esta tabla tiene su insignia (como máximo {m}).', + 'Top of {g}:': 'Primero en {g}:', 'Par days': 'Días en par', 'Par days (no hints)': 'Días en par (sin pistas)', 'Perfect routes': 'Rutas perfectas', 'Most entries found': 'Más respuestas encontradas' }); })(0); @@ -921,6 +929,82 @@ var who = names.length > 1 ? names.slice(0, -1).join(', ') + ' and ' + names[names.length - 1] : names[0]; return who + ', with ' + fmtN(a.n) + ' kills' + (names.length > 1 ? ' each' : '') + '.' + rule; } + // ---- Top of a game: a mini badge for whoever is first on each game's main board ---- + // Every game in GAMES gets one (miles.js draws it as a small shield after every other badge), held by whoever rows() + // ranks 1 on that game's main board: the same checked nodes, merged accounts as one player, removed ones never, and + // everyone tied for first. The main board is the game's Elo board where it has one, else its first board that isn't + // hidden, unless TOP_PICK names another; TOP_MODES gives a game more than one (Stackfall: Classic and Sand). Shell Crackers + // and Slipstream have none: Top Cracker and the Slipstream ace are their badges (TOP_SKIP). A floor (TOP_MIN, or for + // times and other lowest-first boards TOP_MAX) keeps it from being handed out for nothing: an Elo leader must be above + // the starting rating, 1,000 (a rating is only published after a rated match, so that also means they have played); + // anything else needs at least 1 unless listed. A new game in GAMES gets a badge by these defaults with no change here; + // its name comes from GAMES's n, so a renamed game carries its badge's name with it. + var TOP_SKIP = { 'shell-crackers': 1, slipstream: 1 }; + var TOP_MODES = { stackfall: ['classic', 'sand'] }; + // The daily puzzles rank by their best daily streak (winning every day in a row), not by wins (days played) or fewest + // guesses (ties at the minimum); the rest pick the board that says "best", not a count that only grows with play. + var TOP_PICK = { blockstorm: 'mkills', beatvault: 'keys', 'stat-duel': 'streak' }; + ['daily', 'hunch', 'fourcast', 'quartets', 'crosslet', 'sleight', 'nearword', 'warmer', 'hotspot', 'outline', 'unfurl', 'overland', 'ninefold', 'poopdle', + 'deadline-day', 'journeyman', 'scout-report', 'crossbar', 'teamsheet', 'back-four', 'top-bins'].forEach(function (d) { TOP_PICK[d] = 'streak'; }); + var ELO_START = 1000; + var TOP_MIN = { blockstorm: 5, coil: 100, trivium: 500, showdown: 1000, escapade: 10, 'asteroid-run': 500, rollaway: 200, + rampline: 5, flipline: 200, tidewick: 1000, beatvault: 3, gridpop: 1000, '2048': 2000, stackfall: 1000, 'stackfall:sand': 1000, + 'melon-merge': 1000, 'patchwork-tower': 1000, flickerwood: 1000, lanternhold: 5, 'stat-duel': 3 }; + var TOP_MAX = { spire: 600 }; // lowest first: the fastest tower must be under 10 minutes (where its miles start) + var TOP_STREAK = 3; // a daily streak: 3 days in a row or more + var TOP_IDS = 12; // uids kept per game in the answer (ties and merged accounts), so it stays small + // -> [{ id: 'coil' or 'stackfall:sand', d, st, name: 'Stackfall (Sand)', min, max }] in GAMES order. + var topB0 = null; // GAMES never changes on a page, so the list is worked out once + function topBoards() { + if (topB0) return topB0; + var out = topB0 = []; + GAMES.forEach(function (g) { + if (TOP_SKIP[g.d]) return; + var vis = g.st.filter(function (s) { return !s.hide; }), keys = TOP_MODES[g.d]; + if (!keys) { var k = TOP_PICK[g.d]; keys = [k && vis.some(function (s) { return s.k === k; }) ? k : vis.some(function (s) { return s.k === 'elo'; }) ? 'elo' : vis[0] && vis[0].k]; } + keys.forEach(function (k, i) { + var st = vis.filter(function (s) { return s.k === k; })[0]; if (!st) return; + var id = i ? g.d + ':' + k : g.d; + var b = { id: id, d: g.d, st: st, name: g.n + (TOP_MODES[g.d] ? ' (' + (st.chip || st.l) + ')' : ''), min: 1, max: 0 }; + if (st.f === 'elo') b.min = ELO_START + 1; + else if (st.f === 'days') b.min = TOP_STREAK; + if (TOP_MIN[id] != null) b.min = TOP_MIN[id]; + if (low(st)) { b.min = 0; b.max = TOP_MAX[id] || 0; } + out.push(b); + }); + }); + return out; + } + function topName(id) { var b = topBoards().filter(function (x) { return x.id === id; })[0]; return b ? b.name : ''; } + // Who leads each board. people: a collapsed list; all: the list before collapse (merged accounts, as ace() and cracker()). + // -> [{ b: the board, n: the leader's value (0 when unclaimed), who: the holders, ids: their uids and merged accounts }] + function gameTops(people, all, only) { + var list = (people || []).filter(function (p) { return p && !p.hidden && !p.into; }); + return (only ? [only] : topBoards()).map(function (b) { + var out = { b: b, n: 0, who: [], ids: [] }; + var r = rows({ g: b.d, st: b.st }, list); + if (!r.length) return out; + var v = r[0].v; + if (b.min && !(v >= b.min)) return out; + if (b.max && !(v <= b.max)) return out; + out.n = v; + out.who = r.filter(function (x) { return x.rank === 1; }).map(function (x) { return x.p; }).sort(function (a, c) { return a.n < c.n ? -1 : a.n > c.n ? 1 : a.uid < c.uid ? -1 : 1; }); + out.ids = out.who.map(function (p) { return p.uid; }); + (all || []).forEach(function (p) { if (p && p.into && !p.hidden && out.ids.indexOf(p.into) >= 0 && out.ids.indexOf(p.uid) < 0) out.ids.push(p.uid); }); + out.ids = out.ids.slice(0, TOP_IDS); + return out; + }); + } + // The line a game's main board carries about its badge. me(uid): whether that is the viewer. + function fmtTop(st, v) { return st.f === 'elo' ? fmtN(v) + ' Elo' : fmt(st, v); } + function gameTopLine(t, me) { + var b = t.b, lim = b.max ? 'at most ' + fmtTop(b.st, b.max) : 'at least ' + fmtTop(b.st, b.min); + var rule = ' Whoever is first on this board holds its badge (' + lim + ').'; + if (!t.n) return 'unclaimed.' + rule; + var names = t.who.map(function (p) { return p.n + (me && me(p.uid) ? ' (you)' : ''); }); + var who = names.length > 1 ? names.slice(0, -1).join(', ') + ' and ' + names[names.length - 1] : names[0]; + return who + ', with ' + fmtTop(b.st, t.n) + (names.length > 1 ? ' each' : '') + '.' + rule; + } // Who is first, second and third on the Miles board, for the "#1 all time" / "#2 this week" … tags miles.js puts by // tier badges: the uids rows() ranks 1, 2 and 3 for each span, so the same checked nodes, the same week and the same tie rule as the board (a tie for // first: every tied player, and allTie / weekTie say so). people: a collapsed list. all: the list before collapse, to @@ -944,6 +1028,8 @@ }); var a = ace(list, all); out.ace = a.ids; out.aceN = a.n; var c = cracker(list, all); out.crack = c.ids; out.crackN = c.n; + // mini: [[board id, [uid…]], …] in GAMES order, only the boards someone holds (see gameTops). + out.mini = gameTops(list, all).filter(function (t) { return t.n && t.ids.length; }).map(function (t) { return [t.b.id, t.ids]; }); return out; } // The same from raw nodes, for the admin page (which also lists removed and merged accounts): read here as the boards @@ -958,7 +1044,7 @@ } // For the admin page: the same checks and names, so what it shows is what the boards would show. With data-lib, that's all. - window.BackRoomBoards = { rows: rows, tops: tops, topsOf: topsOf, ace: ace, ACE_MIN: ACE_MIN, cracker: cracker, CRACK_MIN: CRACK_MIN,RS_PATH: RS_PATH, readResets: readResets, get resets() { return RESETS; }, showHidden: function (v) { SHOW_HIDDEN = !!v; }, parse: parse, collapse: collapse, GAMES: GAMES, BY: BY, TRACKS: TRACKS, SLIP_SEASON: SLIP_SEASON, SLIP_RESET: SLIP_RESET, trackRows: trackRows, EPOCH: EPOCH, PATH: PATH, MAX_NODES: MAX_NODES, NODE_MAX: NODE_MAX, fmt: fmt, fmtHours: fmtHours, cleanName: cleanName, mask: mask, seatOf: seatOf }; + window.BackRoomBoards = { rows: rows, tops: tops, topsOf: topsOf, ace: ace, ACE_MIN: ACE_MIN, cracker: cracker, CRACK_MIN: CRACK_MIN, topBoards: topBoards, topName: topName, gameTops: gameTops,RS_PATH: RS_PATH, readResets: readResets, get resets() { return RESETS; }, showHidden: function (v) { SHOW_HIDDEN = !!v; }, parse: parse, collapse: collapse, GAMES: GAMES, BY: BY, TRACKS: TRACKS, SLIP_SEASON: SLIP_SEASON, SLIP_RESET: SLIP_RESET, trackRows: trackRows, EPOCH: EPOCH, PATH: PATH, MAX_NODES: MAX_NODES, NODE_MAX: NODE_MAX, fmt: fmt, fmtHours: fmtHours, cleanName: cleanName, mask: mask, seatOf: seatOf }; if (me && me.hasAttribute('data-lib')) return; // ---------------- Styles ---------------- @@ -1306,10 +1392,13 @@ $season.hidden = !(slip && view.st && (view.st.all || view.st.track)); // the lap and record boards, not Hours or Elo // Shell Crackers' Kills (all time) board: the same line for Top Cracker (cracker), which that board decides. var crackB = view.g === 'shell-crackers' && view.st && view.st.k === 'kills'; - $ace.hidden = ($season.hidden && !crackB) || !people; + // A game's main board (topBoards): who holds that game's mini badge, the same kind of line. + var topB = !crackB && $season.hidden && view.st ? topBoards().filter(function (b) { return b.d === view.g && b.st.k === view.st.k; })[0] : null; + $ace.hidden = ($season.hidden && !crackB && !topB) || !people; if (!$ace.hidden) { $ace.textContent = ''; if (crackB) $ace.append(el('b', '', 'Top Cracker: '), crackerLine(cracker(people, everyone), isMe)); + else if (topB) $ace.append(el('b', '', 'Top of ' + topB.name + ':'), ' ', gameTopLine(gameTops(people, everyone, topB)[0], isMe)); else $ace.append(el('b', '', 'Slipstream ace: '), aceLine(ace(people, everyone), isMe)); } var miles = view.g === 'all', spans = miles || !view.st, wk = spans && view.span === 'week'; @@ -1415,5 +1504,5 @@ // Test hook for the automated checks; harmless in normal play. if (navigator.webdriver) window.__lb = { get people() { return people; }, get view() { return view; }, get myUid() { return myUid; }, parse: parse, collapse: collapse, rows: rows, milesOf: milesOf, $span: $span, trackRows: trackRows, boardsFor: boardsFor, fmt: fmt, BY: BY, load: function () { lastLoad = 0; return load(); }, draw: draw, set top(n) { TOP = n; }, setResets: function (r) { RESETS = r || {}; }, PATH: PATH, EPOCH: EPOCH, - feed: function (val, now) { take(val || {}, now || Date.now()); say(''); draw(); }, tops: tops, ace: ace, aceLine: aceLine, cracker: cracker, crackerLine: crackerLine, $ace: $ace, get lastLoad() { return lastLoad; }, set lastLoad(t) { lastLoad = t; } }; + feed: function (val, now) { take(val || {}, now || Date.now()); say(''); draw(); }, tops: tops, ace: ace, aceLine: aceLine, cracker: cracker, crackerLine: crackerLine, gameTops: gameTops, gameTopLine: gameTopLine, topBoards: topBoards, $ace: $ace, get lastLoad() { return lastLoad; }, set lastLoad(t) { lastLoad = t; } }; })(); diff --git a/e63334287a3deaa3/miles.js b/e63334287a3deaa3/miles.js index 7550ae2b..9186e64c 100644 --- a/e63334287a3deaa3/miles.js +++ b/e63334287a3deaa3/miles.js @@ -108,7 +108,12 @@ 'Se gana: ten la vuelta más rápida de la temporada en más pistas de Slipstream que nadie, {n} o más a la vez. Pasa a quien tome la delantera.', 'Earned: have more Shell Crackers kills of all time than anyone else, {n} or more. It moves to whoever takes the lead.': 'Se gana: ten más bajas históricas en Shell Crackers que nadie, {n} o más. Pasa a quien tome la delantera.', - 'Leads {n} Slipstream tracks': 'Lidera {n} pistas de Slipstream', 'Most Shell Crackers kills: {n}': 'Más bajas en Shell Crackers: {n}', + 'Leads {n} Slipstream tracks': 'Lidera {n} pistas de Slipstream', + // Top of a game (mini badges). Game names stay in English. + 'Top of {g}': 'Primero en {g}', 'Also top of: {l}': 'También primero en: {l}', 'Top of: {l}': 'Primero en: {l}', 'Top of a game': 'Primero en un juego', + 'Small shields, after everything else. One player can hold several.': 'Escudos pequeños, después de todo lo demás. Un jugador puede tener varios.', + 'Earned: lead a game’s main board (its Elo, or its best score, time or streak) to earn its badge. It moves to whoever takes the lead.': + 'Se gana: lidera la tabla principal de un juego (su Elo, o su mejor puntaje, tiempo o racha) para ganar su insignia. Pasa a quien tome la delantera.', 'Most Shell Crackers kills: {n}': 'Más bajas en Shell Crackers: {n}', 'Ranked #{p} in miles, all time': 'Puesto #{p} en millas, histórico', 'Ranked #{p} in miles, this week': 'Puesto #{p} en millas, esta semana', 'Ranked #{p} in miles, all time (tied for first)': 'Puesto #{p} en millas, histórico (empatado en el primero)', 'Ranked #{p} in miles, this week (tied for first)': 'Puesto #{p} en millas, esta semana (empatado en el primero)' }); @@ -213,6 +218,78 @@ '6QQvFAzdtMeJdAUSPwHd6v2zaDk1': ['boostball'], // Nico (Google sign-in, "Negus"): a Boostball badge, asked for by Nico 'QaJlsT7SVnf85IK1PRHFpR9Zbln2': ['boostball'] // Nico ("nico"): the same person's other account }; + // ---- Top of a game: mini badges ---- + // Whoever is first on a game's main board (leaderboard.js topBoards: its Elo board, or its best score, time or streak) + // holds that game's mini badge: a small shield after every other badge, one per game they lead, so one player can hold + // several. Nobody is listed here: leaderboard.js works the holders out after every read of the boards and hands them over + // in the same answer as the #1 tags (setTops: mini). The words come from the game's name in leaderboard.js's GAMES + // ("Top of Stackfall (Sand)"), so a renamed game takes its badge with it. This table is only how each one looks: the + // shield's colour (c) and a simple mark that hints at the game (e), SVG in a 16 x 16 box drawn inside the shield, light + // on the shield's colour. Every shield shares the same frame (a dark outline and a pale inner rim), so they read as one + // family on light and dark pages and can't be taken for a tier pill, a place tag or an award's round medal. A game with + // no line here (a new game) gets MINI_ANY, a star, so it still has a badge. Keys are leaderboard.js's board ids: the + // game's folder, or folder:stat for a game's second board (Stackfall's Sand). + var MINI = { + 'rumble-karts': { c: '#C63A22', e: '' }, + 'blockstorm': { c: '#45702A', e: '' }, + 'sky-duel': { c: '#2659A6', e: '' }, + 'backrooms-1v1': { c: '#A88A1E', e: '' }, + 'drop-zone': { c: '#3354A0', e: '' }, + 'lunge-line': { c: '#64285A', e: '' }, + 'boostball': { c: '#2F68D6', e: '' }, + 'coil': { c: '#24804C', e: '' }, + 'trivium': { c: '#6A3AB0', e: '' }, + 'showdown': { c: '#1C6440', e: '' }, + 'chromaflage': { c: '#B82F72', e: '' }, + 'spire': { c: '#54479C', e: '' }, + 'turbo-trail': { c: '#D2560E', e: '' }, + 'escapade': { c: '#7E5022', e: '' }, + 'updraft': { c: '#16264A', e: '' }, + 'asteroid-run': { c: '#363A62', e: '' }, + 'rollaway': { c: '#A8722C', e: '' }, + 'rampline': { c: '#23719A', e: '' }, + 'flipline': { c: '#C2452F', e: '' }, + 'tidewick': { c: '#177280', e: '' }, + 'beatvault': { c: '#7E2499', e: '' }, + 'odd-one-out': { c: '#8E6017', e: '' }, + 'tumble-trials': { c: '#C93C86', e: '' }, + 'deepword': { c: '#0F466D', e: '' }, + 'puffer-party': { c: '#BE6416', e: '' }, + 'gridpop': { c: '#C93556', e: '' }, + '2048': { c: '#B5761F', e: '' }, + 'stackfall': { c: '#3149D6', e: '' }, + 'stackfall:sand': { c: '#A27A1F', e: '' }, + 'melon-merge': { c: '#23893F', e: '' }, + 'patchwork-tower': { c: '#8E4524', e: '' }, + 'flickerwood': { c: '#2E5729', e: '' }, + 'hush-pools': { c: '#106374', e: '' }, + 'lanternhold': { c: '#5A3A1C', e: '' }, + 'daily': { c: '#3E525C', e: '' }, + 'hunch': { c: '#5547C9', e: '' }, + 'fourcast': { c: '#336396', e: '' }, + 'quartets': { c: '#5E2F80', e: '' }, + 'crosslet': { c: '#3A4658', e: '' }, + 'sleight': { c: '#542680', e: '' }, + 'nearword': { c: '#287366', e: '' }, + 'warmer': { c: '#B53E27', e: '' }, + 'hotspot': { c: '#A83232', e: '' }, + 'outline': { c: '#336E50', e: '' }, + 'unfurl': { c: '#7D5E31', e: '' }, + 'overland': { c: '#476F34', e: '' }, + 'ninefold': { c: '#36469E', e: '' }, + 'poopdle': { c: '#6E4224', e: '' }, + 'deadline-day': { c: '#2A3A6A', e: '' }, + 'journeyman': { c: '#573B33', e: '' }, + 'scout-report': { c: '#36454D', e: '' }, + 'crossbar': { c: '#2A7230', e: '' }, + 'teamsheet': { c: '#405493', e: '' }, + 'back-four': { c: '#1D4874', e: '' }, + 'stat-duel': { c: '#614397', e: '' }, + 'top-bins': { c: '#006B5F', e: '' } + }; + var MINI_ANY = { c: '#4A5568', e: '' }; + // The frame every mini shares: a shield, its dark outline, the game's colour, a pale inner rim. + var MINI_SHIELD = 'M8 1.1l6.1 2.1v4.7c0 3.6-2.5 6.1-6.1 7.2-3.6-1.1-6.1-3.6-6.1-7.2V3.2z'; var LAP_PER_TRACK = 200, LAP_CAP = 2000, LAP_WINDOW = 2.5, REC_EACH = 100, REC_CAP = 1000; function num(v) { return typeof v === 'number' && isFinite(v) ? v : NaN; } @@ -304,15 +381,17 @@ // First on the Miles board: the pill and its "#1" tags in one wrapper. Everyone else gets the pill alone, as before. // An award holder gets the same wrapper, with a ribbon for each award after the tags. // The earned awards (the Slipstream ace, then Top Cracker) come last, after any award that was given. - var top = null, aw = awardsOf(res), led = 0, cr = 0; - if (res && res.uid) { wantTops(); top = topOf(res.uid); led = aceOf(res); cr = crackerOf(res); } - if (!top && !aw.length && !led && !cr) return s; + // Then, last of all, a mini shield for every game they are first in (minisOf), in the boards' order. + var top = null, aw = awardsOf(res), led = 0, cr = 0, mi = []; + if (res && res.uid) { wantTops(); top = topOf(res.uid); led = aceOf(res); cr = crackerOf(res); mi = minisOf(res); } + if (!top && !aw.length && !led && !cr && !mi.length) return s; var w = document.createElement('span'); w.className = 'bra-tw'; w.appendChild(s); if (top && top.all) w.appendChild(topTag('all', top.all, top.allTie)); if (top && top.week) w.appendChild(topTag('week', top.week, top.weekTie)); aw.forEach(function (k) { w.appendChild(awardTag(k)); }); if (led) w.appendChild(awardTag('slipstream', 'Leads ' + led + ' Slipstream tracks')); if (cr) w.appendChild(awardTag('shellcrackers', 'Most Shell Crackers kills: ' + fmt(cr))); + if (mi.length) w.appendChild(miniGroup(mi)); fitSoon(w); return w; } @@ -347,6 +426,38 @@ s.title = a.n + ' · ' + (tip || a.tip); return s; } + // The mini badges: a group of small shields, one per game, and a "+N" chip that fit() shows when some are folded away + // (its tooltip names them). Each shield has its own tooltip and label, "Top of Stackfall (Sand)". + function miniName(id) { + var B = LB(), n = ''; + try { n = B && B.topName ? B.topName(id) : ''; } catch (e) { n = ''; } + // Before leaderboard.js has loaded (it is on every page that draws badges): the folder, readable. + return n || id.split(':')[0].replace(/-/g, ' ').replace(/\b[a-z]/g, function (c) { return c.toUpperCase(); }) + (id.indexOf(':') > 0 ? ' (' + id.split(':')[1] + ')' : ''); + } + function miniTip(id) { return 'Top of ' + miniName(id); } + function miniTag(id) { + var m = MINI[id] || MINI_ANY, s = document.createElement('span'); + s.className = 'bra-mini'; s.setAttribute('data-mini', id); s.setAttribute('role', 'img'); + s.title = miniTip(id); s.setAttribute('aria-label', s.title); + s.innerHTML = ''; // fixed markup from the table above, no text from anyone + return s; + } + function miniGroup(ids) { + var g = document.createElement('span'), more = document.createElement('span'); + g.className = 'bra-mn'; + ids.forEach(function (id) { g.appendChild(miniTag(id)); }); + more.className = 'bra-mn-more'; g.appendChild(more); + return g; + } + // Show the first n minis and fold the rest into "+N" (n at least 0; all of them: no chip). + function miniShow(g, n) { + var k = g.querySelectorAll('.bra-mini'), more = g.lastChild, rest = []; + for (var i = 0; i < k.length; i++) { var off = i >= n; k[i].classList.toggle('bra-off', off); if (off) rest.push(k[i].title.replace(/^Top of /, '')); } + g.classList.toggle('bra-mn-on', rest.length > 0); + more.textContent = rest.length ? '+' + rest.length : ''; + if (rest.length) { more.title = (n ? 'Also top of: ' : 'Top of: ') + rest.join(', '); more.setAttribute('role', 'img'); more.setAttribute('aria-label', more.title); } + else { more.removeAttribute('title'); more.removeAttribute('aria-label'); more.removeAttribute('role'); } + } var TOP_TEXT = { all: 'all time', week: 'this week' }; // place: 1, 2 or 3 (gold, silver, bronze). All time is a solid metal chip; this week is the same metal as an outline // on slate, so a week's medal reads as a step below an all-time one. @@ -364,16 +475,30 @@ // In order, as room runs out: the awards' words go (bra-tw-a), then the tags' words, with two medals overlapping // (bra-tw-s), then the tier's name if under half of it would show (bra-tw-p). Nothing ever makes a row taller. var fitQ = [], fitT = 0; + // Mini badges (bra-mn) go first, one at a time from the end into the "+N" chip, down to one shield and the chip, then the + // steps above; after the tags' words, the last shield goes too (just "+N"), before the tier's name. function fit(w) { if (!w.isConnected) return; w.classList.remove('bra-tw-s', 'bra-tw-a', 'bra-tw-p'); var kids = w.firstChild ? w.firstChild.children : []; + var mg = w.querySelector('.bra-mn'), mn = mg ? mg.querySelectorAll('.bra-mini').length : 0; + if (mg) miniShow(mg, mn); function tight() { var t = w.scrollWidth > w.clientWidth; for (var i = 0; i < kids.length && !t; i++) t = kids[i].tagName === 'SPAN' && kids[i].scrollWidth > kids[i].clientWidth; return t; } var aw = !!w.querySelector('.bra-aw'); + if (mg && !tight() && mn > 1) { + // Room in the row, but a row that wraps (your own Online row) may have taken a second line for the shields: keep + // the most shields that don't make the boxes around the badge taller than with one. + var all = heights(w); miniShow(mg, 1); var one = heights(w); + if (one.some(function (h, i) { return h < all[i]; })) { + for (var n = mn - 1; n > 1; n--) { miniShow(mg, n); if (!heights(w).some(function (h, i) { return h > one[i]; })) break; } + if (n <= 1) miniShow(mg, 1); + } else miniShow(mg, mn); + } + if (mg && tight()) { for (var m = mn - 1; m >= 1 && tight(); m--) miniShow(mg, m); } if (!tight()) { // Room for everything, but a row that wraps (your own Online row) may have found it by taking a second line: an // award's words must never make a row taller, so they go if the boxes around the badge are shorter without them. @@ -386,6 +511,7 @@ // well (bra-tw-s; two medals then also overlap like stacked coins, see the styles). if (aw) { w.classList.add('bra-tw-a'); if (!tight()) return; } w.classList.add('bra-tw-s'); + if (mg && tight()) miniShow(mg, 0); // Still squeezed hard (place tags and two medals in a phone row): a tier name cut to under half ("VI…") says less // than none, so the pill keeps just its icon and colours (bra-tw-p); its tooltip still names the tier. for (var i = 0; i < kids.length; i++) if (kids[i].tagName === 'SPAN') { if (kids[i].clientWidth < kids[i].scrollWidth / 2) w.classList.add('bra-tw-p'); break; } @@ -455,7 +581,13 @@ // the one before it. '.bra-tw-s .bra-aw+.bra-aw{margin-left:-6px}.bra-tw-s .bra-aw+.bra-aw svg{z-index:0}' + // And the tier name would be cut to under half: the pill is its icon alone. - '.bra-tw-p>.bra-tier{padding:3px 5px;gap:0;flex:none}.bra-tw-p>.bra-tier>span{display:none}'; + '.bra-tw-p>.bra-tier{padding:3px 5px;gap:0;flex:none}.bra-tw-p>.bra-tier>span{display:none}' + + // Mini badges (top of a game): 14 px shields, smaller than the medals and tags, after everything else. bra-off: folded + // into the "+N" chip, which only shows when something is folded (bra-mn-on). + '.bra-mn{display:inline-flex;align-items:center;gap:2px;flex:none;margin-left:1px}' + + '.bra-mini{display:inline-flex;flex:none;width:14px;height:14px}.bra-mini svg{display:block}.bra-mini.bra-off{display:none}' + + '.bra-mn-more{display:none;align-items:center;flex:none;box-sizing:border-box;height:14px;padding:0 4px;border-radius:7px;font-family:var(--mono,var(--f-m,ui-monospace,monospace));font-size:9px;font-weight:700;letter-spacing:.02em;line-height:1;color:#EEF3FB;background:#2A3142;box-shadow:inset 0 0 0 1px rgba(238,243,251,.55),0 0 0 1px rgba(11,14,22,.55);white-space:nowrap}' + + '.bra-mn-on .bra-mn-more{display:inline-flex}'; (document.head || document.documentElement).appendChild(css); // ---------------- #1 on the Miles board ---------------- @@ -467,6 +599,7 @@ // than TOPS_TTL, the boards are asked to read once (BackRoomBoards.readTops: the one read the Leaderboards section // makes anyway, which it then doesn't repeat), not more often than TOPS_RETRY and not in a tab nobody is looking at. // An answer older than TOPS_KEEP isn't shown. The admin page works it out from the nodes it has read (topsOf). + var MINI_GAMES = 120, MINI_IDS = 12, MINI_ID = /^[a-z0-9-]{1,30}(?::[a-z0-9-]{1,30})?$/; // games, uids per game, a board id var TOPS_KEY = 'lb:tops', TOPS_TTL = 15 * 60000, TOPS_KEEP = 60 * 60000, TOPS_RETRY = 60000, TOPS_MAX = 50; var tops = null, topsAsked = 0, topsWanted = false; function uidList(a) { return Array.isArray(a) ? a.filter(okUid).slice(0, TOPS_MAX) : []; } @@ -479,11 +612,18 @@ var aceN = Math.floor(num(o.aceN)), ace = aceN >= ACE_MIN && aceN <= 99 ? uidList(o.ace) : []; // crack, crackN: Top Cracker's holders and their kills, the same way (absent before it; under CRACK_MIN, nobody). var crackN = Math.floor(num(o.crackN)), crack = crackN >= CRACK_MIN && crackN <= 1e7 ? uidList(o.crack) : []; + // mini: [[board id, [uid…]], …], who is first on each game's main board (absent before it: nobody holds a mini). + var mini = []; + if (Array.isArray(o.mini)) o.mini.slice(0, MINI_GAMES).forEach(function (x) { + if (!Array.isArray(x) || typeof x[0] !== 'string' || !MINI_ID.test(x[0]) || mini.some(function (y) { return y[0] === x[0]; })) return; + var u = Array.isArray(x[1]) ? x[1].filter(okUid).slice(0, MINI_IDS) : []; + if (u.length) mini.push([x[0], u]); + }); return { t: t, all: uidList(o.all), week: uidList(o.week), allTie: !!o.allTie, weekTie: !!o.weekTie, all2: uidList(o.all2), all3: uidList(o.all3), week2: uidList(o.week2), week3: uidList(o.week3), ace: ace, aceN: ace.length ? aceN : 0, - crack: crack, crackN: crack.length ? crackN : 0 }; + crack: crack, crackN: crack.length ? crackN : 0, mini: mini }; } - function topsSig(o) { return o ? [o.all, o.week, o.all2, o.all3, o.week2, o.week3, o.ace, o.crack].map(function (a) { return a.join(); }).join('|') + '|' + (o.allTie ? 1 : 0) + (o.weekTie ? 1 : 0) + '|' + o.aceN + '|' + o.crackN : ''; } + function topsSig(o) { return o ? [o.all, o.week, o.all2, o.all3, o.week2, o.week3, o.ace, o.crack].map(function (a) { return a.join(); }).join('|') + '|' + (o.allTie ? 1 : 0) + (o.weekTie ? 1 : 0) + '|' + o.aceN + '|' + o.crackN + '|' + o.mini.map(function (x) { return x[0] + ':' + x[1].join(); }).join(';') : ''; } function liveTops() { return tops && Date.now() - tops.t < TOPS_KEEP ? tops : null; } function takeTops(c) { var was = topsSig(liveTops()); tops = c; @@ -525,6 +665,13 @@ var c = liveTops(); if (!c || !c.crackN) return 0; return idsOf(res).some(function (u) { return c.crack.indexOf(u) >= 0; }) ? c.crackN : 0; } + // The games a result's player is first in (mini badges), as board ids in the boards' order; [] for most people. Accounts + // shown as one row count as one player (idsOf). Takes a result or a uid. + function minisOf(res) { + var c = liveTops(); if (!c || !c.mini.length) return []; + var ids = idsOf(res); if (!ids.length) return []; + return c.mini.filter(function (x) { return ids.some(function (u) { return x[1].indexOf(u) >= 0; }); }).map(function (x) { return x[0]; }); + } function wantTops() { var now = Date.now(); if ((tops && now - tops.t < TOPS_TTL) || now - topsAsked < TOPS_RETRY) return; @@ -644,6 +791,14 @@ gRow(l, [awardTag(k)], AWARD_KINDS[k].n, k === 'slipstream' ? 'Earned: hold the fastest lap this season on more Slipstream tracks than anyone else, ' + ACE_MIN + ' or more at once. It moves to whoever takes the lead.' : k === 'shellcrackers' ? 'Earned: have more Shell Crackers kills of all time than anyone else, ' + CRACK_MIN + ' or more. It moves to whoever takes the lead.' : AWARD_KINDS[k].tip + '.'); }); + // Top of a game: one line for the rule, then every game's shield (each with its tooltip), from the boards' own list. + l = gSec(box, 'Top of a game', 'Small shields, after everything else. One player can hold several.'); + var B = LB(), ids = []; + try { ids = B && B.topBoards ? B.topBoards().map(function (b) { return b.id; }) : Object.keys(MINI); } catch (e) { ids = Object.keys(MINI); } + gRow(l, [miniTag(ids[0] || 'stackfall')], 'Top of a game', 'Earned: lead a game’s main board (its Elo, or its best score, time or streak) to earn its badge. It moves to whoever takes the lead.'); + var all = gEl('li', 'bra-g-r bra-g-mn'), wrap = gEl('div', 'bra-g-b'); + ids.forEach(function (id) { wrap.appendChild(miniTag(id)); }); + all.appendChild(wrap); l.appendChild(all); d.appendChild(box); // A click on the dimmed area outside the window closes it. d.addEventListener('click', function (e) { if (e.target === d) d.close(); }); @@ -671,12 +826,14 @@ '.bra-g-r+.bra-g-r{border-top:1px solid var(--line,#D3DAD2)}' + '.bra-g-b{display:flex;flex-wrap:wrap;gap:4px;align-items:center}' + '.bra-g-t{font-size:14px;line-height:1.4}.bra-g-t b{display:block;font-weight:700}.bra-g-t span{color:var(--ink-2,#4A5751)}' + + '.bra-g-mn{grid-template-columns:1fr}.bra-g-mn .bra-g-b{gap:5px}.bra-g-mn .bra-mini{width:18px;height:18px}.bra-g-mn .bra-mini svg{width:18px;height:18px}' + '@media (max-width:480px){.bra-g-in{padding:14px}.bra-g-r{grid-template-columns:1fr}}'; (document.head || document.documentElement).appendChild(gcss); window.BackRoomMiles = { of: of, tierOf: tierOf, isOwner: isOwner, badge: badge, guide: guide, line: line, peek: peek, load: load, fmt: fmt, TIERS: TIERS, RULES: RULES, PATH: PATH, HOUR: HOUR, CAPTAIN: CAPTAIN, OWNERS: OWNERS.slice(), FOUNDER: FOUNDER, isFounder: isFounder, isVice: isVice, VICE_CAPTAIN: VICE_CAPTAIN, VICE_CAPTAINS: VICE_CAPTAINS.slice(), forget: function (uid) { if (uid) delete cache[uid]; else cache = {}; }, setTops: setTops, topOf: topOf, needTops: needTops, + minisOf: minisOf, MINI: JSON.parse(JSON.stringify(MINI)), MINI_ANY: JSON.parse(JSON.stringify(MINI_ANY)), miniTag: miniTag, awardsOf: awardsOf, aceOf: aceOf, ACE_MIN: ACE_MIN, crackerOf: crackerOf, CRACK_MIN: CRACK_MIN, AWARD_KINDS: JSON.parse(JSON.stringify(AWARD_KINDS)), AWARDS: JSON.parse(JSON.stringify(AWARDS)) }; // Test hook for the automated checks; harmless in normal play. put: a result for a uid without a read. if (navigator.webdriver) window.__miles = { get tops() { return tops; }, get asked() { return topsAsked; }, get wanted() { return topsWanted; }, TOPS_KEY: TOPS_KEY, TOPS_TTL: TOPS_TTL, TOPS_KEEP: TOPS_KEEP, From bdf780aef57837e7e3a20f57b4f7e2bef080fad5 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 18:33:11 +0000 Subject: [PATCH 2/9] Mini badges: 16 px, fallback boards, capped-board tie-break, chat header list, README Updraft falls back to the Crown and old-summit boards while nobody has a Lodestar time; Escapade breaks a tie of more than 5 at 144 stars by the fastest World 1 total. Tooltips read "Top player in " (so the Spanish pattern leaves wallet.js's "Top of" history line alone). An open chat's header lists the games larger, with names. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DfCR7RPoK1UNAvb7iRuPWn --- README.md | 4 +- e63334287a3deaa3/leaderboard.js | 115 +++++++++++++++++++++----------- e63334287a3deaa3/miles.js | 63 +++++++++++------ e63334287a3deaa3/social.js | 3 + 4 files changed, 123 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index cbdf6c25..710e0fde 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the - **Captains' preview.** While `PAYMENTS.enabled` is false, a captain who opens `shop/` on the live site gets the real shop with the server wallet in that browser tab: once `captains.js` confirms the signed-in account is a captain, the page sets `sessionStorage['cosmetics:preview']` and opens, with a bar saying it is the captains' preview. Everyone else still sees "not open yet", and the server refuses everyone but captains (`functions/_catalog.js` `PUBLIC: false`), so the preview can't be opened by anyone else by editing their browser. If the account stops being a captain the tab goes back to "not open yet". **To turn the preview off**: set `var CAPTAIN_PREVIEW = false;` near the top of `cosmetics.js` (nothing else; the server needs no change). `?preview=0` on the shop page ends it for one tab. - **Wearing only what you own (`owned.js`, for games).** Buying is checked on the server, but each game decides in the browser what a player wears, so a player can edit their own page and wear any skin, and other players' pages would draw it. `GET https://ascoding11.com/api/owned?uids=a,b,c` (public, no sign-in, at most 24 uids, cached 60 s at Cloudflare's edge by the sorted list, cache misses limited per address) answers `{ v: 1, players: { uid: '*' | [item ids] }, give: [item ids] }`: `'*'` is a captain (owns everything), the list is the wallet's `owned` (gifts included) plus item-shop skus from `entitlements`, empty for an unknown uid or a wallet below zero, and `give` the free and earned items anyone may wear (a game hands those out in the browser, so the server can't know). No balance, history, notes or email are ever in it. `e63334287a3deaa3/owned.js` wraps it: **to wire it into a game**, add `` after `cosmetics.js`, call `BackRoomOwned.want([uids])` as players join, and wherever the game draws ANOTHER player's skin, accessory or item id (never the local player's own, which the page already knows), use it only when `!BackRoomOwned.active() || BackRoomOwned.check(uid, id) === true`, otherwise draw the default look; `check()` returns `true`, `false`, or `undefined` while the answer isn't in yet or the server can't be reached (draw the default look then too: it never throws), and `BackRoomOwned.onChange(fn)` calls `fn(uids)` when answers arrive so the game can redraw those players. `active()` is true once `PAYMENTS.enabled` is on; until then nothing is sold and games needn't check. Answers are batched (24 uids a request) and kept 60 seconds, so a game adds one small request a minute at most. The uid is the player's Firebase uid (the one games already put in their room data); a player not signed in with Google owns nothing on the server, so they are drawn with the default look once a game checks. No game uses it yet. - **Setup checklist for the owners (nothing here works until this is done).** 1. Cloudflare (Workers & Pages → the site → Settings → Variables and secrets), names only, values never in the repo: `STRIPE_SECRET_KEY` (start with the test key `sk_test_…`), `STRIPE_WEBHOOK_SECRET` (`whsec_…` from step 3), `FIREBASE_SERVICE_ACCOUNT` (the whole JSON key of a service account of project rumblekarts that can write Firestore). The item shop already uses these three; nothing new is needed if they are set. 2. Stripe, in test mode first: on each of the six emerald prices set the lookup key `emeralds_7`, `emeralds_39`, `emeralds_80`, `emeralds_180`, `emeralds_1000`, `emeralds_4000` (one-time prices in USD of exactly $0.99, $4.99, $9.99, $19.99, $49.99, $99.99; any other amount is refused). 3. Stripe → Developers → Webhooks: an endpoint `https://ascoding11.com/api/stripe-webhook` with the events `checkout.session.completed`, `checkout.session.async_payment_succeeded`, `charge.refunded`, `charge.dispute.created` and `charge.dispute.closed` (the item shop's endpoint, if it exists, already is this: tick the three `charge.` events on it; without them refunds and chargebacks don't take emeralds back); its signing secret is `STRIPE_WEBHOOK_SECRET`. Only this one endpoint, in the mode of the key in Cloudflare: don't tick "Listen to events on Connected accounts" for it. Payment Links (the six test ones) credit nobody: archive them, and refund any payment that shows up in Firestore `orders` as `unclaimed`. 3b. Firebase → Firestore → Rules: confirm, without changing anything else, that no rule lets a browser read or write `wallets`, `ledger`, `orders` or `entitlements`; the server writes with the service account, which skips the rules, so the minimal rules are `match /wallets/{id} { allow read, write: if false; }` and the same four lines for `ledger/{id}`, `orders/{id}` and `entitlements/{id}`, and there must be NO wide rule such as `match /{document=**} { allow read, write: if … }` or a test-mode `request.time < …` rule (Firestore allows a request when ANY rule allows it, so a wide rule opens these too: a player could then write their own balance). 3c. Cloudflare (optional, recommended): Security → WAF → Rate limiting rules, one rule for paths starting `/api/` (for example 60 requests per 10 seconds per IP, block for 10 seconds); the server's own limits are per player and per instance, and this one covers floods before they reach Firestore. 4. Check it worked: signed in with Google as a captain, open `https://ascoding11.com/e63334287a3deaa3/shop/`; the preview bar and the "Test mode" tag show, and the balance shows "∞". Buy the Emerald Handful with Stripe's test card 4242 4242 4242 4242; you come back to the shop, which says "Added 7 emeralds"; in Firebase's Firestore console `wallets/` has `balance` 119 and a `ledger` row, and `orders/` says `credited`; in Stripe the webhook delivery shows 200. Open a chest and send a gift to the other owner (who must have opened the shop once): their `wallets` document shows the item and a notice. 5. To go live: swap both Stripe values in Cloudflare together for the live key and the live webhook's secret (with the same lookup keys on the live prices; while only one is swapped every payment is recorded `unclaimed` with reason `mode` and credits nobody), set `PAYMENTS.enabled: true` in `wallet.js`, run `node e63334287a3deaa3/shop/tools/server-data.js`, and commit `wallet.js` and `functions/_catalog.js` together. -- `e63334287a3deaa3/miles.js`: status tiers, "miles with us" (Back Room). Every player is **Economy**, **Business Class**, **First Class** or **Private Jet**, except the site's two owners, who are always **Captain** (see below), shown as a small pill next to their name in the Online panel, the Party panel, the Leaderboards and the admin page (loaded in the same four places as `avatar.js`). `window.BackRoomMiles = {of(node, uid, now), tierOf(miles), isOwner(uid), badge(result, {miles}), line(result), peek(uid), load(uid), fmt, TIERS, RULES, CAPTAIN, OWNERS, setTops(tops), topOf(uid), needTops(), awardsOf(result), aceOf(result), crackerOf(result), AWARDS, AWARD_KINDS}`. `of` takes a leaderboard node (`rooms/lb-all/players/`, raw or already parsed by `leaderboard.js`), checks it with `BackRoomBoards.parse` (the same caps and ranges the boards use, so a stale, oversized or impossible node is simply Economy with `ok: false`, and nothing it contains is ever shown as HTML) and gives `{miles, tier, next: {tier, miles} or null at the top, hours, play, bonus, ok}`. **The formula:** 100 miles per hour played (the hours the boards accept: at most 24 a day since 21 October 2026, all games together) plus points for success in each game, each kind capped so no single game carries someone (the table is `RULES` in the file): running counts, wins 40 each in Rumble Karts, Backrooms and Boostball (cap 4,000), kills 2 in Shell Crackers and Backrooms (2,000), wrecks 2 (2,000), goals 10 (2,000), Coil cut-offs 5 (2,000), Chromaflage hiders found 10 (2,000) and rounds hidden 20 (2,000), Odd One Out props found 5 (2,000) and rounds won 20 (2,000), Tumble Trials crowns 50 (4,000) and shows 5 (1,000), Spire towers 20 (2,000), Trivium streak 30 a day (1,500), Showdown hands 2 (1,000), Gridpop lines 2 (1,000), Stackfall lines 5 (1,000), watermelons 50 (1,500), Puffer Party online wins 20 (2,000) and answers 1 (1,000), daily puzzles finished (the Daily Puzzles page's `done`) 5 (2,000) and its best daily streak 10 a day (1,000); personal bests, Elo above 1,200 at 4 a point (3,000 at 1,950 Elo), fastest Spire tower under 10 minutes at 3 a second (1,500 at 100 s), fastest obby under an hour at 0.4 a second (1,200 at 10 min), fastest Updraft summit under an hour at 0.5 a second (1,500 at 10 min), Updraft height ÷ 2 (500 at the summit), a Slipstream lap within 2.5× the track's quickest possible lap up to 200 a track (2,000 for all tracks) and 100 a course record held (1,000), a 2048 tile of 2048 (500), 4096 (1,000) or 8192 and up (1,500) and best score ÷ 100 (500), Gridpop score ÷ 50 (1,000), Stackfall Classic and Sand scores ÷ 200 (1,000 each), Melon Merge score ÷ 10 (1,500), Coil's longest snake ÷ 10 (1,500), Trivium's best Daily ÷ 10 (1,500) and Showdown's biggest pot ÷ 200 (500). **Tiers:** Economy under 2,000, Business Class 2,000–9,999, First Class 10,000–39,999, Private Jet 40,000 and up. So an hour a day for three weeks is Business Class; First Class takes about 100 hours, or 50 with a lot of winning (a 1,950 Elo, 100 kart wins and an 8192 tile are 8,500 on their own); Private Jet is a year of play. **Captain:** a tier above Private Jet for the site's owners, Nico and Arjun, listed by account uid in `OWNERS` near the top of `miles.js` (Nico's two accounts and Arjun's three, each with a comment saying whose it is; add or delete a line to change it, and never match on names, since anyone can type any name). An owner's `of` result has `tier` Captain, `next: null`, `owner: true` and `real`, the tier their miles alone would earn; their `miles` are worked out exactly like everyone else's, so the admin page's Miles column shows and sorts by their real miles (with the Captain badge beside it), and nobody else's tier or the maths changes. The badge is pilot's wings in gold on a near-black navy pill with a gold rim (`.bra-tier-captain`), and on an owner's own Online card the progress line is "12,345 miles · flies the plane" instead of "N to " (`line(result)`). **Arjun (site founder):** one step above Captain, for Arjun alone (the site is his): Captain flies the plane, the founder built the airline. The tier is named Arjun, with a bow for its icon (Arjuna, the archer of the Mahabharata). His three accounts are in `FOUNDER_LIST` just under `OWNERS` (each must also stay in `OWNERS`, so `captains.js` and everything else a Captain gets is unchanged; only the badge differs). The badge is a gold drawn bow with an arrow nocked and pale-gold "Arjun" on a violet storm with a gold rim and a purple glow, with a flash of light sweeping across it every few seconds (`.bra-tier-founder`; still for anyone with reduced motion turned on), the same size as every other pill; the tooltip says "Arjun · site founder" and his Online card's line is "12,345 miles · site founder". `of` gives `tier` `FOUNDER` (named Arjun) with `owner: true` and `founder: true`; `isFounder(uid)` and `FOUNDER` are exported. **Every badge:** a **Badges** button in the Online panel's header, beside Cabin chat (`social.js`; on a phone the panel's buttons share their own row under the title), and another beside Refresh at the top of the Leaderboards (everywhere `leaderboard.js` draws them: the Back Room, the phone page, Slipstream and the admin page) open `BackRoomMiles.guide()`, a window listing every badge there is and how to get it: the four miles tiers, the crew (Vice Captain, Captain, Arjun), the Miles board's #1–#3 tags, and every award in `AWARD_KINDS` (the given ones, then the earned Slipstream ace and Top Cracker). Its words never state hours (players see no hours anywhere but the admin page): miles "come from time spent playing", Business Class is "a few weeks of regular play" and First Class "a lot of play, or about half as much with a lot of winning". Each is drawn by the same code as the real badges, so a new tier style or a new line in `AWARD_KINDS` shows up there by itself; it names no holders and reads nothing. The Leaderboards' button stays hidden until `miles.js` has loaded; the Online panel's does nothing on a page without it. This is a display rule, not a security feature: tiers are worked out in each viewer's browser from public data, so it only decides how pages draw the badge and grants nothing. The score rules were tuned against the live boards a week after they began (85 accounts: 77 Economy, 7 Business, 1 First under the first draft, several Business with under an hour of play because one good Stackfall or Coil sitting hit a cap), so a single sitting of a puzzle game is now worth a few hundred miles at most. Worked examples: 10 h of Coil + 100 cut-offs + an 8,000-long snake = 1,000 + 500 + 800 = 2,300 (Business); 50 h of Shell Crackers + Elo 1,950 + 3,000 kills = 5,000 + 3,000 (the cap) + 2,000 (the cap) = 10,000 (First Class exactly). For people online, `peek(uid)` gives the cached result (and starts a read when there is none or it is over 10 minutes old) and `load(uid)` a promise of it: one read of `rooms/lb-all/players/` per uid through `party.js`'s sign-in; a finished read fires `backroom:miles` on `document` (`detail.uid`), and so does the file when it loads. The Leaderboards and the admin page already hold every parsed node, so they call `of` directly. **Everything behind a tier is self-reported** by the player's own browser (see `stats.js`), so tiers are for fun, like the boards; nothing here writes to the database, and `stats.js`'s node format is unchanged. On the Leaderboards (`leaderboard.js`), rows show the player's avatar and tier badge (the tier worked out from the same checked node, so a node the boards would skip can't earn one) on a second line under the name, and the first board, **Miles**, ranks everyone by these miles (All time, the same number as the badge) or by miles from this week's play time (This week: `HOUR`, exported as `BackRoomMiles.HOUR`, per hour since Monday; bests and counts have no date, so they stay in All time). The badge always shows the all-time tier, on the weekly board too. **#1, #2, #3 tags:** the top three on the Miles board get a small squared tag after their tier pill, "#1 all time", "#2 all time", "#3 all time" and the same for this week (one player can hold one of each; the tooltip says "Ranked #2 in miles, all time"), everywhere the badge is drawn: Leaderboards rows, the Online panel (cards, your own row, an open chat's header), the Party panel and the admin page. All-time tags are solid gold, silver and bronze; this week's are the same three metals as text and rim on slate, so a week's medal reads as a step below an all-time one. The places are the board's own ranks, so after a tie for first nobody is second and the next player is third. `setTops` takes `all2`, `all3`, `week2`, `week3` beside `all` and `week`, and `topOf(uid).all` / `.week` are the place (1 to 3, or 0); an answer saved in `lb:tops` by a page from before this has only the firsts. It all happens inside `badge()`, so no panel works out ranks: for a leader `badge()` returns a `` holding the usual pill and the tags (`.bra-top-all`, `.bra-top-week`), for everyone else the plain pill exactly as before (`of` results now carry `uid`, which is how the badge knows whose it is). Who is first comes from `leaderboard.js`, not from here: after every read of the boards it calls `setTops({all: [uid…], week: [uid…], allTie, weekTie})` with the uids its own rows rank 1 (`BackRoomBoards.tops`), so the tag uses the same checked nodes, the same week and the same tie rule as the board and always agrees with it. **A tie for first gives every tied player the tag** (the board shows rank 1 beside each of them; the tooltip adds "tied for first"), an account shown as one row with the leader (merged) is tagged too, nobody on This week means no weekly tag, and a node the boards skip or an account the admin removed can never be first. No reads per row and no writes: the answer is kept in memory and in this browser's localStorage (`lb:tops`, with the time), shared by every Back Room page and tab (a `storage` event passes it on). When a badge is drawn and the answer is over 15 minutes old (`TOPS_TTL`), miles.js asks the boards to read once (`BackRoomBoards.readTops()`, the same single read of `rooms/lb-all/players` plus `rooms/lb-rs/players` the Leaderboards section makes anyway, about 330 KB in November 2026; the section then reuses it for 5 minutes instead of reading again when scrolled to), at most once a minute and never in a tab nobody is looking at; an answer over an hour old (`TOPS_KEEP`) isn't shown. So the cost is at most one board read per browser per 15 minutes while a badge is on screen, where before only people who scrolled to the Leaderboards read it; raise `TOPS_TTL` to make it cheaper. A change of who is first fires `backroom:miles` with `detail.tops`, so panels redraw. The words are dropped to just "#1" where the row hasn't room (a phone row, a narrow party card): once the badge is on the page `fit()` checks whether the pill is being squeezed and adds `bra-tw-s`, again on resize; tags are never taller than the pill, so rows keep their height. With no connection, an empty board or a leader who isn't on the page, nothing shows and nothing breaks. The admin page hands over its own answer from the nodes it has read (`BackRoomBoards.topsOf(nodes, now)`, which reads them as the public boards do, without removed or merged accounts). **Merged accounts:** when the admin page has merged accounts into one person (a signed `a`), a badge loaded for any of them (`load`, for the Online and Party panels) reads the signed merges (at most once per 10 minutes) and the other accounts' nodes, and shows the miles of the merged person (leaderboard.js `collapse`), so the hours and counts each account earned are added back. **Awards:** an honour the owners give to a particular player, shown as a small medal on a ribbon after the tier pill and any #1 tags, everywhere the badge is drawn (it is added inside `badge()`, like the tags, so no panel knows about it; an award holder's badge is the same `bra-tw` wrapper with a `` at the end). It is not a tier or a rank and has nothing to do with miles: a round medal with the award's mark, and its name on a swallow-tailed ribbon in the game's own colours, so it can't be taken for a tier pill or a gold, silver or bronze tag. The first is **Updraft devotee** (tooltip "Awarded for dedication to Updraft"; a summit with a rising arrow in Updraft's night navy, sky blue and sunrise orange), held by Morgan, who was first on the Miles board all time when it was given (November 2026), with the most Updraft play time on the boards and the only climb to the Crown. The second is **Boostball star** (tooltip "Awarded for dedication to Boostball"; the ball with a boost flame in Boostball's navy, blue and orange), given to Nico at Nico's own request (November 2026) and listed for both of Nico's accounts. Two tables near the top of `miles.js`: `AWARD_KINDS`, one line per kind of award (`n` the words, `tip` the tooltip, `icon` the mark as SVG in a 16 × 16 box, `disc` and `rim` the medal's colours, `band` and `ink` the ribbon's), and `AWARDS`, who holds which: one line per person, `'': ['updraft']`, with a comment saying whose it is and why. **To give someone an award, add their line to `AWARDS`; to take it away, delete the line; a new kind of award is one more line in `AWARD_KINDS`.** Anyone with an account can hold one, whatever their tier and even with no node on the boards, and one person can hold several (they are drawn in the order listed). The uid is the key of the player's leaderboard node (the admin page shows it; never match on names, since anyone can type any name). Accounts the Leaderboards show as one row share the award, so it shows whichever of them is on screen: `awardsOf(result)` looks at the accounts in the result (`ids`: its own, and the entry it was merged into) and at the admin page's signed merges once `leaderboard.js` has read them, so list any one of the person's accounts, ideally the one the board shows; a node that only claims to be merged with a holder gets nothing. Nothing is read, written or stored for an award: the table is in the code, so it changes with a pull request. Where the row hasn't room the ribbon folds away to just its medal (`bra-tw-a`, before the tags lose their words), and also wherever its words would make a row that wraps taller (your own Online row on a laptop), so rows keep their height; the tooltip still names it. **One award is earned, not given: the Slipstream ace.** It belongs to whoever leads the most Slipstream tracks, and only while they lead 3 or more at once (`ACE_MIN`); leading a track means holding its fastest lap this record season, the driver the Leaderboards' every-track board names for it. Course records and clean laps don't count (a track has one of each for every race length, so one driver could reach three on a single track, and every record needs a lap time there anyway). If nobody leads three, nobody holds it; on a tie for most, everyone tied holds it, as with the #1 tags; accounts the boards show as one row count as one driver, and removed or skipped nodes never count. It changes hands as records fall: nobody edits a table. It is the same medal on a ribbon, in Slipstream's near-black and racing red with a chequered flag, labelled "Slipstream ace", tooltip "Leads 4 Slipstream tracks" with the live number, drawn last in the badge: after the tier pill, the place tags and any award that was given. Its kind is in `AWARD_KINDS` with `earned: true`, which also means a line for it in `AWARDS` is ignored. Like the #1 tags it is worked out in `leaderboard.js` (`ace()`), from the same read, and comes over in the same answer: `setTops` takes `ace` (the holders' uids, with their merged accounts) and `aceN` (the tracks they lead), kept in `lb:tops` with the rest, so it costs no read and no write, every page and tab shares it, and it updates whenever the boards are read (a new holder or number fires `backroom:miles` with `detail.tops`). `aceOf(result or uid)` is the number of tracks for a holder, else 0. An answer saved by a page from before it has no `ace`, so nobody holds it until the boards are next read; fewer than three tracks or anything malformed is dropped. **The second earned award is Top Cracker**, for the best Shell Crackers player: whoever has the most Shell Crackers kills of all time on the Leaderboards (the `kills` stat of Shell Crackers' row in `leaderboard.js`'s `GAMES`, the Kills (all time) board's own checked rows, so merged accounts count as one player with their kills added as the board adds them, and removed or skipped nodes never count), and only with 25 kills or more (`CRACK_MIN`), so it isn't handed out for a handful; on a tie for most, everyone tied holds it. It is worked out and carried exactly like the ace: `leaderboard.js`'s `cracker()` from the same read, `setTops` takes `crack` (the holders' uids, with their merged accounts) and `crackN` (their kills) in the same `lb:tops` answer (part of the change check, so a new holder or count redraws the badges), `crackerOf(result or uid)` gives the holder's kills, else 0, and an answer from a page from before it (no `crack`), under 25 or malformed means nobody holds it. Its kind is `shellcrackers` in `AWARD_KINDS` (`earned: true`): a cracked white egg with a yolk drop on Shell Crackers' ink-brown disc with a yolk rim, and "Top Cracker" in brown on an eggshell-cream ribbon with a thin brown edge (`edge`, an optional line round a pale ribbon, so it still shows on a cream row in light mode, while staying clear of the gold tags and the First Class pill); tooltip "Most Shell Crackers kills: 1,520" with the live number. It is drawn after the ace, so a badge goes tier, place tags, given awards, Slipstream ace, Top Cracker. When one player has place tags, a given award and the earned awards together, room is made in this order: both ribbons fold to their medals (`bra-tw-a`), then the tags lose their words and each medal after the first tucks under the one before (`bra-tw-s`; checked with a given award, both earned awards and two place tags in one phone row), then, only if under half the tier's name would still show (a phone row), the pill keeps just its icon and colours (`bra-tw-p`); nothing in a badge is taller than the pill, so rows never change height. +- `e63334287a3deaa3/miles.js`: status tiers, "miles with us" (Back Room). Every player is **Economy**, **Business Class**, **First Class** or **Private Jet**, except the site's two owners, who are always **Captain** (see below), shown as a small pill next to their name in the Online panel, the Party panel, the Leaderboards and the admin page (loaded in the same four places as `avatar.js`). `window.BackRoomMiles = {of(node, uid, now), tierOf(miles), isOwner(uid), badge(result, {miles}), line(result), peek(uid), load(uid), fmt, TIERS, RULES, CAPTAIN, OWNERS, setTops(tops), topOf(uid), needTops(), awardsOf(result), aceOf(result), crackerOf(result), minisOf(result), minisList(result), miniTag(id, px), MINI, MINI_ANY, AWARDS, AWARD_KINDS}`. `of` takes a leaderboard node (`rooms/lb-all/players/`, raw or already parsed by `leaderboard.js`), checks it with `BackRoomBoards.parse` (the same caps and ranges the boards use, so a stale, oversized or impossible node is simply Economy with `ok: false`, and nothing it contains is ever shown as HTML) and gives `{miles, tier, next: {tier, miles} or null at the top, hours, play, bonus, ok}`. **The formula:** 100 miles per hour played (the hours the boards accept: at most 24 a day since 21 October 2026, all games together) plus points for success in each game, each kind capped so no single game carries someone (the table is `RULES` in the file): running counts, wins 40 each in Rumble Karts, Backrooms and Boostball (cap 4,000), kills 2 in Shell Crackers and Backrooms (2,000), wrecks 2 (2,000), goals 10 (2,000), Coil cut-offs 5 (2,000), Chromaflage hiders found 10 (2,000) and rounds hidden 20 (2,000), Odd One Out props found 5 (2,000) and rounds won 20 (2,000), Tumble Trials crowns 50 (4,000) and shows 5 (1,000), Spire towers 20 (2,000), Trivium streak 30 a day (1,500), Showdown hands 2 (1,000), Gridpop lines 2 (1,000), Stackfall lines 5 (1,000), watermelons 50 (1,500), Puffer Party online wins 20 (2,000) and answers 1 (1,000), daily puzzles finished (the Daily Puzzles page's `done`) 5 (2,000) and its best daily streak 10 a day (1,000); personal bests, Elo above 1,200 at 4 a point (3,000 at 1,950 Elo), fastest Spire tower under 10 minutes at 3 a second (1,500 at 100 s), fastest obby under an hour at 0.4 a second (1,200 at 10 min), fastest Updraft summit under an hour at 0.5 a second (1,500 at 10 min), Updraft height ÷ 2 (500 at the summit), a Slipstream lap within 2.5× the track's quickest possible lap up to 200 a track (2,000 for all tracks) and 100 a course record held (1,000), a 2048 tile of 2048 (500), 4096 (1,000) or 8192 and up (1,500) and best score ÷ 100 (500), Gridpop score ÷ 50 (1,000), Stackfall Classic and Sand scores ÷ 200 (1,000 each), Melon Merge score ÷ 10 (1,500), Coil's longest snake ÷ 10 (1,500), Trivium's best Daily ÷ 10 (1,500) and Showdown's biggest pot ÷ 200 (500). **Tiers:** Economy under 2,000, Business Class 2,000–9,999, First Class 10,000–39,999, Private Jet 40,000 and up. So an hour a day for three weeks is Business Class; First Class takes about 100 hours, or 50 with a lot of winning (a 1,950 Elo, 100 kart wins and an 8192 tile are 8,500 on their own); Private Jet is a year of play. **Captain:** a tier above Private Jet for the site's owners, Nico and Arjun, listed by account uid in `OWNERS` near the top of `miles.js` (Nico's two accounts and Arjun's three, each with a comment saying whose it is; add or delete a line to change it, and never match on names, since anyone can type any name). An owner's `of` result has `tier` Captain, `next: null`, `owner: true` and `real`, the tier their miles alone would earn; their `miles` are worked out exactly like everyone else's, so the admin page's Miles column shows and sorts by their real miles (with the Captain badge beside it), and nobody else's tier or the maths changes. The badge is pilot's wings in gold on a near-black navy pill with a gold rim (`.bra-tier-captain`), and on an owner's own Online card the progress line is "12,345 miles · flies the plane" instead of "N to " (`line(result)`). **Arjun (site founder):** one step above Captain, for Arjun alone (the site is his): Captain flies the plane, the founder built the airline. The tier is named Arjun, with a bow for its icon (Arjuna, the archer of the Mahabharata). His three accounts are in `FOUNDER_LIST` just under `OWNERS` (each must also stay in `OWNERS`, so `captains.js` and everything else a Captain gets is unchanged; only the badge differs). The badge is a gold drawn bow with an arrow nocked and pale-gold "Arjun" on a violet storm with a gold rim and a purple glow, with a flash of light sweeping across it every few seconds (`.bra-tier-founder`; still for anyone with reduced motion turned on), the same size as every other pill; the tooltip says "Arjun · site founder" and his Online card's line is "12,345 miles · site founder". `of` gives `tier` `FOUNDER` (named Arjun) with `owner: true` and `founder: true`; `isFounder(uid)` and `FOUNDER` are exported. **Every badge:** a **Badges** button in the Online panel's header, beside Cabin chat (`social.js`; on a phone the panel's buttons share their own row under the title), and another beside Refresh at the top of the Leaderboards (everywhere `leaderboard.js` draws them: the Back Room, the phone page, Slipstream and the admin page) open `BackRoomMiles.guide()`, a window listing every badge there is and how to get it: the four miles tiers, the crew (Vice Captain, Captain, Arjun), the Miles board's #1–#3 tags, and every award in `AWARD_KINDS` (the given ones, then the earned Slipstream ace and Top Cracker). Its words never state hours (players see no hours anywhere but the admin page): miles "come from time spent playing", Business Class is "a few weeks of regular play" and First Class "a lot of play, or about half as much with a lot of winning". Each is drawn by the same code as the real badges, so a new tier style or a new line in `AWARD_KINDS` shows up there by itself; it names no holders and reads nothing. The Leaderboards' button stays hidden until `miles.js` has loaded; the Online panel's does nothing on a page without it. This is a display rule, not a security feature: tiers are worked out in each viewer's browser from public data, so it only decides how pages draw the badge and grants nothing. The score rules were tuned against the live boards a week after they began (85 accounts: 77 Economy, 7 Business, 1 First under the first draft, several Business with under an hour of play because one good Stackfall or Coil sitting hit a cap), so a single sitting of a puzzle game is now worth a few hundred miles at most. Worked examples: 10 h of Coil + 100 cut-offs + an 8,000-long snake = 1,000 + 500 + 800 = 2,300 (Business); 50 h of Shell Crackers + Elo 1,950 + 3,000 kills = 5,000 + 3,000 (the cap) + 2,000 (the cap) = 10,000 (First Class exactly). For people online, `peek(uid)` gives the cached result (and starts a read when there is none or it is over 10 minutes old) and `load(uid)` a promise of it: one read of `rooms/lb-all/players/` per uid through `party.js`'s sign-in; a finished read fires `backroom:miles` on `document` (`detail.uid`), and so does the file when it loads. The Leaderboards and the admin page already hold every parsed node, so they call `of` directly. **Everything behind a tier is self-reported** by the player's own browser (see `stats.js`), so tiers are for fun, like the boards; nothing here writes to the database, and `stats.js`'s node format is unchanged. On the Leaderboards (`leaderboard.js`), rows show the player's avatar and tier badge (the tier worked out from the same checked node, so a node the boards would skip can't earn one) on a second line under the name, and the first board, **Miles**, ranks everyone by these miles (All time, the same number as the badge) or by miles from this week's play time (This week: `HOUR`, exported as `BackRoomMiles.HOUR`, per hour since Monday; bests and counts have no date, so they stay in All time). The badge always shows the all-time tier, on the weekly board too. **#1, #2, #3 tags:** the top three on the Miles board get a small squared tag after their tier pill, "#1 all time", "#2 all time", "#3 all time" and the same for this week (one player can hold one of each; the tooltip says "Ranked #2 in miles, all time"), everywhere the badge is drawn: Leaderboards rows, the Online panel (cards, your own row, an open chat's header), the Party panel and the admin page. All-time tags are solid gold, silver and bronze; this week's are the same three metals as text and rim on slate, so a week's medal reads as a step below an all-time one. The places are the board's own ranks, so after a tie for first nobody is second and the next player is third. `setTops` takes `all2`, `all3`, `week2`, `week3` beside `all` and `week`, and `topOf(uid).all` / `.week` are the place (1 to 3, or 0); an answer saved in `lb:tops` by a page from before this has only the firsts. It all happens inside `badge()`, so no panel works out ranks: for a leader `badge()` returns a `` holding the usual pill and the tags (`.bra-top-all`, `.bra-top-week`), for everyone else the plain pill exactly as before (`of` results now carry `uid`, which is how the badge knows whose it is). Who is first comes from `leaderboard.js`, not from here: after every read of the boards it calls `setTops({all: [uid…], week: [uid…], allTie, weekTie})` with the uids its own rows rank 1 (`BackRoomBoards.tops`), so the tag uses the same checked nodes, the same week and the same tie rule as the board and always agrees with it. **A tie for first gives every tied player the tag** (the board shows rank 1 beside each of them; the tooltip adds "tied for first"), an account shown as one row with the leader (merged) is tagged too, nobody on This week means no weekly tag, and a node the boards skip or an account the admin removed can never be first. No reads per row and no writes: the answer is kept in memory and in this browser's localStorage (`lb:tops`, with the time), shared by every Back Room page and tab (a `storage` event passes it on). When a badge is drawn and the answer is over 15 minutes old (`TOPS_TTL`), miles.js asks the boards to read once (`BackRoomBoards.readTops()`, the same single read of `rooms/lb-all/players` plus `rooms/lb-rs/players` the Leaderboards section makes anyway, about 330 KB in November 2026; the section then reuses it for 5 minutes instead of reading again when scrolled to), at most once a minute and never in a tab nobody is looking at; an answer over an hour old (`TOPS_KEEP`) isn't shown. So the cost is at most one board read per browser per 15 minutes while a badge is on screen, where before only people who scrolled to the Leaderboards read it; raise `TOPS_TTL` to make it cheaper. A change of who is first fires `backroom:miles` with `detail.tops`, so panels redraw. The words are dropped to just "#1" where the row hasn't room (a phone row, a narrow party card): once the badge is on the page `fit()` checks whether the pill is being squeezed and adds `bra-tw-s`, again on resize; tags are never taller than the pill, so rows keep their height. With no connection, an empty board or a leader who isn't on the page, nothing shows and nothing breaks. The admin page hands over its own answer from the nodes it has read (`BackRoomBoards.topsOf(nodes, now)`, which reads them as the public boards do, without removed or merged accounts). **Merged accounts:** when the admin page has merged accounts into one person (a signed `a`), a badge loaded for any of them (`load`, for the Online and Party panels) reads the signed merges (at most once per 10 minutes) and the other accounts' nodes, and shows the miles of the merged person (leaderboard.js `collapse`), so the hours and counts each account earned are added back. **Awards:** an honour the owners give to a particular player, shown as a small medal on a ribbon after the tier pill and any #1 tags, everywhere the badge is drawn (it is added inside `badge()`, like the tags, so no panel knows about it; an award holder's badge is the same `bra-tw` wrapper with a `` at the end). It is not a tier or a rank and has nothing to do with miles: a round medal with the award's mark, and its name on a swallow-tailed ribbon in the game's own colours, so it can't be taken for a tier pill or a gold, silver or bronze tag. The first is **Updraft devotee** (tooltip "Awarded for dedication to Updraft"; a summit with a rising arrow in Updraft's night navy, sky blue and sunrise orange), held by Morgan, who was first on the Miles board all time when it was given (November 2026), with the most Updraft play time on the boards and the only climb to the Crown. The second is **Boostball star** (tooltip "Awarded for dedication to Boostball"; the ball with a boost flame in Boostball's navy, blue and orange), given to Nico at Nico's own request (November 2026) and listed for both of Nico's accounts. Two tables near the top of `miles.js`: `AWARD_KINDS`, one line per kind of award (`n` the words, `tip` the tooltip, `icon` the mark as SVG in a 16 × 16 box, `disc` and `rim` the medal's colours, `band` and `ink` the ribbon's), and `AWARDS`, who holds which: one line per person, `'': ['updraft']`, with a comment saying whose it is and why. **To give someone an award, add their line to `AWARDS`; to take it away, delete the line; a new kind of award is one more line in `AWARD_KINDS`.** Anyone with an account can hold one, whatever their tier and even with no node on the boards, and one person can hold several (they are drawn in the order listed). The uid is the key of the player's leaderboard node (the admin page shows it; never match on names, since anyone can type any name). Accounts the Leaderboards show as one row share the award, so it shows whichever of them is on screen: `awardsOf(result)` looks at the accounts in the result (`ids`: its own, and the entry it was merged into) and at the admin page's signed merges once `leaderboard.js` has read them, so list any one of the person's accounts, ideally the one the board shows; a node that only claims to be merged with a holder gets nothing. Nothing is read, written or stored for an award: the table is in the code, so it changes with a pull request. Where the row hasn't room the ribbon folds away to just its medal (`bra-tw-a`, before the tags lose their words), and also wherever its words would make a row that wraps taller (your own Online row on a laptop), so rows keep their height; the tooltip still names it. **One award is earned, not given: the Slipstream ace.** It belongs to whoever leads the most Slipstream tracks, and only while they lead 3 or more at once (`ACE_MIN`); leading a track means holding its fastest lap this record season, the driver the Leaderboards' every-track board names for it. Course records and clean laps don't count (a track has one of each for every race length, so one driver could reach three on a single track, and every record needs a lap time there anyway). If nobody leads three, nobody holds it; on a tie for most, everyone tied holds it, as with the #1 tags; accounts the boards show as one row count as one driver, and removed or skipped nodes never count. It changes hands as records fall: nobody edits a table. It is the same medal on a ribbon, in Slipstream's near-black and racing red with a chequered flag, labelled "Slipstream ace", tooltip "Leads 4 Slipstream tracks" with the live number, drawn last in the badge: after the tier pill, the place tags and any award that was given. Its kind is in `AWARD_KINDS` with `earned: true`, which also means a line for it in `AWARDS` is ignored. Like the #1 tags it is worked out in `leaderboard.js` (`ace()`), from the same read, and comes over in the same answer: `setTops` takes `ace` (the holders' uids, with their merged accounts) and `aceN` (the tracks they lead), kept in `lb:tops` with the rest, so it costs no read and no write, every page and tab shares it, and it updates whenever the boards are read (a new holder or number fires `backroom:miles` with `detail.tops`). `aceOf(result or uid)` is the number of tracks for a holder, else 0. An answer saved by a page from before it has no `ace`, so nobody holds it until the boards are next read; fewer than three tracks or anything malformed is dropped. **The second earned award is Top Cracker**, for the best Shell Crackers player: whoever has the most Shell Crackers kills of all time on the Leaderboards (the `kills` stat of Shell Crackers' row in `leaderboard.js`'s `GAMES`, the Kills (all time) board's own checked rows, so merged accounts count as one player with their kills added as the board adds them, and removed or skipped nodes never count), and only with 25 kills or more (`CRACK_MIN`), so it isn't handed out for a handful; on a tie for most, everyone tied holds it. It is worked out and carried exactly like the ace: `leaderboard.js`'s `cracker()` from the same read, `setTops` takes `crack` (the holders' uids, with their merged accounts) and `crackN` (their kills) in the same `lb:tops` answer (part of the change check, so a new holder or count redraws the badges), `crackerOf(result or uid)` gives the holder's kills, else 0, and an answer from a page from before it (no `crack`), under 25 or malformed means nobody holds it. Its kind is `shellcrackers` in `AWARD_KINDS` (`earned: true`): a cracked white egg with a yolk drop on Shell Crackers' ink-brown disc with a yolk rim, and "Top Cracker" in brown on an eggshell-cream ribbon with a thin brown edge (`edge`, an optional line round a pale ribbon, so it still shows on a cream row in light mode, while staying clear of the gold tags and the First Class pill); tooltip "Most Shell Crackers kills: 1,520" with the live number. It is drawn after the ace, so a badge goes tier, place tags, given awards, Slipstream ace, Top Cracker. When one player has place tags, a given award and the earned awards together, room is made in this order: both ribbons fold to their medals (`bra-tw-a`), then the tags lose their words and each medal after the first tucks under the one before (`bra-tw-s`; checked with a given award, both earned awards and two place tags in one phone row), then, only if under half the tier's name would still show (a phone row), the pill keeps just its icon and colours (`bra-tw-p`); nothing in a badge is taller than the pill, so rows never change height. **Top player in a game (mini badges):** whoever is first on a game's main board holds that game's mini badge, a 16 px shield drawn last in the badge, after the tier pill, the place tags, the given awards, the Slipstream ace and Top Cracker (nothing before it moves or changes: a test renders every entry of `AWARDS` and `AWARD_KINDS` against the copy from before and gets the same HTML). One player can hold several, one per game they lead, in the boards' order. Every game on the Leaderboards has one except Shell Crackers and Slipstream, whose badges are Top Cracker and the Slipstream ace; Stackfall has two, Classic and Sand. Which board is a game's main board, its floor and its tie rules are `leaderboard.js`'s (`topBoards`, below); nobody is listed here and no uid is stored in the code: `leaderboard.js` works the holders out after every read of the boards and hands them over in the same answer as the #1 tags (`setTops` takes `mini`, `[[board id, [uid…]], …]`, the holders with their merged accounts, at most 12 uids a game and 120 games; kept in `lb:tops` with the rest and part of its change check), so they cost no read and no write and move whenever the boards are read. An answer saved by a page from before them has no `mini`: nobody holds one until the boards are next read; a malformed entry, bad board id or bad uid is dropped. `minisOf(result or uid)` gives the board ids a player leads (merged accounts count as one player, as for awards). The words come from the game's name in `GAMES` (`n`), so a renamed game takes its badge with it: tooltip and accessible label "Top player in Stackfall (Sand)" (`BackRoomBoards.topName`). **The look:** `MINI` near the top of `miles.js`, one line per board id (the game's folder, or `stackfall:sand`): `c` the shield's colour and `e` a simple mark that hints at the game, SVG in a 16 × 16 box (two or three shapes, light on the shield's colour; no image files, no real logos). Every shield shares one frame (a dark outline and a pale inner rim), so they read as one family on light and dark pages and can't be taken for a tier pill, a square place tag or an award's round medal. A game with no line in `MINI` (a new game) gets `MINI_ANY`, a white star on slate, so it still has a badge; give it its own line when you can. **Room:** the shields sit in one line; where the row has no room they fold from the end into a "+N" chip (tooltip "Also top player in: …"), down to one shield and the chip, before anything else folds; after the tags lose their words the last shield goes too (just "+N"), before the tier's name; on a row that wraps (your own Online row) only as many show as keep it to its height. Wider places (a Leaderboards row on a computer) simply show more. An open chat's header in the Online panel (`social.js`) also lists them larger, 22 px with each game's name beside it (`minisList`), on a line of its own. The badges window (`guide()`) has a **Top player in a game** section: the rule in one line (lead a game's main board, its Elo or its best score, time or streak) and every game's shield, from `leaderboard.js`'s own list. Spanish: "Mejor jugador en …"; game names stay in English. - `e63334287a3deaa3/avismiles.js`: Avis miles (Back Room page and phone page): players who booked a car through Avis claim bonus miles. Opened from the **Avis miles** button the Online panel shows by your miles (social.js), `BackRoomAvisMiles.open()` or a link with `#avis-miles`. Only for a Google sign-in whose account already has a leaderboard node. The form takes the Avis confirmation number, the pick-up date and an optional note, sealed to the admin key (`adminkey.js`'s `BackRoomSeal` of `{ k: 'ac', c, d, n, u: uid, t }`) and written to the player's own node as `ac` (the box) and `act` (when it was sent); `stats.js` carries both on in every write. One claim at a time: a new one replaces one still waiting. The admin page's Stats tab lists claims newer than the last one decided (**Avis miles claims**), opens them with the admin key (with the player's Google email from `ge`), and approves (adding `AVIS_MILES`, 1,000 by default, or another amount) or turns them down in its signed resets: `m` the Avis miles granted in all, `mt` the claim time last decided, `mr` 1 approved / 0 not (leaderboard.js `checkResets` keeps them; every signed write on the admin page carries them on). leaderboard.js hands `m` to miles.js as `p.am` (added up across merged accounts), which adds it to the person's miles everywhere. Nobody but the admin page can grant miles; the dialog shows the claim's state from `act`, `mt` and `mr`. - `e63334287a3deaa3/keybinds.js`: rebindable controls shared by the keyboard Back Room games (2048, Backrooms 1v1–4v4, Boostball, Coil, Escapade, Gridpop, Hail Mary, Kartwheel, Melon Merge, Odd One Out, Quarry, Rumble Karts, Shell Crackers, Slipstream, Spire, Stackfall, Starhop, Tumble Trials, Turbo Trail, Updraft, Driftfall, Asteroid Run, Rampline, Tidewick, Flickerwood, Beatvault). Plain JavaScript, no dependencies. Each game loads it with ``, lists its actions in `Keybinds.create({game, actions: [{id, label, keys: ['KeyW', 'ArrowUp']}]})` (keys are `e.code` names, so they're physical keys on any layout; mouse buttons are `Mouse0`/`Mouse1`/`Mouse2` in games that pass `mouse: true`), checks input with `KB.is(action, e.code)` and `KB.held(action, keys)` instead of comparing key codes, and opens the panel from a Controls button with `KB.open()`. Changed keys are saved only in the player's browser, under localStorage `keybinds:` as `{v: 1, b: {action: [codes]}}` (only the actions that differ from the defaults; Reset to defaults removes the entry), and never go to Firebase. Esc is never rebindable. Elements with `data-kb="action"` show the current keys and update themselves. The panel takes each game's look from `--kb-*` CSS variables and the game's own button classes; the comment at the top of the file lists the options. To add it to a game, do the same, and keep text inputs (names, room codes, chat) returning before any key lookup. Touch controls don't go through key codes: each game's touch buttons feed its input directly (in Shell Crackers, Quarry and Backrooms they hold actions by id in `tAct`, which the game checks alongside `KB.held`), so they keep working whatever keys are bound, and the Change keys / Controls buttons are hidden in the touch layout (`body.touch`). **Spanish** (lang.js, when the page loads it): keybinds.js adds the panel's own words and common key and action names once (guarded by `if (window.BackRoomLang)`), and builds its messages and aria-labels with the action and key names in the page's language (a game's own dictionary supplies its action names); in English, or without lang.js, every string is as before. - `e63334287a3deaa3/school.js`: Your school (Back Room page, the home page's copy of it and the phone page). A small box at the end of the page header where each player picks the school they go to: one button per school plus Not listed, as a radio group (click, or the arrow keys). The schools are Avenues (New York) and St. Andrew’s Scots School (`standrews`, Olivos, Buenos Aires, Argentina; a bilingual English–Spanish school, so lang.js's Spanish matters there); to add one, add a row to `SCHOOLS` (`id`, a short lowercase id that never changes, `name`, `place`). The script fills in every empty `[data-school]` element: the Back Room page has one at the end of its `
` (so the home page's `reveal()`, which copies the header, gets it too, and loads the script after `events.js`), and the phone page has one at the end of its header. Being in the header, layout.js never moves it. **Storage:** localStorage `school:v1`, the school's id (`avenues`) or `other` for Not listed; no key means nothing picked yet. It is in account-nudge.js's `KEYS`, so a Google account's save carries it to the player's other devices (visible to other signed-in browsers, like everything in that save). Nothing else is stored online. **Search and Add my school:** only schools marked `suggest: true` in `SCHOOLS` (Avenues) are shown before a search, plus the one the player picked; every other school is found by typing in the search box above the choices, which filters them as you type (name and place, accents ignored; Enter picks the first match). With no match, or from the dashed "Add my school" button, a small form asks for the school's name, its city or town and its country (only the general area; it says not to put a name or address) and sends one note through the suggestion box (`BackRoomFeedback.send` in feedback.js, the same sealed `feedback` documents, limits and admin Feedback tab, so no new storage or rules): "School request: (, ). Sent from Your school." The player's choice becomes Not listed, and localStorage `school:req` ({n, p, t}, also in account-nudge.js's KEYS) remembers what they asked for, so the box says "You asked us to add … We'll add it soon." To add a requested school, read it on the admin page's Feedback tab and add its row to `SCHOOLS`. Nothing uses the choice yet: other scripts can read it with `BackRoomSchool.get()` (the row, or null) and hear changes through the `backroom:school` event on `document` (`{id}`). @@ -232,7 +232,7 @@ Personal site hosted with GitHub Pages at **https://ascoding11.github.io**, the - `prompted/`: Prompted, a supplemental essay tracker for college applicants (plain JavaScript, no backend; everything is saved in the student's browser under `prompted:v1`). Students add schools with a plan and deadline, paste a supplement page to pull out each prompt with its word or character limit and whether it's optional (`parsePrompts` in the page), write drafts with a live count, save and restore versions, and start new essays from existing drafts. A reuse map groups similar prompts across schools by kind (Why us, academic interest, community, and so on). Backups download as JSON; all drafts download as one .txt. `prompted/schools.js` is the school library: the U.S. News 2027 top 50 national universities with their 2026–27 supplement prompts (as short summaries in our own words, with real limits), choose-N sets, college- or program-specific prompts keyed to the student's intended major, application plans and deadlines. UC campuses share one application, so they're added as a single school. Update the file each August when schools publish new prompts, and keep every prompt as a summary in your own words: don't paste schools' official prompt text into this repo, even though it's posted publicly. No ads on this page. - `e63334287a3deaa3/m/`: the phone version of the Back Room: every game (the Back Room ones plus Hype Cycle Exchange) as a tile, under the same six headings as the computer version, in the same play-time order (Cars, Shooters, Parkour, Party games, Puzzles, Arcade; `MODES`), with a row of six buttons above the lists that jump to each heading (`.gnav`), the Turkey Week switch under the title during the event (`data-turkey-switch` in the header's `.tkrow`; see `events.js`), and grouped by kind under each (each `GROUPS` row is `[kind, games, mode, 1 for the puzzle tiles]`, mode `'cars'`, `'shooters'`, `'parkour'`, `'partygames'`, `'puzzles'` or `'arcade'`, with the rows of one mode kept together; Hype Cycle Exchange is under Arcade). Puzzles starts with the small tiles (`.grid.pz`: what it is in plain words, then its name): Deepword, Trivium, the listed daily puzzles and, last, Daily Puzzles (the fifteen least played puzzles, Boxed among them, came off on 18 Nov 2026: see the Back Room page above; their thumbnails stay). The daily puzzles aren't counted as games; Deepword and Trivium are (a `1` at the end of their rows), and the Puzzles heading says "12 puzzles + 4 games". At the bottom of Puzzles, a small tab (`.ask.ask-sm`, `pzAsk`) asks "Miss a puzzle we took away, or want a new one?" with a Tell us button (`data-feedback-open="Puzzles: "`). The Daily Puzzles tile (`daily`, not counted, a whole row wide with `.pz-all` so the puzzle rows come out even) is the page with every listed puzzle and the streak; it opens in the frame like a game, and the daily games it links to open in the same frame (its `scope` is the whole Back Room folder). After the games, a "Want more games, or have an idea?" note has a Tell us button that opens the feedback bar. A game opens full screen in a frame under a thin bar with the way back, and the last one played shows at the top as Keep playing. The Leaderboards section (leaderboard.js) comes after the games. Its own look is dark; it also has a light look (the light variables at the top of its `