commitshow 0.3.21 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/render.js +174 -6
- package/package.json +1 -1
package/dist/lib/render.js
CHANGED
|
@@ -223,6 +223,175 @@ function bigText(text) {
|
|
|
223
223
|
}
|
|
224
224
|
return rows;
|
|
225
225
|
}
|
|
226
|
+
// XL digit font · 12×12 chunky pixel art for the trophy big-score. Only
|
|
227
|
+
// uses `█` and ` ` so horizontal scaling stays clean (ANSI Shadow's
|
|
228
|
+
// box-drawing chars don't tile when doubled — `╔╔` reads as garbage).
|
|
229
|
+
// Designed proportionally (≈ 1:1.3 visual ratio because terminal cells
|
|
230
|
+
// are ~2:1 H:W) so a 2-digit score reads as "scaled up", not
|
|
231
|
+
// "elongated". Used by bigTextXL · NOT by bigText (which still does
|
|
232
|
+
// ANSI Shadow for any future banner use).
|
|
233
|
+
const XL_ROWS = 12;
|
|
234
|
+
const BIG_DIGITS_XL = {
|
|
235
|
+
"0": [
|
|
236
|
+
" ████████ ",
|
|
237
|
+
" ██ ██ ",
|
|
238
|
+
"██ ██",
|
|
239
|
+
"██ ██",
|
|
240
|
+
"██ ██",
|
|
241
|
+
"██ ██",
|
|
242
|
+
"██ ██",
|
|
243
|
+
"██ ██",
|
|
244
|
+
"██ ██",
|
|
245
|
+
"██ ██",
|
|
246
|
+
" ██ ██ ",
|
|
247
|
+
" ████████ ",
|
|
248
|
+
],
|
|
249
|
+
"1": [
|
|
250
|
+
" ██ ",
|
|
251
|
+
" ███ ",
|
|
252
|
+
" ████ ",
|
|
253
|
+
" ██ ",
|
|
254
|
+
" ██ ",
|
|
255
|
+
" ██ ",
|
|
256
|
+
" ██ ",
|
|
257
|
+
" ██ ",
|
|
258
|
+
" ██ ",
|
|
259
|
+
" ██ ",
|
|
260
|
+
" ██ ",
|
|
261
|
+
"████████████",
|
|
262
|
+
],
|
|
263
|
+
"2": [
|
|
264
|
+
" ████████ ",
|
|
265
|
+
"██ ██",
|
|
266
|
+
" ██",
|
|
267
|
+
" ██ ",
|
|
268
|
+
" ██ ",
|
|
269
|
+
" ██ ",
|
|
270
|
+
" ██ ",
|
|
271
|
+
" ██ ",
|
|
272
|
+
" ██ ",
|
|
273
|
+
" ██ ",
|
|
274
|
+
"██ ",
|
|
275
|
+
"████████████",
|
|
276
|
+
],
|
|
277
|
+
"3": [
|
|
278
|
+
" ████████ ",
|
|
279
|
+
"██ ██",
|
|
280
|
+
" ██",
|
|
281
|
+
" ██",
|
|
282
|
+
" ██",
|
|
283
|
+
" ████████ ",
|
|
284
|
+
" ██",
|
|
285
|
+
" ██",
|
|
286
|
+
" ██",
|
|
287
|
+
" ██",
|
|
288
|
+
"██ ██",
|
|
289
|
+
" ████████ ",
|
|
290
|
+
],
|
|
291
|
+
"4": [
|
|
292
|
+
"██ ██",
|
|
293
|
+
"██ ██",
|
|
294
|
+
"██ ██",
|
|
295
|
+
"██ ██",
|
|
296
|
+
"██ ██",
|
|
297
|
+
"██ ██",
|
|
298
|
+
"████████████",
|
|
299
|
+
" ██",
|
|
300
|
+
" ██",
|
|
301
|
+
" ██",
|
|
302
|
+
" ██",
|
|
303
|
+
" ██",
|
|
304
|
+
],
|
|
305
|
+
"5": [
|
|
306
|
+
"████████████",
|
|
307
|
+
"██ ",
|
|
308
|
+
"██ ",
|
|
309
|
+
"██ ",
|
|
310
|
+
"██ ",
|
|
311
|
+
"███████████ ",
|
|
312
|
+
" ██",
|
|
313
|
+
" ██",
|
|
314
|
+
" ██",
|
|
315
|
+
" ██",
|
|
316
|
+
"██ ██",
|
|
317
|
+
" ████████ ",
|
|
318
|
+
],
|
|
319
|
+
"6": [
|
|
320
|
+
" ████████ ",
|
|
321
|
+
"██ ██",
|
|
322
|
+
"██ ",
|
|
323
|
+
"██ ",
|
|
324
|
+
"██ ",
|
|
325
|
+
"███████████ ",
|
|
326
|
+
"██ ██",
|
|
327
|
+
"██ ██",
|
|
328
|
+
"██ ██",
|
|
329
|
+
"██ ██",
|
|
330
|
+
"██ ██",
|
|
331
|
+
" ████████ ",
|
|
332
|
+
],
|
|
333
|
+
"7": [
|
|
334
|
+
"████████████",
|
|
335
|
+
"████████████",
|
|
336
|
+
" ██",
|
|
337
|
+
" ██",
|
|
338
|
+
" ██ ",
|
|
339
|
+
" ██ ",
|
|
340
|
+
" ██ ",
|
|
341
|
+
" ██ ",
|
|
342
|
+
" ██ ",
|
|
343
|
+
" ██ ",
|
|
344
|
+
" ██ ",
|
|
345
|
+
" ██ ",
|
|
346
|
+
],
|
|
347
|
+
"8": [
|
|
348
|
+
" ████████ ",
|
|
349
|
+
"██ ██",
|
|
350
|
+
"██ ██",
|
|
351
|
+
"██ ██",
|
|
352
|
+
"██ ██",
|
|
353
|
+
" ████████ ",
|
|
354
|
+
"██ ██",
|
|
355
|
+
"██ ██",
|
|
356
|
+
"██ ██",
|
|
357
|
+
"██ ██",
|
|
358
|
+
"██ ██",
|
|
359
|
+
" ████████ ",
|
|
360
|
+
],
|
|
361
|
+
"9": [
|
|
362
|
+
" ████████ ",
|
|
363
|
+
"██ ██",
|
|
364
|
+
"██ ██",
|
|
365
|
+
"██ ██",
|
|
366
|
+
"██ ██",
|
|
367
|
+
" ███████████",
|
|
368
|
+
" ██",
|
|
369
|
+
" ██",
|
|
370
|
+
" ██",
|
|
371
|
+
" ██",
|
|
372
|
+
"██ ██",
|
|
373
|
+
" ████████ ",
|
|
374
|
+
],
|
|
375
|
+
" ": [
|
|
376
|
+
" ", " ", " ", " ", " ", " ",
|
|
377
|
+
" ", " ", " ", " ", " ", " ",
|
|
378
|
+
],
|
|
379
|
+
};
|
|
380
|
+
/** XL render · 12-row chunky pixel art, used by the trophy. 1-space
|
|
381
|
+
* gutter between glyphs, no leading/trailing pad (each glyph already
|
|
382
|
+
* carries internal whitespace). */
|
|
383
|
+
function bigTextXL(text) {
|
|
384
|
+
const rows = Array.from({ length: XL_ROWS }, () => '');
|
|
385
|
+
const GAP = ' ';
|
|
386
|
+
for (let i = 0; i < text.length; i++) {
|
|
387
|
+
const ch = text[i];
|
|
388
|
+
const glyph = BIG_DIGITS_XL[ch] ?? BIG_DIGITS_XL[' '];
|
|
389
|
+
for (let r = 0; r < XL_ROWS; r++) {
|
|
390
|
+
rows[r] += glyph[r] + (i < text.length - 1 ? GAP : '');
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return rows;
|
|
394
|
+
}
|
|
226
395
|
/** Visible (rune) length — counts Unicode code points so the centering math
|
|
227
396
|
* treats `█` and `╔` as one column each, matching how monospace terminals
|
|
228
397
|
* render the ANSI Shadow font. */
|
|
@@ -456,12 +625,11 @@ export function renderAudit(view) {
|
|
|
456
625
|
// showing project identity, score, and brand mark in one frame.
|
|
457
626
|
const band = total >= 75 ? 'strong' : total >= 50 ? 'mid' : 'weak';
|
|
458
627
|
const bandTone = scoreTone(total);
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
const bigRows = bigText(String(total)).flatMap(r => [r, r]);
|
|
628
|
+
// 12×12 chunky pixel-art digits via bigTextXL · scales BOTH width and
|
|
629
|
+
// height (vs. row-doubling alone, which made the score read as
|
|
630
|
+
// elongated rather than enlarged). Pure block characters tile cleanly
|
|
631
|
+
// when concatenated — no ANSI Shadow box-drawing artifacts.
|
|
632
|
+
const bigRows = bigTextXL(String(total));
|
|
465
633
|
const bigWidth = bigRows[0].length;
|
|
466
634
|
// Trophy: name strip + big digits + caption inside one ╔═╗ frame so a
|
|
467
635
|
// crop of just the trophy tells the whole story (project · score · band).
|