diff --git a/src/routes/wish/_monthlyGraph.svelte b/src/routes/wish/_monthlyGraph.svelte new file mode 100644 index 00000000..c015be59 --- /dev/null +++ b/src/routes/wish/_monthlyGraph.svelte @@ -0,0 +1,88 @@ + + +
+ +
diff --git a/src/routes/wish/_summary.svelte b/src/routes/wish/_summary.svelte index 11c2e40c..070470c5 100644 --- a/src/routes/wish/_summary.svelte +++ b/src/routes/wish/_summary.svelte @@ -2,6 +2,8 @@ import { t } from 'svelte-i18n'; import { onMount } from 'svelte'; + import dayjs from 'dayjs'; + import { characters } from '../../data/characters'; import { weaponList } from '../../data/weaponList'; @@ -11,6 +13,8 @@ let numberFormat = Intl.NumberFormat(); + export let monthlyData = {}; + const types = [ { name: 'Character Event', @@ -84,13 +88,27 @@ currentType = 'weapon'; } + const time = dayjs.unix(pull.time).format('YYYY-MM'); + if (monthlyData[time] === undefined) { + monthlyData[time] = { + total: 0, + legendary: 0, + rare: 0, + } + } + + monthlyData[time].total++; + if (rarity === 5) { legendary++; legendaryPity += pull.pity; + monthlyData[time].legendary++; + legendaryPulls.push({ name: itemName, pity: pull.pity }); } else if (rarity === 4) { rare++; rarePity += pull.pity; + monthlyData[time].rare++; if (currentType === 'character') { rareCharacter++; diff --git a/src/routes/wish/index.svelte b/src/routes/wish/index.svelte index 4b985651..4e7977c0 100644 --- a/src/routes/wish/index.svelte +++ b/src/routes/wish/index.svelte @@ -1,5 +1,5 @@