From 310afa3c5cc0c0e4378c9bf8c8cf121588349304 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Wed, 7 Apr 2021 20:13:31 +0800 Subject: [PATCH] Update wish tally with total user and median --- src/locales/en.json | 6 ++- src/locales/id.json | 6 ++- src/locales/ru.json | 2 +- src/routes/_index/banner.svelte | 6 +-- src/routes/wish/tally/_item.svelte | 64 ++++++++++++++++-------------- 5 files changed, 46 insertions(+), 38 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 60126a77..1432e0f6 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -21,7 +21,7 @@ "summoned": "Summoned", "percentage": "from all", "avg": "Pity average", - "subtitle": "Calculated from data submitted by paimon.moe users", + "subtitle": "Calculated from data submitted by {user} paimon.moe users", "detail": "Global With Tally" }, "wish": { @@ -263,7 +263,9 @@ "weapon": "Weapons", "character": "Characters", "error": "Data is not available yet 😞", - "pity": "Pity" + "pity": "Pity", + "median": "5★ Median", + "user": "Total Users" } }, "calculator": { diff --git a/src/locales/id.json b/src/locales/id.json index ea437dbd..08e47b3d 100644 --- a/src/locales/id.json +++ b/src/locales/id.json @@ -21,7 +21,7 @@ "summoned": "Pulang", "percentage": "dari semua", "avg": "Pity rata-rata", - "subtitle": "Dihitung dari data yang dikirim oleh pengguna paimon.moe", + "subtitle": "Dihitung dari data yang dikirim oleh {user} pengguna paimon.moe", "detail": "Perhitungan Wish Pity Global" }, "wish": { @@ -262,7 +262,9 @@ "weapon": "Senjata", "character": "Karakter", "error": "Data belum tersedia 😞", - "pity": "Pity" + "pity": "Pity", + "median": "5★ Median", + "user": "Total User" } }, "calculator": { diff --git a/src/locales/ru.json b/src/locales/ru.json index 377091c3..74b0452f 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -21,7 +21,7 @@ "summoned": "Призывов", "percentage": "из всех", "avg": "Среднее число молитв", - "subtitle": "Рассчитано по информации от пользователей paimon.moe", + "subtitle": "Рассчитано по информации от {user} пользователей paimon.moe", "detail": "Глобальная статистика молитв" }, "wish": { diff --git a/src/routes/_index/banner.svelte b/src/routes/_index/banner.svelte index da5b2b20..263001d0 100644 --- a/src/routes/_index/banner.svelte +++ b/src/routes/_index/banner.svelte @@ -30,6 +30,7 @@ const image = 'childerosaria.png'; let loading = true; + let user = ''; async function getData() { const url = new URL(`${__paimon.env.API_HOST}/wish`); @@ -44,6 +45,7 @@ const data = await res.json(); + user = data.total.users; for (const e of data.list) { if (featured[e.name]) { featured[e.name].count = e.count; @@ -52,8 +54,6 @@ } } - console.log(featured); - loading = false; } catch (err) { console.error(err); @@ -103,7 +103,7 @@

{$t('home.banner.avg')} {item.average}

{/each} -

※ {$t('home.banner.subtitle')}

+

※ {$t('home.banner.subtitle', { values: { user }})}

+
- {banner.name} + {banner.name} +
{#if loading} {:else if !error} @@ -373,17 +370,19 @@ {/each} +

+ {$t('wish.tally.update')} + {updateTime} +

{/if} {/if}
{#if !loading && !error} -
+
- + @@ -417,12 +416,10 @@ {/each}
5 {$t('wish.tally.pity')}5★ {$t('wish.tally.pity')} {$t('wish.tally.total')}
-
+
- + @@ -452,13 +449,13 @@ {/each}
4 {$t('wish.tally.pity')}4★ {$t('wish.tally.pity')} {$t('wish.tally.total')}
-