From 66b5f8f920ff1db31fdf81c661f6a4d7d2cdc303 Mon Sep 17 00:00:00 2001 From: Andrei Andreev Date: Sat, 11 Dec 2021 22:22:46 +0300 Subject: [PATCH] Vuefy and I'm not going to cleanup SliderComponent now thank you --- .eslintignore | 1 + .../celestials/subtabs/enslaved-tab.js | 7 +- .../components/common/plus-minus-button.js | 33 --- .../reality/black-hole/black-hole-tab.js | 9 +- .../glyphs/glyph-levels-and-weights.js | 13 +- .../glyphs/sidebar/glyph-filter-panel.js | 7 +- src/components/PlusMinusButton.vue | 41 +++ .../components/SliderComponent.vue | 258 +++++++++--------- 8 files changed, 196 insertions(+), 173 deletions(-) delete mode 100644 javascripts/components/common/plus-minus-button.js create mode 100644 src/components/PlusMinusButton.vue rename javascripts/components/common/ad-slider-component.js => src/components/SliderComponent.vue (87%) diff --git a/.eslintignore b/.eslintignore index a02034da8..f16b43a68 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ public/**/*.js +src/components/SliderComponent.vue diff --git a/javascripts/components/celestials/subtabs/enslaved-tab.js b/javascripts/components/celestials/subtabs/enslaved-tab.js index 2cf764110..af80b043c 100644 --- a/javascripts/components/celestials/subtabs/enslaved-tab.js +++ b/javascripts/components/celestials/subtabs/enslaved-tab.js @@ -1,7 +1,7 @@ import "../celestial-quote-history.js"; -import "../../common/ad-slider-component.js"; import PrimaryButton from "@/components/PrimaryButton"; import PrimaryToggleButton from "@/components/PrimaryToggleButton"; +import SliderComponent from "@/components/SliderComponent"; Vue.component("modal-enslaved-hints", { data() { @@ -140,7 +140,8 @@ Vue.component("modal-enslaved-hints", { Vue.component("enslaved-tab", { components: { PrimaryButton, - PrimaryToggleButton + PrimaryToggleButton, + SliderComponent }, data: () => ({ isStoringBlackHole: false, @@ -388,7 +389,7 @@ Vue.component("enslaved-tab", {
Black Hole charging rate: {{ storedTimeRate }}

- -
-
` -}); diff --git a/javascripts/components/reality/black-hole/black-hole-tab.js b/javascripts/components/reality/black-hole/black-hole-tab.js index abcd9a8f3..a126392c3 100644 --- a/javascripts/components/reality/black-hole/black-hole-tab.js +++ b/javascripts/components/reality/black-hole/black-hole-tab.js @@ -1,10 +1,13 @@ import "./black-hole-unlock-button.js"; import "./black-hole-upgrade-row.js"; import "./black-hole-state-row.js"; -import "../../common/ad-slider-component.js"; import { BlackHoleAnimation } from "./black-hole-animation.js"; +import SliderComponent from "@/components/SliderComponent"; Vue.component("black-hole-tab", { + components: { + SliderComponent + }, data() { return { isUnlocked: false, @@ -223,7 +226,7 @@ Vue.component("black-hole-tab", {
Black Hole charging rate: {{ storedTimeRate }} - Inverted Black Hole divides game speed by {{ format(negativeBHDivisor, 2, 2) }}. This requires both Black Holes to be permanent and only works when paused. -
-
-
-
- - - +export default { + props: { + type: { + type: String, + required: true + }, + size: { + type: String, + required: true + } + }, + data() { + return { + color: "white", + computedSize: 0, + }; + }, + computed: { + iconClass() { + return `fas fa-${this.type}`; + } + }, + mounted() { + this.color = getComputedStyle(this.$el).color; + this.computedSize = this.$el.offsetWidth; + } +}; + + + + diff --git a/javascripts/components/common/ad-slider-component.js b/src/components/SliderComponent.vue similarity index 87% rename from javascripts/components/common/ad-slider-component.js rename to src/components/SliderComponent.vue index 92ed24e93..bff48a641 100644 --- a/javascripts/components/common/ad-slider-component.js +++ b/src/components/SliderComponent.vue @@ -1,4 +1,5 @@ -import "./plus-minus-button.js"; + + +