diff --git a/components/InfinityTester.vue b/components/InfinityTester.vue index 5451d64..856b766 100644 --- a/components/InfinityTester.vue +++ b/components/InfinityTester.vue @@ -1,50 +1,64 @@ - add {{ addIncrement }} - add to the adding - big value = {{ bigvalue }} + add {{addIncrement}} + {{mulIncrement}}x addition per step + 10x more multiplication per step + Tick automatically - + diff --git a/components/TabNav.vue b/components/TabNav.vue index 477ee2a..148c288 100644 --- a/components/TabNav.vue +++ b/components/TabNav.vue @@ -1,5 +1,7 @@ + Energy: {{ $store.state.incremental.currency.energy }} + Time: {{ timecurrency }} diff --git a/package.json b/package.json index 7a503e0..31e5171 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "dependencies": { "@nuxtjs/axios": "^5.13.6", "@nuxtjs/pwa": "^3.3.5", + "break_infinity.js": "^2.0.0", "core-js": "^3.19.3", "nuxt": "^2.15.8", "vue": "^2.6.14", diff --git a/store/incremental.js b/store/incremental.js new file mode 100644 index 0000000..3b1915c --- /dev/null +++ b/store/incremental.js @@ -0,0 +1,24 @@ +import Decimal from "break_infinity.js" + +export const state = () => ({ + currency: { + energy: new Decimal(0), + // if it hasn't been your + days: new Decimal(0), + weeks: new Decimal(0), + months: new Decimal(0), + // or even your + years: new Decimal(0) + } +}) + +export const mutations = { + add(state, { key, value }) { + state.currency[key] = Decimal.add(state.currency[key], value) + }, + + set(state, { key, value }) { + state.currency[key] = value + } +} + diff --git a/yarn.lock b/yarn.lock index b8dd4f7..4b93f93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2283,6 +2283,13 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" +break_infinity.js@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/break_infinity.js/-/break_infinity.js-2.0.0.tgz#3c7b0a4eff54b2ee16829a9c8233eb63d806b5dd" + integrity sha512-/7fy8+rA12V57DMPSWA90mBs4xPxHKpj79w/oBXTqyQS07oIHsWaB62pO43C/GRUkteVokhJ+G+UD8+OhHaz5g== + dependencies: + pad-end "^1.0.2" + brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -6483,6 +6490,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +pad-end@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pad-end/-/pad-end-1.0.2.tgz#6b41a42fdb7effa55858bb77dade52eee388e6cc" + integrity sha1-a0GkL9t+/6VYWLt32t5S7uOI5sw= + pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"