From dd96b2323bdbc30cb25beb1ee5e923ff5d12d18e Mon Sep 17 00:00:00 2001 From: fadhlu Date: Wed, 17 Mar 2021 01:57:40 +0700 Subject: [PATCH 1/6] add resin section --- src/locales/en.json | 8 ++++ src/locales/id.json | 8 ++++ src/routes/calculator/_resin.svelte | 68 +++++++++++++++++++++++++++++ src/routes/calculator/index.svelte | 8 ++++ src/stores/time.js | 11 +++++ 5 files changed, 103 insertions(+) create mode 100644 src/routes/calculator/_resin.svelte create mode 100644 src/stores/time.js 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); + }; +}); From cbf73f857fd38fe4e83779393b082da77d4bae65 Mon Sep 17 00:00:00 2001 From: fadhlu Date: Wed, 17 Mar 2021 02:25:50 +0700 Subject: [PATCH 2/6] Update result placement --- src/routes/calculator/_resin.svelte | 56 +++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/src/routes/calculator/_resin.svelte b/src/routes/calculator/_resin.svelte index 64951e2d..079c86e3 100644 --- a/src/routes/calculator/_resin.svelte +++ b/src/routes/calculator/_resin.svelte @@ -1,17 +1,29 @@ @@ -60,14 +67,15 @@
- +

@@ -76,14 +84,19 @@

- +

@@ -91,7 +104,15 @@

-
+
+

From 024608ecb73055255ca8821168402316f37dd3b6 Mon Sep 17 00:00:00 2001 From: fadhlu Date: Wed, 17 Mar 2021 13:05:28 +0700 Subject: [PATCH 6/6] Update grid layout --- src/locales/en.json | 2 +- src/routes/calculator/_resin.svelte | 34 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 5a19ac50..be7936da 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -191,7 +191,7 @@ "timeFormat": "en", "calculate": "Calculate", "currentTime": "Current Time", - "fullTime": "Your Resin Will Replenished After" + "fullTime": "Resin Will Be Replenished At" } }, "items": { diff --git a/src/routes/calculator/_resin.svelte b/src/routes/calculator/_resin.svelte index 079c86e3..fddf1bb3 100644 --- a/src/routes/calculator/_resin.svelte +++ b/src/routes/calculator/_resin.svelte @@ -1,15 +1,14 @@
-
+
-
+
-
- {#if fullTime} -
+
- {$t('calculator.resin.fullTime')}: {new Intl.DateTimeFormat( - $t('calculator.resin.timeFormat'), - dateTimeOptions, - ).format(fullTime)} + {new Intl.DateTimeFormat($t('calculator.resin.timeFormat'), dateTimeOptions).format(fullTime)} +