diff --git a/src/locales/en.json b/src/locales/en.json index 40682bc0..5a19ac50 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -132,6 +132,7 @@ "calculator": { "titleWeapon": "Weapon Calculator", "titleCharacter": "Character Calculator", + "titleResin": "Resin Calculator", "goto": "Go To", "howToUse": "How to Use", "guide": { @@ -184,6 +185,13 @@ "items": "Items", "wasted": "Wasted Exp", "mora": "Mora Cost" + }, + "resin": { + "inputCurrentResin": "Input Current Resin...", + "timeFormat": "en", + "calculate": "Calculate", + "currentTime": "Current Time", + "fullTime": "Your Resin Will Replenished After" } }, "items": { diff --git a/src/locales/id.json b/src/locales/id.json index 342101eb..8312dbd4 100644 --- a/src/locales/id.json +++ b/src/locales/id.json @@ -132,6 +132,7 @@ "calculator": { "titleWeapon": "Kalulator Senjata", "titleCharacter": "Kalkulator Karakter", + "titleResin": "Kalkulator Resin", "goto": "Ke", "howToUse": "Cara Penggunaan", "guide": { @@ -184,6 +185,13 @@ "items": "Items", "wasted": "Exp Terbuang", "mora": "Jumlah Mora" + }, + "resin": { + "inputCurrentResin": "Masukkan Jumlah Resin Sekarang...", + "timeFormat": "id", + "calculate": "Hitung", + "currentTime": "Waktu Sekarang", + "fullTime": "Resin Akan Penuh Pada" } }, "items": { diff --git a/src/routes/calculator/_resin.svelte b/src/routes/calculator/_resin.svelte new file mode 100644 index 00000000..64951e2d --- /dev/null +++ b/src/routes/calculator/_resin.svelte @@ -0,0 +1,68 @@ + + +
+
+ +
+ +

+ {$t('calculator.resin.currentTime')}: {new Intl.DateTimeFormat( + $t('calculator.resin.timeFormat'), + dateTimeOptions, + ).format($time)} +

+ {#if fullTime} +

+ {$t('calculator.resin.fullTime')} : {new Intl.DateTimeFormat( + $t('calculator.resin.timeFormat'), + dateTimeOptions, + ).format(fullTime)} +

+ {/if} +
+
+ +
+
+
diff --git a/src/routes/calculator/index.svelte b/src/routes/calculator/index.svelte index 3fe9ad0e..be55f08f 100644 --- a/src/routes/calculator/index.svelte +++ b/src/routes/calculator/index.svelte @@ -7,6 +7,7 @@ import WeaponCalculator from './_weapon.svelte'; import CharacterCalculator from './_character.svelte'; import LevelUpTable from './_characterTable.svelte'; + import ResinCalculator from './_resin.svelte'; import Button from '../../components/Button.svelte'; import Icon from '../../components/Icon.svelte'; import HowToModal from '../../components/CalculatorHowToModal.svelte'; @@ -91,5 +92,12 @@
+

+ {$t('calculator.titleResin')} +

+ +
diff --git a/src/stores/time.js b/src/stores/time.js new file mode 100644 index 00000000..c131bcec --- /dev/null +++ b/src/stores/time.js @@ -0,0 +1,11 @@ +import { readable } from 'svelte/store'; + +export const time = readable(new Date(), function start(set) { + const interval = setInterval(() => { + set(new Date()); + }, 1000); + + return function stop() { + clearInterval(interval); + }; +});