mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Dodano tooltip dla sygnału statusu danych
This commit is contained in:
+90
-8
@@ -18,6 +18,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// INDICATOR TOOLTIP ANIMATION
|
||||||
|
.tooltip-anim {
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-enter-active,
|
||||||
|
&-leave-active {
|
||||||
|
transition: all $animDuration $animType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.route {
|
.route {
|
||||||
margin: 0 0.2em;
|
margin: 0 0.2em;
|
||||||
|
|
||||||
@@ -84,25 +97,94 @@
|
|||||||
|
|
||||||
border-radius: 0 0 1em 1em;
|
border-radius: 0 0 1em 1em;
|
||||||
|
|
||||||
.signal-status-indicator {
|
}
|
||||||
|
|
||||||
|
.indicator {
|
||||||
|
&-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|
||||||
transform: translateX(11.6em);
|
transform: translateX(11.6em);
|
||||||
|
z-index: 100;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&-svg {
|
||||||
width: 1.2em;
|
width: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-tooltip {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
transform: translateY(-50%);
|
||||||
|
padding: 0.5em;
|
||||||
|
margin-left: 1em;
|
||||||
|
|
||||||
|
background-color: #171717;
|
||||||
|
border-radius: 0.75em;
|
||||||
|
|
||||||
|
min-width: 13em;
|
||||||
|
text-align: center;
|
||||||
|
overflow: none;
|
||||||
|
|
||||||
|
font-size: 0.95em;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 1px;
|
||||||
|
|
||||||
|
transform: translate(-100%, -50%);
|
||||||
|
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
|
||||||
|
border-top: 10px solid transparent;
|
||||||
|
border-bottom: 10px solid transparent;
|
||||||
|
border-right: 12px solid #171717;
|
||||||
|
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
@include midScreen() {
|
||||||
|
left: 50%;
|
||||||
|
top: 100%;
|
||||||
|
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
margin-left: 0;
|
||||||
|
margin-top: 0.75em;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
border-left: 10px solid transparent;
|
||||||
|
border-right: 10px solid transparent;
|
||||||
|
border-bottom: 10px solid #171717;
|
||||||
|
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include smallScreen() {
|
||||||
|
min-width: 8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.train-logo {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
|
||||||
&_brand {
|
&_brand {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
+38
-24
@@ -8,12 +8,26 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<header class="app_header">
|
<header class="app_header">
|
||||||
<div class="header_body">
|
<div class="header_body">
|
||||||
<object
|
<div class="indicator-wrapper">
|
||||||
class="signal-status-indicator"
|
<div class="indicator-content">
|
||||||
type="image/svg+xml"
|
<object
|
||||||
:data="icons.statusIndicator"
|
class="indicator-svg"
|
||||||
ref="status-indicator"
|
type="image/svg+xml"
|
||||||
></object>
|
:data="icons.statusIndicator"
|
||||||
|
ref="status-indicator"
|
||||||
|
@mouseenter="() => tooltipActive = true"
|
||||||
|
@mouseleave="() => tooltipActive = false"
|
||||||
|
></object>
|
||||||
|
|
||||||
|
<transition name="tooltip-anim">
|
||||||
|
<div class="indicator-tooltip" v-if="tooltipActive">
|
||||||
|
<b>{{ indicator.status <= 0 ? 'S3' : indicator.status == 1 ? 'S1a' : indicator.status == 2 ? 'S2' : 'S5' }}</b>
|
||||||
|
<br>
|
||||||
|
{{ indicator.message }}
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <object class="signal-status-indicator" :src="icons.statusIndicator" alt="status-icon" ref="status-indicator"></object> -->
|
<!-- <object class="signal-status-indicator" :src="icons.statusIndicator" alt="status-icon" ref="status-indicator"></object> -->
|
||||||
<span class="header_brand">
|
<span class="header_brand">
|
||||||
@@ -155,10 +169,12 @@ export default defineComponent({
|
|||||||
error: require('@/assets/icon-error.svg'),
|
error: require('@/assets/icon-error.svg'),
|
||||||
},
|
},
|
||||||
|
|
||||||
indicator: {} as {
|
indicator: {
|
||||||
status: DataStatus;
|
status: DataStatus.Loading,
|
||||||
message: string;
|
message: "Ładowanie danych..."
|
||||||
},
|
},
|
||||||
|
|
||||||
|
tooltipActive: false
|
||||||
}),
|
}),
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
@@ -190,6 +206,13 @@ export default defineComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (timetableDataStatus == DataStatus.Warning) {
|
||||||
|
this.indicator.status = DataStatus.Warning;
|
||||||
|
this.indicator.message = "Rozkłady jazdy mogą być niekompletne!";
|
||||||
|
this.setSignalStatus(DataStatus.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (trainsDataStatus == DataStatus.Warning) {
|
if (trainsDataStatus == DataStatus.Warning) {
|
||||||
this.indicator.status = DataStatus.Warning;
|
this.indicator.status = DataStatus.Warning;
|
||||||
this.indicator.message = "Nie można pobrać danych o pociągach!";
|
this.indicator.message = "Nie można pobrać danych o pociągach!";
|
||||||
@@ -204,15 +227,8 @@ export default defineComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timetableDataStatus == DataStatus.Warning) {
|
|
||||||
this.indicator.status = DataStatus.Warning;
|
|
||||||
this.indicator.message = "Rozkłady jazdy mogą być niekompletne!";
|
|
||||||
this.setSignalStatus(DataStatus.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.indicator.status = DataStatus.Loaded;
|
this.indicator.status = DataStatus.Loaded;
|
||||||
this.indicator.message = "";
|
this.indicator.message = "Dane załadowane poprawnie!";
|
||||||
|
|
||||||
this.setSignalStatus(DataStatus.Loaded);
|
this.setSignalStatus(DataStatus.Loaded);
|
||||||
},
|
},
|
||||||
@@ -240,9 +256,9 @@ export default defineComponent({
|
|||||||
|
|
||||||
const obj = this.$refs['status-indicator'] as HTMLObjectElement;
|
const obj = this.$refs['status-indicator'] as HTMLObjectElement;
|
||||||
|
|
||||||
obj.addEventListener('load', () => {
|
// obj.addEventListener('load', () => {
|
||||||
this.setSignalStatus(DataStatus.Loading);
|
// this.setSignalStatus(DataStatus.Loading);
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -260,6 +276,8 @@ export default defineComponent({
|
|||||||
const orange = obj.contentDocument?.querySelector('#orange') as SVGElement;
|
const orange = obj.contentDocument?.querySelector('#orange') as SVGElement;
|
||||||
const redBottom = obj.contentDocument?.querySelector('#red-bottom') as SVGElement;
|
const redBottom = obj.contentDocument?.querySelector('#red-bottom') as SVGElement;
|
||||||
|
|
||||||
|
if(!green || !greenBlink || !redTop || !orange || !redBottom) return;
|
||||||
|
|
||||||
if (status == DataStatus.Loaded) {
|
if (status == DataStatus.Loaded) {
|
||||||
green.style.visibility = 'visible';
|
green.style.visibility = 'visible';
|
||||||
greenBlink.style.visibility = 'hidden';
|
greenBlink.style.visibility = 'hidden';
|
||||||
@@ -291,10 +309,6 @@ export default defineComponent({
|
|||||||
orange.style.visibility = 'hidden';
|
orange.style.visibility = 'hidden';
|
||||||
redBottom.style.visibility = 'hidden';
|
redBottom.style.visibility = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
// (this.$refs['redTop'] as SVGElement).style.display = "none";
|
|
||||||
// (this.$refs['orangeBottom'] as SVGElement).style.display = "block";
|
|
||||||
// (this.$refs['redBottom'] as SVGElement).style.display = "none";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
changeLang(lang: string) {
|
changeLang(lang: string) {
|
||||||
|
|||||||
+1
-1
@@ -119,7 +119,7 @@ export const store = createStore<State>({
|
|||||||
const onlineDispatchersData: { success: boolean, message: string[][] } = await response[2].data;
|
const onlineDispatchersData: { success: boolean, message: string[][] } = await response[2].data;
|
||||||
|
|
||||||
if (!onlineStationsData.success) {
|
if (!onlineStationsData.success) {
|
||||||
commit(MUTATIONS.SET_DATA_CONNECTION_STATUS, DataStatus.Error);
|
// commit(MUTATIONS.SET_DATA_CONNECTION_STATUS, DataStatus.Error);
|
||||||
commit(MUTATIONS.SET_SCENERY_DATA_STATUS, DataStatus.Error);
|
commit(MUTATIONS.SET_SCENERY_DATA_STATUS, DataStatus.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user