From e5235b69071e38443b073ce582c0ce8262394900 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 10 Jul 2020 01:13:16 +0200 Subject: [PATCH] =?UTF-8?q?Dodano=20list=C4=99=20wszystkich=20scenerii?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +- src/App.vue | 70 +++---- src/components/ui/List.vue | 192 +++++++++-------- src/components/ui/Options.vue | 37 +--- src/components/utils/ListFilter.vue | 314 +++++++++++++++------------- src/data/stations.json | 245 ++++++++++++---------- src/store/modules/store.ts | 79 +++++-- 7 files changed, 510 insertions(+), 432 deletions(-) diff --git a/package.json b/package.json index e434b8d..680439d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build" + "build": "vue-cli-service build", + "deploy": "npm run build && firebase deploy --only hosting" }, "dependencies": { "core-js": "^3.6.5", @@ -32,4 +33,4 @@ "last 2 versions", "not dead" ] -} +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 92c2132..1b438a1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@ @@ -53,9 +50,9 @@ export default Vue.extend({ }), methods: { - ...mapActions(["fetchStations"]), + ...mapActions(["initStations"]), getStationList() { - this.fetchStations() + this.initStations() .then(() => (this.connectionState = 2)) .catch(err => { this.connectionState = 1; @@ -70,16 +67,6 @@ export default Vue.extend({ mounted() { this.getStationList(); - - setInterval(this.getStationList, 5000); - - document.addEventListener("scroll", e => { - const appBarEl = this.$refs.appBar as Element; - - if (appBarEl.getBoundingClientRect().top < 0) - appBarEl.classList.add("sticky"); - else appBarEl.classList.remove("sticky"); - }); } }); @@ -125,7 +112,7 @@ input { box-sizing: border-box; } -button { +.button { display: flex; align-items: center; @@ -136,11 +123,17 @@ button { font-size: 0.9em; outline: none; - padding: 0.5em; + padding: 0.35em; cursor: pointer; transition: all 0.3s; + &.open { + color: $accentCol; + border: none; + font-weight: bold; + } + &:hover { background: rgba(#e0e0e0, 0.4); } @@ -169,11 +162,24 @@ ul { list-style: none; } +.flex { + display: flex; + align-items: center; + justify-content: center; + + &-spaced { + justify-content: space-between; + } + + &-column { + flex-direction: column; + } +} + .app { background: $bgCol; color: white; width: 100%; - overflow: hidden; &-container { @@ -186,11 +192,6 @@ ul { } &-header { - display: flex; - justify-content: center; - align-items: center; - - flex-direction: column; background: #333; padding: 0.4rem; @@ -208,29 +209,18 @@ ul { } &-bar { - display: flex; - align-items: center; - justify-content: space-between; - font-size: calc(0.8rem + 0.2vw); - position: sticky; + font-size: calc(0.8rem + 0.2vw); top: 0; - background: #222; } } + footer { background: #111; padding: 0.3rem; - color: white; - - display: flex; - justify-content: center; - align-items: center; - max-width: 100%; - font-size: calc(0.5rem + 0.5vw); } diff --git a/src/components/ui/List.vue b/src/components/ui/List.vue index fc86b4c..803e439 100644 --- a/src/components/ui/List.vue +++ b/src/components/ui/List.vue @@ -1,5 +1,5 @@