mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
chore: added active train's rolling stock vmax
This commit is contained in:
@@ -226,6 +226,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app_main {
|
.app_main {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tooltip" v-show="tooltipStore.type" ref="preview">
|
<div class="tooltip" ref="preview">
|
||||||
<component v-if="tooltipStore.type" :is="tooltipStore.type" />
|
<component v-if="tooltipStore.type" :is="tooltipStore.type" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,10 +35,7 @@ export default defineComponent({
|
|||||||
let translateX = '0',
|
let translateX = '0',
|
||||||
translateY = '30px';
|
translateY = '30px';
|
||||||
|
|
||||||
if (clientWidth < 500) {
|
if (val[0] <= boxWidth / 2) {
|
||||||
previewEl.style.left = '50%';
|
|
||||||
translateX = '-50%';
|
|
||||||
} else if (val[0] <= boxWidth / 2) {
|
|
||||||
previewEl.style.left = '0';
|
previewEl.style.left = '0';
|
||||||
translateX = '0px';
|
translateX = '0px';
|
||||||
} else if (val[0] >= clientWidth - boxWidth / 2) {
|
} else if (val[0] >= clientWidth - boxWidth / 2) {
|
||||||
|
|||||||
@@ -131,6 +131,18 @@
|
|||||||
<div>
|
<div>
|
||||||
<img src="/images/icon-speed.svg" alt="speed icon" />
|
<img src="/images/icon-speed.svg" alt="speed icon" />
|
||||||
{{ train.speed }} km/h
|
{{ train.speed }} km/h
|
||||||
|
|
||||||
|
<span v-if="maxSpeed != Infinity">
|
||||||
|
•
|
||||||
|
<em
|
||||||
|
class="text--grayed"
|
||||||
|
style="text-decoration: underline dotted"
|
||||||
|
tabindex="0"
|
||||||
|
data-tooltip="Maksymalna prędkość na podstawie pojazdów w składzie - nie bierze pod uwagę masy hamowania"
|
||||||
|
>
|
||||||
|
{{ maxSpeed }} km/h
|
||||||
|
</em>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -191,6 +203,28 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
maxSpeed() {
|
||||||
|
return this.train.stockList.reduce((acc, stockName) => {
|
||||||
|
const stockVehicleInfo = this.apiStore.vehiclesData?.vehicleList.find(
|
||||||
|
(v) => v[0] == stockName.split(':')[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!stockVehicleInfo) return acc;
|
||||||
|
|
||||||
|
const stockVehicleProps = this.apiStore.vehiclesData?.vehicleProps.find(
|
||||||
|
(v) => v.type == stockVehicleInfo[1]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!stockVehicleProps) return acc;
|
||||||
|
|
||||||
|
if (stockVehicleProps.speed < acc) return stockVehicleProps.speed;
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, Infinity);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
navigateToJournal() {
|
navigateToJournal() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
|
|||||||
+13
-3
@@ -302,14 +302,15 @@ a.a-button {
|
|||||||
[data-tooltip]:hover::after,
|
[data-tooltip]:hover::after,
|
||||||
[data-tooltip]:focus::after {
|
[data-tooltip]:focus::after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
transform: translate(10px, -50%);
|
transform: translate(0, -50%);
|
||||||
|
|
||||||
content: attr(data-tooltip);
|
content: attr(data-tooltip);
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #171717;
|
background-color: #333;
|
||||||
|
box-shadow: 0 0 5px 2px #aaa;
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
margin: 0 0.25em;
|
margin: 0 0.5em;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
@@ -317,3 +318,12 @@ a.a-button {
|
|||||||
[data-tooltip] {
|
[data-tooltip] {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include smallScreen {
|
||||||
|
[data-tooltip]:hover::after,
|
||||||
|
[data-tooltip]:focus::after {
|
||||||
|
transform: translate(-50%, 2em);
|
||||||
|
left: 50%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user