Poprawki tooltipów i plakietek statusu pociągów

This commit is contained in:
2020-11-05 12:53:40 +01:00
parent a79307c6b2
commit 2cb0e4f595
3 changed files with 80 additions and 31 deletions
+48 -13
View File
@@ -43,7 +43,7 @@
</strong> </strong>
</span> </span>
<span class="info-route-arrow"> <span class="info-route-schedule tooltip">
<img <img
:src=" :src="
showedSchedule === train.timetableData.timetableId showedSchedule === train.timetableData.timetableId
@@ -52,6 +52,12 @@
" "
alt="asc-arrow" alt="asc-arrow"
/> />
<span>SRJP</span>
<span class="tooltip-text">
Wyświetl rozkład jazdy pociągu {{ train.trainNo }}
</span>
</span> </span>
</div> </div>
@@ -70,14 +76,20 @@
<div class="info-bottom"> <div class="info-bottom">
<span <span
class="info-label user-badge tooltip" class="info-label user-badge"
:class="train.stopStatus" :class="train.stopStatus || 'disconnected'"
:style="!train.online ? 'color: gray' : ''"
v-if="train.stopStatus"
> >
{{ train.stopLabel }} <span
class="tooltip"
:style="!train.online ? 'color: gray' : ''"
>
<span v-if="train.stopStatus">{{ train.stopLabel }}</span>
<span v-else>Sceneria offline</span>
<span class="content" v-if="!train.online">Pociąg offline</span> <span class="tooltip-text" v-if="!train.online">
Pociąg offline
</span>
</span>
</span> </span>
</div> </div>
</span> </span>
@@ -279,18 +291,41 @@ export default class TrainTable extends Vue {
} }
&-route { &-route {
width: 100%; display: flex;
font-size: 1.2em; align-items: center;
font-size: 1.25em;
margin-bottom: 10px;
&-schedule {
margin-left: 10px;
padding: 0.15em 0.5em;
font-size: 0.75em;
background: #1085b3;
border-radius: 1em;
&-arrow img {
border: 2px solid white;
vertical-align: middle; vertical-align: middle;
img {
vertical-align: middle;
width: 1.2em;
}
.tooltip-text {
font-size: 0.9em;
background-color: #1085b3;
&::after {
border-color: #1085b3 transparent transparent transparent;
}
}
} }
} }
&-stops { &-stops {
margin-top: 0.35em; margin-bottom: 10px;
margin-bottom: 1rem;
font-size: 0.75em; font-size: 0.75em;
} }
+25 -16
View File
@@ -19,27 +19,30 @@
.tooltip { .tooltip {
position: relative; position: relative;
display: inline-block;
z-index: 5; & > &-text {
display: inline-block;
width: 150px;
& > .content { padding: .5rem .35rem;
visibility: hidden;
width: 120px;
background-color: #830000; background-color: #830000;
color: #fff; border-radius: .5rem;
text-align: center;
padding: 5px 0;
border-radius: 6px;
font-size: 1rem; display: inline-block;
max-width: 150px;
font-size: 1em;
text-align: center;
color: #fff;
position: absolute; position: absolute;
bottom: 155%; z-index: 1;
left: 50%; visibility: hidden;
margin-left: -60px;
opacity: 0; opacity: 0;
left: 50%;
transform: translate(-50%, calc(-100% - 1rem));
transition: opacity 0.3s; transition: opacity 0.3s;
&::after { &::after {
@@ -50,11 +53,15 @@
margin-left: -5px; margin-left: -5px;
border-width: 5px; border-width: 5px;
border-style: solid; border-style: solid;
border-color: #aa0000 transparent transparent transparent; border-color: #830000 transparent transparent transparent;
} }
} }
&:hover > .content { &:hover > &-text {
@include smallScreen() {
display: none;
}
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
} }
@@ -103,6 +110,8 @@ input {
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
margin: 0; margin: 0;
-webkit-tap-highlight-color: transparent;
} }
.default-station { .default-station {
+5
View File
@@ -3,6 +3,7 @@ $departed: springgreen;
$stopped: #ffa600; $stopped: #ffa600;
$online: gold; $online: gold;
$terminated: red; $terminated: red;
$disconnected: slategray;
.user-badge { .user-badge {
border: 1px solid white; border: 1px solid white;
@@ -45,4 +46,8 @@ $terminated: red;
&.terminated { &.terminated {
border: 1px solid $terminated; border: 1px solid $terminated;
} }
&.disconnected {
border: 1px solid $disconnected;
}
} }