mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Poprawki wizualne i zachowania strony
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<button class="action-btn">
|
||||
<slot></slot>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
|
||||
@Component
|
||||
export default class ActionButton extends Vue {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../../styles/variables";
|
||||
@import "../../styles/responsive";
|
||||
|
||||
.action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
background: #333;
|
||||
border: none;
|
||||
|
||||
color: #bdbdbd;
|
||||
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
|
||||
outline: none;
|
||||
padding: 0.35em 0.65em;
|
||||
cursor: pointer;
|
||||
|
||||
transition: all 0.3s;
|
||||
|
||||
&.outlined {
|
||||
border: 1px solid white;
|
||||
}
|
||||
|
||||
img.button_icon {
|
||||
width: 1.25em;
|
||||
vertical-align: middle;
|
||||
|
||||
margin-right: 0.2em;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1em;
|
||||
overflow: hidden;
|
||||
|
||||
transition: max-width 0.35s ease-in-out;
|
||||
}
|
||||
|
||||
&.open {
|
||||
color: $accentCol;
|
||||
border: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $accentCol;
|
||||
|
||||
background: #5c5c5c;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<div class="search-box">
|
||||
<input v-model="searchedItem" :placeholder="title" />
|
||||
|
||||
<img
|
||||
class="search-exit"
|
||||
:src="exitIcon"
|
||||
alt="exit-icon"
|
||||
@click="() => (searchedItem = '')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop, Model } from "vue-property-decorator";
|
||||
|
||||
@Component
|
||||
export default class SearchBox extends Vue {
|
||||
@Prop({ required: true }) title!: string;
|
||||
@Model("changed") readonly searchedItem!: string;
|
||||
|
||||
// @Emit("changed")
|
||||
// onItemChanged() {
|
||||
// return this.searchedItem;
|
||||
// }
|
||||
|
||||
exitIcon = require("@/assets/icon-exit.svg");
|
||||
|
||||
// searchedItem: string = "";
|
||||
|
||||
// @Watch("searchedItem")
|
||||
// watchSelectedItem(item) {
|
||||
// this.onItemChanged();
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search {
|
||||
&-box {
|
||||
position: relative;
|
||||
|
||||
background: #333;
|
||||
border-radius: 0.5em;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
&-exit {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
|
||||
top: 50%;
|
||||
right: 10px;
|
||||
transform: translateY(-50%);
|
||||
|
||||
width: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
border: none;
|
||||
|
||||
min-width: 85%;
|
||||
padding: 0.35em 0.5em;
|
||||
}
|
||||
</style>
|
||||
@@ -1,109 +1,118 @@
|
||||
<template>
|
||||
<div class="select-box">
|
||||
<div class="title">Sortuj według</div>
|
||||
<div class="select-box_content">
|
||||
<label>
|
||||
<select v-model="selectedItem">
|
||||
<option value disabled selected hidden>
|
||||
{{ title }}
|
||||
</option>
|
||||
<option v-for="item in itemList" :key="item.id" :value="item.id">
|
||||
{{ item.value }}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<div class="option-selected" @click="toggleOptionList">
|
||||
<span>{{ selectedOption }}</span>
|
||||
<img :src="require('@/assets/icon-select.svg')" alt="icon-select" />
|
||||
</div>
|
||||
|
||||
<div class="option-container">
|
||||
<ul class="option-list" :class="{ open: listOpen }">
|
||||
<li
|
||||
class="option-item"
|
||||
v-for="(option, i) in sortOptionList"
|
||||
:key="i"
|
||||
@click="() => chooseOption(option)"
|
||||
>
|
||||
<input type="option-radio" name="sort" :id="option.id" />
|
||||
<label :for="option.id">{{ option.content }}</label>
|
||||
</li>
|
||||
</ul>
|
||||
<span> </span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop } from "vue-property-decorator";
|
||||
import { Component, Vue, Prop, Watch, Emit } from "vue-property-decorator";
|
||||
|
||||
@Component
|
||||
export default class SelectBox extends Vue {
|
||||
@Prop() title!: string;
|
||||
@Prop() optionList!: string[];
|
||||
@Prop({ required: true }) title!: string;
|
||||
@Prop({ required: true }) itemList!: { id: string | number; value: string }[];
|
||||
|
||||
selectedOption: string = "";
|
||||
@Emit("selected")
|
||||
onItemSelected() {
|
||||
return this.selectedItem;
|
||||
}
|
||||
|
||||
ascIcon = require("@/assets/icon-arrow-asc.svg");
|
||||
descIcon = require("@/assets/icon-arrow-desc.svg");
|
||||
|
||||
selectedItem: string = "";
|
||||
|
||||
@Watch("selectedItem")
|
||||
watchSelectedItem(item) {
|
||||
this.onItemSelected();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.option {
|
||||
&-container {
|
||||
@import "../../styles/variables.scss";
|
||||
|
||||
.select-box {
|
||||
&_content {
|
||||
position: relative;
|
||||
|
||||
input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
label {
|
||||
padding: 0.5rem 1rem;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
select {
|
||||
border: none;
|
||||
outline: none;
|
||||
min-width: 10em;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(#868686, 0.85);
|
||||
}
|
||||
|
||||
transition: background 150ms ease-in;
|
||||
}
|
||||
|
||||
&-selected,
|
||||
&-list {
|
||||
background: #333;
|
||||
background-color: #333;
|
||||
border-radius: 0.5em;
|
||||
}
|
||||
|
||||
&-selected {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.35em 0.5em;
|
||||
|
||||
font-size: 1em;
|
||||
color: white;
|
||||
|
||||
appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
|
||||
padding: 0.5rem 1rem;
|
||||
min-width: 150px;
|
||||
cursor: pointer;
|
||||
|
||||
span {
|
||||
margin-right: 2rem;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 0.75em;
|
||||
&:focus {
|
||||
+ span > img {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-list {
|
||||
label {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
span {
|
||||
$arrowCol: #d8d8d8;
|
||||
$arrowWidth: 0.35em;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
top: 20%;
|
||||
right: 0.25em;
|
||||
|
||||
z-index: 10;
|
||||
pointer-events: none;
|
||||
|
||||
width: 100%;
|
||||
background-color: rgba(#222, 0.95);
|
||||
overflow: hidden;
|
||||
&::before,
|
||||
&::after {
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
||||
max-height: 0;
|
||||
position: absolute;
|
||||
right: 0.5em;
|
||||
|
||||
&.open {
|
||||
max-height: 250px;
|
||||
opacity: 1;
|
||||
border-left: $arrowWidth solid transparent;
|
||||
border-right: $arrowWidth solid transparent;
|
||||
}
|
||||
|
||||
transition: all 150ms ease-in;
|
||||
&::before {
|
||||
border-top: $arrowWidth solid $arrowCol;
|
||||
|
||||
transform: translateY(150%);
|
||||
}
|
||||
|
||||
&::after {
|
||||
border-bottom: $arrowWidth solid $arrowCol;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -217,8 +217,6 @@ export default class SceneryInfo extends styleMixin {
|
||||
}
|
||||
|
||||
navigateToTrain(trainNo: number) {
|
||||
console.log(trainNo);
|
||||
|
||||
this.$router.push({
|
||||
name: "TrainsView",
|
||||
params: { queryTrain: trainNo.toString() },
|
||||
|
||||
@@ -60,10 +60,12 @@
|
||||
</div>
|
||||
|
||||
<div class="card-actions flex">
|
||||
<button class="button" @click="resetFilters">
|
||||
<action-button class="outlined" @click.native="resetFilters">
|
||||
{{ $t("filters.reset") }}
|
||||
</button>
|
||||
<button class="button" @click="exit">{{ $t("filters.close") }}</button>
|
||||
</action-button>
|
||||
<action-button class="outlined" @click.native="exit">{{
|
||||
$t("filters.close")
|
||||
}}</action-button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,85 +1,89 @@
|
||||
<template>
|
||||
<div class="train-options">
|
||||
<div class="options_wrapper">
|
||||
<div class="train-sorter option">
|
||||
<div class="train-sorter_wrapper">
|
||||
<div class="train-sorter_selected" @click="toggleSorterOptions">
|
||||
<span>{{ currentSorterOption }}</span>
|
||||
<img :src="descIcon" alt="icon-select" />
|
||||
</div>
|
||||
<select-box
|
||||
:title="$t('trains.option-distance')"
|
||||
:itemList="translatedSorterOptions"
|
||||
@selected="changeSorter"
|
||||
/>
|
||||
|
||||
<div class="train-sorter_options">
|
||||
<ul :class="{ open: sorterOptionsOpen }">
|
||||
<li
|
||||
v-for="(option, i) in sorterOptions"
|
||||
:key="i"
|
||||
@click="() => chooseOption(option)"
|
||||
>
|
||||
<input type="radio" name="sort" :id="option.id" />
|
||||
<label :for="option.id">
|
||||
{{ $t(`trains.option-${option.id}`) }}
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-box">
|
||||
<input
|
||||
class="search-input"
|
||||
v-model="searchedTrain"
|
||||
:placeholder="$t('trains.search-no')"
|
||||
/>
|
||||
|
||||
<img
|
||||
class="search-exit"
|
||||
:src="exitIcon"
|
||||
alt="exit-icon"
|
||||
@click="() => (searchedTrain = '')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="train-search_train option">
|
||||
<div class="search-box">
|
||||
<input
|
||||
class="search-input"
|
||||
:placeholder="$t('trains.search-no')"
|
||||
v-model="searchedTrain"
|
||||
/>
|
||||
<img
|
||||
class="search-exit"
|
||||
:src="exitIcon"
|
||||
alt="exit-icon"
|
||||
@click="() => (searchedTrain = '')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-box">
|
||||
<input
|
||||
class="search-input"
|
||||
v-model="searchedDriver"
|
||||
:placeholder="$t('trains.search-driver')"
|
||||
/>
|
||||
|
||||
<div class="train-search_driver option">
|
||||
<div class="search-box">
|
||||
<input
|
||||
class="search-input"
|
||||
:placeholder="$t('trains.search-driver')"
|
||||
v-model="searchedDriver"
|
||||
/>
|
||||
<img
|
||||
class="search-exit"
|
||||
:src="exitIcon"
|
||||
alt="exit-icon"
|
||||
@click="() => (searchedDriver = '')"
|
||||
/>
|
||||
</div>
|
||||
<img
|
||||
class="search-exit"
|
||||
:src="exitIcon"
|
||||
alt="exit-icon"
|
||||
@click="() => (searchedDriver = '')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Watch, Prop } from "vue-property-decorator";
|
||||
import { Component, Vue, Watch, Prop, Emit } from "vue-property-decorator";
|
||||
import SelectBox from "../Global/SelectBox.vue";
|
||||
|
||||
@Component
|
||||
@Component({ components: { SelectBox } })
|
||||
export default class TrainOptions extends Vue {
|
||||
ascIcon = require("@/assets/icon-arrow-asc.svg");
|
||||
descIcon = require("@/assets/icon-arrow-desc.svg");
|
||||
// Passed as component parameters
|
||||
@Prop() readonly queryTrain!: string;
|
||||
@Prop() readonly focusedTrain!: string;
|
||||
|
||||
exitIcon = require("@/assets/icon-exit.svg");
|
||||
|
||||
clickEventListener!: EventListener;
|
||||
|
||||
sorterOptionsOpen = false;
|
||||
currentSorterOption = this.$t("trains.option-distance");
|
||||
|
||||
searchedTrain = "";
|
||||
searchedDriver = "";
|
||||
|
||||
// Passed as component parameters
|
||||
@Prop() readonly queryTrain!: string;
|
||||
@Prop() readonly focusedTrain!: string;
|
||||
sorterOptions: { id: string; value: string }[] = [
|
||||
{
|
||||
id: "mass",
|
||||
value: "masa",
|
||||
},
|
||||
{
|
||||
id: "speed",
|
||||
value: "prędkość",
|
||||
},
|
||||
{
|
||||
id: "length",
|
||||
value: "długość",
|
||||
},
|
||||
{
|
||||
id: "distance",
|
||||
value: "kilometraż",
|
||||
},
|
||||
{
|
||||
id: "timetable",
|
||||
value: "numer pociągu",
|
||||
},
|
||||
];
|
||||
|
||||
get translatedSorterOptions() {
|
||||
return this.sorterOptions.map((option) => ({
|
||||
id: option.id,
|
||||
value: this.$t(`trains.option-${option.id}`),
|
||||
}));
|
||||
}
|
||||
|
||||
mounted() {
|
||||
if (this.queryTrain) {
|
||||
@@ -88,67 +92,44 @@ export default class TrainOptions extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
sorterOptions: { id: string; content: string }[] = [
|
||||
{
|
||||
id: "mass",
|
||||
content: "masa",
|
||||
},
|
||||
{
|
||||
id: "speed",
|
||||
content: "prędkość",
|
||||
},
|
||||
{
|
||||
id: "length",
|
||||
content: "długość",
|
||||
},
|
||||
{
|
||||
id: "distance",
|
||||
content: "kilometraż",
|
||||
},
|
||||
{
|
||||
id: "timetable",
|
||||
content: "numer pociągu",
|
||||
},
|
||||
];
|
||||
/* Emitters to TrainsView managing variables */
|
||||
|
||||
toggleSorterOptions() {
|
||||
this.sorterOptionsOpen = !this.sorterOptionsOpen;
|
||||
@Emit("changeSearchedTrain")
|
||||
chooseTrain(train: string) {
|
||||
return train;
|
||||
}
|
||||
|
||||
closeSorterOptions() {
|
||||
this.sorterOptionsOpen = false;
|
||||
@Emit("changeSearchedDriver")
|
||||
chooseDriver(driverName: string) {
|
||||
return driverName;
|
||||
}
|
||||
|
||||
chooseOption(option: { id: string; content: string }) {
|
||||
this.$emit("changeSorter", { id: option.id, dir: -1 });
|
||||
|
||||
this.currentSorterOption = this.$t(`trains.option-${option.id}`);
|
||||
|
||||
this.closeSorterOptions();
|
||||
@Emit()
|
||||
changeSorter(optionID: string) {
|
||||
return { id: optionID, dir: -1 };
|
||||
}
|
||||
|
||||
/* Watchers for search boxes */
|
||||
|
||||
@Watch("searchedTrain")
|
||||
onSearchedTrainChanged(train: string) {
|
||||
this.$emit("changeSearchedTrain", train);
|
||||
watchSearchedTrain(train: string) {
|
||||
this.chooseTrain(train);
|
||||
}
|
||||
|
||||
@Watch("searchedDriver")
|
||||
onSearchedDriverChanged(driver: string) {
|
||||
this.$emit("changeSearchedDriver", driver);
|
||||
watchSearchedDriver(driver: string) {
|
||||
this.chooseDriver(driver);
|
||||
}
|
||||
|
||||
/* Watcher for train no passed in link params */
|
||||
|
||||
@Watch("queryTrain")
|
||||
onQueryTrainChanged(train: string) {
|
||||
if (train && train != "") {
|
||||
this.searchedTrain = train;
|
||||
this.searchedDriver = "";
|
||||
}
|
||||
}
|
||||
onQueryTrainChanged(train: string | undefined) {
|
||||
if (!train) return;
|
||||
if (train == "") return;
|
||||
console.log("query train changed", train);
|
||||
|
||||
@Watch("focusedTrain")
|
||||
onFocusedTrainChanged(train: string) {
|
||||
this.searchedTrain = train;
|
||||
this.searchedDriver = "";
|
||||
// this.chooseTrain(train);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
<template>
|
||||
<div class="train-stats">
|
||||
<div class="btn-wrapper">
|
||||
<button
|
||||
class="stats-btn button"
|
||||
@click="toggleStats"
|
||||
v-if="trains.length > 0"
|
||||
>
|
||||
{{ $t("trains.stats") }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<transition name="stats-anim">
|
||||
<div class="stats-body" v-if="statsOpen">
|
||||
<div class="stats-body" v-if="trainStatsOpen">
|
||||
<h2 class="stats-header">{{ $t("trains.stats") }}</h2>
|
||||
|
||||
<div class="stats-speed">
|
||||
@@ -88,12 +78,7 @@ import Train from "@/scripts/interfaces/Train";
|
||||
@Component
|
||||
export default class TrainStats extends Vue {
|
||||
@Prop() readonly trains!: Train[];
|
||||
|
||||
statsOpen: boolean = false;
|
||||
|
||||
toggleStats() {
|
||||
this.statsOpen = !this.statsOpen;
|
||||
}
|
||||
@Prop() readonly trainStatsOpen!: boolean;
|
||||
|
||||
get speedStats(): { avg: string; min: string; max: string } {
|
||||
if (this.trains.length == 0) return { avg: "0", min: "0", max: "0" };
|
||||
@@ -217,6 +202,7 @@ export default class TrainStats extends Vue {
|
||||
margin-bottom: 0.5em;
|
||||
|
||||
position: relative;
|
||||
top: 0;
|
||||
|
||||
outline: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user