From e7f7f11a658f2fccfa72f017011cabdb429f52c9 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 4 Dec 2020 22:03:44 +0100 Subject: [PATCH] =?UTF-8?q?Modyfikacja=20wygl=C4=85du=20tablicy=20scenerii?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StationsView/StationTable.vue | 535 +++++++++---------- src/views/StationsView.vue | 2 +- 2 files changed, 265 insertions(+), 272 deletions(-) diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index fdbe5b1..d204fda 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -1,20 +1,26 @@ @@ -188,9 +173,6 @@ import styleMixin from "@/mixins/styleMixin"; import Options from "@/components/StationsView/Options.vue"; -const ascSVG = require("@/assets/icon-arrow-asc.svg"); -const descSVG = require("@/assets/icon-arrow-desc.svg"); - @Component({ components: { Options }, }) @@ -201,6 +183,28 @@ export default class StationTable extends styleMixin { @Prop() readonly setFocusedStation!: () => void; @Prop() readonly changeSorter!: () => void; + likeIcon: string = require("@/assets/icon-like.svg"); + spawnIcon: string = require("@/assets/icon-spawn.svg"); + timetableIcon: string = require("@/assets/icon-timetable.svg"); + userIcon: string = require("@/assets/icon-user.svg"); + trainIcon: string = require("@/assets/icon-train.svg"); + + ascIcon: string = require("@/assets/icon-arrow-asc.svg"); + descIcon: string = require("@/assets/icon-arrow-desc.svg"); + + headTitles: string[][] = [ + ["Stacja"], + ["Min. poziom", "dyżurnego"], + ["Status"], + ["Dyżurny"], + ["Poziom", "dyżurnego"], + ["Szlaki", "2tor | 1tor"], + ["Informacje", "ogólne"], + [this.userIcon, "Mechanicy online"], + [this.spawnIcon, "Otwarte spawny"], + [this.timetableIcon, "Aktywne RJ"], + ]; + setScenery(sceneryHash: string) { const station = this.stations.find( (station) => station.stationHash === sceneryHash @@ -215,20 +219,6 @@ export default class StationTable extends styleMixin { this.$router.push({ name: "SceneryView", query: { hash: sceneryHash } }); } - - icons: { ascSVG; descSVG } = { ascSVG, descSVG }; - - headTitles: string[][] = [ - ["Stacja"], - ["Min. poziom", "dyżurnego"], - ["Status"], - ["Dyżurny"], - ["Poziom", "dyżurnego"], - ["Maszyniści"], - ["Informacje", "ogólne"], - ["Szlaki", "2tor | 1tor"], - ["Aktywne RJ"], - ]; } @@ -250,10 +240,125 @@ $rowCol: #4b4b4b; } } -.station-table { - font-size: calc(0.5rem + 0.35vw); +.highlight { + color: gold; +} + +section.station_table { overflow: auto; overflow-y: hidden; + font-size: calc(0.55rem + 0.35vw); + font-weight: 500; + + @include smallScreen() { + font-size: 0.6rem; + } +} + +.table_wrapper { + overflow: auto; +} + +table { + white-space: nowrap; + border-collapse: collapse; + + thead th { + position: sticky; + top: 0; + + min-width: 85px; + + padding: 0.3rem; + background-color: $primaryCol; + + cursor: pointer; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + + span { + display: flex; + align-items: center; + justify-content: center; + + img { + width: 1.5em; + vertical-align: middle; + } + } + } +} + +tr.station { + background-color: $rowCol; + + &:nth-child(even) { + background-color: lighten($rowCol, 5); + color: white; + } + + &:hover, + &:focus { + background-color: lighten($rowCol, 20); + } + + & > td { + padding: 0.3rem 1rem; + text-align: center; + + cursor: pointer; + + @include smallScreen() { + margin: 0; + padding: 0.1rem 0.5rem; + } + } +} + +td.station { + &_level, + &_dispatcher-exp { + span { + display: block; + + width: 2em; + height: 2em; + line-height: 2em; + margin: 0 auto; + } + } + + &_level { + span { + background-color: #888; + border-radius: 50%; + } + } + + &_info, + &_tracks { + img { + width: 2.2em; + margin: 0 0.2em; + vertical-align: middle; + } + } + + &_tracks { + .no-catenary { + background-color: #939393; + } + + .catenary { + background-color: #009dce; + } + + .track { + margin: 0 0.3rem; + padding: 0.5em; + } + } } .separator { @@ -270,118 +375,6 @@ $rowCol: #4b4b4b; background: #333; } -.table { - &-wrapper { - overflow: auto; - } - - white-space: nowrap; - border-collapse: collapse; - - @include smallScreen() { - font-size: 0.6rem; - } - - thead th { - position: sticky; - top: 0; - } - - &-head th { - padding: 0.3rem; - background-color: $primaryCol; - min-width: 120px; - - cursor: pointer; - user-select: none; - -moz-user-select: none; - -webkit-user-select: none; - - span { - display: flex; - align-items: center; - justify-content: center; - - & > img { - width: 1.5em; - } - } - } - - &-item { - background-color: $rowCol; - - &:nth-child(even) { - background-color: lighten($rowCol, 5); - color: white; - } - - &:hover, - &:focus { - background-color: lighten($rowCol, 20); - } - - & > td { - padding: 0.3rem 1rem; - margin: 0 3rem; - text-align: center; - vertical-align: middle; - - cursor: pointer; - - @include smallScreen() { - margin: 0; - padding: 0.1rem 0.5rem; - } - } - } -} - -.item { - &-station-level, - &-dispatcher-exp { - span { - display: block; - - width: 2em; - height: 2em; - line-height: 2em; - margin: 0 auto; - } - } - - &-station-level { - span { - background-color: #888; - border-radius: 50%; - } - } - - &-info, - &-tracks { - img { - width: 2.2em; - margin: 0 0.2em; - vertical-align: middle; - } - } - - &-tracks { - .no-catenary { - background-color: #939393; - } - - .catenary { - background-color: #009dce; - } - - .track { - margin: 0 0.3rem; - padding: 0.5em; - } - } -} - .station-unavailable { color: #ff1e1e; font-weight: bold; diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index ac03e15..3b4ad75 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -148,7 +148,7 @@ export default class StationsView extends Vue { } changeSorter(index: number) { - if (index > 5) return; + if (index > 4) return; if (index == this.sorterActive.index) this.sorterActive.dir = -1 * this.sorterActive.dir;