feat: display hint usage percentage in win screen

This commit is contained in:
2026-02-11 00:27:43 +01:00
parent be2ea75570
commit a9691446c3
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);
}

View File

@@ -46,7 +46,7 @@ const messages = {
'win.shareWhatsapp': 'WhatsApp',
'win.shareDownload': 'Pobierz zrzut',
'win.difficulty': 'Poziom:',
'win.usedGuide': 'Użyto podpowiedzi: {count}',
'win.usedGuide': 'Podpowiedzi: {percent}% ({count})',
'pwa.installTitle': 'Zainstaluj aplikację i graj offline',
'pwa.installMobile': 'Dodaj do ekranu głównego',
'pwa.installDesktop': 'Zainstaluj na komputerze',
@@ -153,7 +153,7 @@ const messages = {
'win.shareWhatsapp': 'WhatsApp',
'win.shareDownload': 'Download screenshot',
'win.difficulty': 'Difficulty:',
'win.usedGuide': 'Guide used: {count}',
'win.usedGuide': 'Hints: {percent}% ({count})',
'pwa.installTitle': 'Install the app and play offline',
'pwa.installMobile': 'Add to home screen',
'pwa.installDesktop': 'Install on desktop',