feat: display hint usage percentage in win screen

This commit is contained in:
2026-02-11 00:27:43 +01:00
parent 41a36768cd
commit ca3193d07e
2 changed files with 7 additions and 3 deletions

View File

@@ -175,7 +175,11 @@ const buildShareCanvas = () => {
if (store.guideUsageCount > 0) {
ctx.fillStyle = '#ff4d4d';
ctx.font = '600 14px "Segoe UI", sans-serif';
const guideText = t('win.usedGuide', { count: store.guideUsageCount });
const totalCells = store.size * store.size;
const percent = Math.min(100, Math.round((store.guideUsageCount / totalCells) * 100));
const guideText = t('win.usedGuide', { count: store.guideUsageCount, percent });
ctx.fillText(`⚠️ ${guideText}`, padding, height - padding - footerHeight + 10);
}