From 3d9b766cc7535c0040b18221f4522c4db91bf014 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 21 Apr 2021 22:48:21 +0200 Subject: [PATCH] Poprawki wizualne i zachowania strony --- package.json | 2 +- src/App.vue | 2 +- src/components/Global/ActionButton.vue | 65 +++++ src/components/Global/SearchBox.vue | 66 +++++ src/components/Global/SelectBox.vue | 151 ++++++----- src/components/SceneryView/SceneryInfo.vue | 2 - src/components/StationsView/FilterCard.vue | 50 ++-- src/components/TrainsView/TrainOptions.vue | 293 +++++++-------------- src/components/TrainsView/TrainStats.vue | 20 +- src/lang/pl.json | 2 +- src/scripts/utils/storeUtils.ts | 123 +++++++++ src/styles/card.scss | 8 - src/styles/global.scss | 28 -- src/views/HistoryView.vue | 31 +-- src/views/StationsView.vue | 178 +++++-------- src/views/TrainsView.vue | 46 +++- 16 files changed, 573 insertions(+), 494 deletions(-) create mode 100644 src/components/Global/ActionButton.vue create mode 100644 src/components/Global/SearchBox.vue create mode 100644 src/scripts/utils/storeUtils.ts diff --git a/package.json b/package.json index 8f4cbfe..b4240ea 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "vue": "^2.6.12", "vue-class-component": "^7.2.6", "vue-i18n": "^8.24.3", - "vue-property-decorator": "^8.4.2", + "vue-property-decorator": "^8.5.1", "vue-router": "^3.5.1", "vuex": "^3.6.2" }, diff --git a/src/App.vue b/src/App.vue index 7ddf224..8d26eab 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,4 +1,4 @@ - @@ -74,8 +76,9 @@ import { Vue, Component, Prop } from "vue-property-decorator"; import inputData from "@/data/options.json"; import StorageManager from "@/scripts/storageManager"; +import ActionButton from "../Global/ActionButton.vue"; -@Component +@Component({ components: { ActionButton } }) export default class FilterCard extends Vue { inputs = { ...inputData }; saveOptions: boolean = false; @@ -151,9 +154,13 @@ export default class FilterCard extends Vue { @import "../../styles/responsive"; @import "../../styles/card"; -.card { - font-size: 1.25em; +$accessCol: #e03b07; +$controlCol: #0085ff; +$signalCol: #bf7c00; +$statusCol: #349b32; +$saveCol: #28a826; +.card { &-title { font-size: 2em; font-weight: 700; @@ -171,7 +178,7 @@ export default class FilterCard extends Vue { gap: 0.5em; @include smallScreen() { - grid-template-columns: repeat(auto-fit, minmax(6em, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(8em, 1fr)); grid-template-rows: auto; } } @@ -185,8 +192,6 @@ export default class FilterCard extends Vue { button { margin: 0 0.3em; - border: 1px solid white; - font-size: 0.85em; } } @@ -195,7 +200,6 @@ export default class FilterCard extends Vue { justify-content: center; .option { - width: 7em; font-size: 1.1em; } } @@ -224,8 +228,6 @@ export default class FilterCard extends Vue { padding: 0.45em 0.4em; - font-size: 0.8em; - display: inline-block; position: relative; @@ -243,42 +245,42 @@ export default class FilterCard extends Vue { &.checked { &.access { - background-color: #e03b07; + background-color: $accessCol; &::before { - box-shadow: 0 0 6px 1px #e03b07; + box-shadow: 0 0 6px 1px $accessCol; } } &.control { - background-color: #0085ff; + background-color: $controlCol; &::before { - box-shadow: 0 0 6px 1px #0085ff; + box-shadow: 0 0 6px 1px $controlCol; } } &.signals { - background-color: #b000bf; + background-color: $signalCol; &::before { - box-shadow: 0 0 6px 1px #b000bf; + box-shadow: 0 0 6px 1px $signalCol; } } &.status { - background-color: #05b702; + background-color: $statusCol; &::before { - box-shadow: 0 0 6px 1px #05b702; + box-shadow: 0 0 6px 1px $statusCol; } } &.save { - background-color: #05b702; + background-color: $saveCol; &::before { - box-shadow: 0 0 6px 1px #05b702; + box-shadow: 0 0 6px 1px $saveCol; } } @@ -310,16 +312,12 @@ export default class FilterCard extends Vue { margin-right: 0.3em; padding: 0.1em 0.2em; - font-weight: 500; - border-radius: 0.2em; } &-content { display: flex; align-items: center; - - font-size: 0.8em; } &-input { diff --git a/src/components/TrainsView/TrainOptions.vue b/src/components/TrainsView/TrainOptions.vue index a2956ed..5f9ab7b 100644 --- a/src/components/TrainsView/TrainOptions.vue +++ b/src/components/TrainsView/TrainOptions.vue @@ -1,85 +1,89 @@ @@ -164,93 +145,14 @@ export default class TrainOptions extends Vue { .options_wrapper { display: flex; + align-items: center; flex-wrap: wrap; margin-bottom: 0.5em; -} - -.option { - background: #333; - border-radius: 0.5em 0.5em 0 0; - - margin-right: 0.35em; @include smallScreen() { - width: 100%; - margin: 0.35em 0; - } -} - -.train-sorter { - user-select: none; - -moz-user-select: none; - -webkit-user-select: none; - - &_options { - position: relative; - - ul { - position: absolute; - top: 0; - left: 0; - width: 100%; - - transition: all 150ms ease-in; - - z-index: 9; - overflow: hidden; - - max-height: 0; - - &.open { - max-height: 250px; - opacity: 1; - } - - li { - display: flex; - transition: background 150ms ease-in; - - background-color: rgba(#222, 0.95); - - &:last-child { - border-radius: 0 0 0.5em 0.5em; - } - - &:hover { - background-color: rgba(#868686, 0.85); - } - - input { - display: none; - } - - label { - padding: 0.5em 1em; - width: 100%; - cursor: pointer; - } - } - } - } - - &_selected { - display: flex; - justify-content: space-between; - align-items: center; - - padding: 0.5em 0.5em; - min-width: 200px; - - cursor: pointer; - - span { - margin-right: 1em; - } - - img { - max-width: 2em; - } + justify-content: center; + flex-direction: column; } } @@ -261,16 +163,19 @@ export default class TrainOptions extends Vue { background: #333; border-radius: 0.5em; min-width: 200px; + + margin: 0.5em 0 0.5em 0.5em; + + @include smallScreen() { + width: 85%; + } } &-input { border: none; - padding: 0.5em 0.5em; - - margin: 0; - min-width: 85%; + padding: 0.35em 0.5em; } &-exit { diff --git a/src/components/TrainsView/TrainStats.vue b/src/components/TrainsView/TrainStats.vue index a655896..5f718eb 100644 --- a/src/components/TrainsView/TrainStats.vue +++ b/src/components/TrainsView/TrainStats.vue @@ -1,17 +1,7 @@