From a9691446c35cce15866f5d9a7740e76c82e45411 Mon Sep 17 00:00:00 2001 From: Grzegorz Kucmierz Date: Wed, 11 Feb 2026 00:27:43 +0100 Subject: [PATCH] feat: display hint usage percentage in win screen --- src/components/WinModal.vue | 6 +++++- src/composables/useI18n.js | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/WinModal.vue b/src/components/WinModal.vue index a3943ee..d0b69ca 100644 --- a/src/components/WinModal.vue +++ b/src/components/WinModal.vue @@ -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); } diff --git a/src/composables/useI18n.js b/src/composables/useI18n.js index 20bc44f..7636e80 100644 --- a/src/composables/useI18n.js +++ b/src/composables/useI18n.js @@ -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',