diff --git a/.eslintrc.json b/.eslintrc.json index 7143771f5..b80c8fa3c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -33,11 +33,11 @@ } ], - "vue/one-component-per-file": "off", - "vue/component-definition-name-casing": "off", - "vue/order-in-components": "off", - "vue/require-prop-type-constructor": "off", - "vue/require-default-prop": "off", + "vue/one-component-per-file": "error", + "vue/component-definition-name-casing": "warn", + "vue/order-in-components": "warn", + "vue/require-prop-type-constructor": "warn", + "vue/require-default-prop": "warn", "vue/html-comment-content-newline": "warn", "vue/html-comment-content-spacing": "warn", "vue/html-comment-indent": "warn", diff --git a/javascripts/core/app/ui.js b/javascripts/core/app/ui.js index 79e0cf04c..3f91e3a69 100644 --- a/javascripts/core/app/ui.js +++ b/javascripts/core/app/ui.js @@ -11,6 +11,30 @@ Vue.mixin({ return state.view; } }, + created() { + if (this.update) { + this.on$(GAME_EVENT.UPDATE, this.update); + if (GameUI.initialized) { + this.update(); + } + } + + // Following is used to force the recomputation of computed values + // from this fiddle https://codepen.io/sirlancelot/pen/JBeXeV + const recomputed = Object.create(null); + const watchers = this._computedWatchers; + + if (!watchers) return; + + for (const key in watchers) + makeRecomputable(watchers[key], key, recomputed); + + this.$recompute = key => recomputed[key] = !recomputed[key]; + Vue.observable(recomputed); + }, + destroyed() { + EventHub.ui.offAll(this); + }, methods: { emitClick() { this.$emit("click"); @@ -48,30 +72,6 @@ Vue.mixin({ pluralize, quantify, quantifyInt - }, - created() { - if (this.update) { - this.on$(GAME_EVENT.UPDATE, this.update); - if (GameUI.initialized) { - this.update(); - } - } - - // Following is used to force the recomputation of computed values - // from this fiddle https://codepen.io/sirlancelot/pen/JBeXeV - const recomputed = Object.create(null); - const watchers = this._computedWatchers; - - if (!watchers) return; - - for (const key in watchers) - makeRecomputable(watchers[key], key, recomputed); - - this.$recompute = key => recomputed[key] = !recomputed[key]; - Vue.observable(recomputed); - }, - destroyed() { - EventHub.ui.offAll(this); } }); @@ -186,10 +186,10 @@ Vue.use(VueGtag, { export const ui = new Vue({ el: "#ui", - data: state, components: { GameUIComponent }, + data: state, computed: { notation() { return Notations.find(this.notationName); @@ -204,15 +204,6 @@ export const ui = new Vue({ return this.view.newUI; }, }, - methods: { - scroll(t) { - const now = Date.now(); - if (this.view.scrollWindow) { - window.scrollBy(0, this.view.scrollWindow * (now - t) / 2); - setTimeout(() => this.scroll(now), 20); - } - } - }, watch: { currentGlyphTooltip(newVal) { if (newVal !== -1 && !GameUI.globalClickListener) { @@ -233,5 +224,14 @@ export const ui = new Vue({ } }, }, + methods: { + scroll(t) { + const now = Date.now(); + if (this.view.scrollWindow) { + window.scrollBy(0, this.view.scrollWindow * (now - t) / 2); + setTimeout(() => this.scroll(now), 20); + } + } + }, template: "" }); diff --git a/public/index.html b/public/index.html index db5728d51..a87a647f4 100644 --- a/public/index.html +++ b/public/index.html @@ -14,7 +14,6 @@ - diff --git a/public/stylesheets/styles.css b/public/stylesheets/styles.css index 300217068..f9bc910a8 100644 --- a/public/stylesheets/styles.css +++ b/public/stylesheets/styles.css @@ -54,9 +54,6 @@ html { --color-v--base: #ead584; - --color-pelle--base: crimson; - --color-pelle-secondary: #00bcd4; - --color-ra-base: #9575cd; --color-ra-pet-teresa: #8596ea; --color-ra-pet-effarig: #ea8585; @@ -65,6 +62,9 @@ html { --color-laitela--base: white; --color-laitela--accent: black; + + --color-pelle--base: crimson; + --color-pelle-secondary: #00bcd4; } .t-metro #ui-container, /* csslint allow: empty-rules */ @@ -254,6 +254,17 @@ button:focus { /*#region TT shop*/ +.TTbuttons { + color: var(--color-text); + position: fixed; + bottom: 0; + font-family: Typewriter, serif; + display: flex; + align-items: flex-end; + z-index: 2; + width: 55.5rem; +} + .l-tt-buy-button { width: 17rem; z-index: 1; @@ -269,7 +280,7 @@ button:focus { font-size: 1.35rem; } -.s-base--metro .c-tt-buy-button { +.s-base--metro .c-tt-buy-button{ border-radius: 0; } @@ -293,6 +304,23 @@ button:focus { background: #652F2F; } +.timetheorems { + font-size: 15px; + text-align: center; + flex: 1 0 auto; +} + +.ttbuttons-row { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: stretch; +} + +.ttbuttons-top-row { + align-items: center; +} + .o-tt-top-row-button { min-height: 3rem; font-size: 1.2rem; @@ -407,6 +435,15 @@ button:focus { border: 0.1rem solid #3AACD6; } +.ttshop-container { + padding: 0 0.5rem; + min-width: 60rem; + max-width: 80rem; + display: flex; + flex-direction: column; + transition: all 0.25s ease-out; +} + .ttshop-minimize-btn { display: flex; justify-content: center; diff --git a/src/components/BlobBackground.vue b/src/components/BlobBackground.vue index 949b3f917..51e677b0d 100644 --- a/src/components/BlobBackground.vue +++ b/src/components/BlobBackground.vue @@ -2,7 +2,10 @@ export default { name: "BlobBackground", props: { - bounds: Object + bounds: { + type: Object, + required: true, + } }, mounted() { this.drop(); diff --git a/src/components/BlobSnowflake.vue b/src/components/BlobSnowflake.vue index d71826da9..dfa4363e4 100644 --- a/src/components/BlobSnowflake.vue +++ b/src/components/BlobSnowflake.vue @@ -4,7 +4,10 @@ import TWEEN from "tween.js"; export default { name: "BlobSnowflake", props: { - bounds: Object + bounds: { + type: Object, + required: true, + } }, mounted() { this.fly(); diff --git a/src/components/CostDisplay.vue b/src/components/CostDisplay.vue index 2ff8bf8ff..df9d0ad8f 100644 --- a/src/components/CostDisplay.vue +++ b/src/components/CostDisplay.vue @@ -1,5 +1,4 @@ - + - + {{ quantify("Time Theorem", theoremAmount, 2, 0, formatTimeTheoremType) }} @@ -146,9 +146,9 @@ export default { {{ quantifyInt("Space Theorem", STamount) }} - - - {{ saveLoadText }} + + + {{ saveLoadText }} - + Buy max @@ -196,7 +196,7 @@ export default { @@ -216,109 +216,15 @@ export default { \ No newline at end of file
+
{{ quantify("Time Theorem", theoremAmount, 2, 0, formatTimeTheoremType) }} @@ -146,9 +146,9 @@ export default { {{ quantifyInt("Space Theorem", STamount) }}