diff --git a/index.html b/index.html index af7ac27..7205f31 100644 --- a/index.html +++ b/index.html @@ -114,6 +114,19 @@ #msg .big { font-size: calc(27px * var(--s)); font-weight: 500; color: #fff; letter-spacing: .02em; } #msg .small { font-size: calc(12px * var(--s)); color: #a9b6cf; max-width: 72%; line-height: 1.5; } #msg .accent { color: var(--green); } + #msg .stats { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: 2px; } + #msg .strow { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; max-width: 80%; } + #msg .strow .lbl { font-size: calc(10px * var(--s)); color: #fff; opacity: .75; letter-spacing: .08em; text-transform: uppercase; } + #msg .stk { + display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; + font-size: calc(10.5px * var(--s)); color: var(--muted); + border: 1px solid var(--border-2); border-radius: 7px; background: rgba(255,255,255,.04); + } + #msg .stk b { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; } + #msg .stk i { + width: 13px; height: 13px; border-radius: 4px; font-style: normal; + font-size: 9px; line-height: 13px; text-align: center; color: #fff; + } #dims { font-variant-numeric: tabular-nums; color: var(--dim); } #foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: calc(11.5px * var(--s)); color: var(--muted); flex-wrap: nowrap; } @@ -284,6 +297,8 @@ var combo = 0, comboT = 0, shake = 0, shakeX = 0, shakeY = 0, levelTimer = 0; var CHECKPOINT_EVERY = 5, MAX_CONTINUES = 3, CONTINUE_TIME = 10, START_LIVES = 3; var continues = MAX_CONTINUES, checkpoint = 1, continueT = 0, ccUsed = 0, contTick = 0; + var stats = { blk: {}, down: 0, pu: {} }; + function resetStats() { stats = { blk: {}, down: 0, pu: {} }; } var sound = true, ac = null, fxSig = ''; var scores = []; @@ -300,6 +315,21 @@ if (!scores.length) return 'Noch keine Ergebnisse'; return scores.map(function (v, i) { return (i + 1) + '. ' + v.toLocaleString('de-DE') + ccMark(v); }).join(' · '); } + function statsHtml() { + var hps = Object.keys(stats.blk).map(Number).sort(function (a, b) { return a - b; }); + var chips = hps.map(function (k) { return '' + k + '×-Block ' + stats.blk[k] + ''; }); + chips.push('Blöcke zerstört ' + stats.down + ''); + var pc = []; + PU.forEach(function (p) { + if (!stats.pu[p.id]) return; + pc.push('' + p.icon + '' + + p.name + ' ' + stats.pu[p.id] + ''); + }); + if (!pc.length) pc.push('keine Power-ups'); + return '