mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 05:48:11 +00:00
popupy
This commit is contained in:
+27
-31
@@ -34,11 +34,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, watch } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { version } from '.././package.json';
|
import { version } from '.././package.json';
|
||||||
|
|
||||||
import { useMainStore } from './store/mainStore';
|
import { useMainStore } from './store/mainStore';
|
||||||
|
import popupMixin from './mixins/popupMixin';
|
||||||
|
|
||||||
import Clock from './components/App/Clock.vue';
|
import Clock from './components/App/Clock.vue';
|
||||||
import StatusIndicator from './components/App/StatusIndicator.vue';
|
import StatusIndicator from './components/App/StatusIndicator.vue';
|
||||||
@@ -48,7 +49,6 @@ import StorageManager from './managers/storageManager';
|
|||||||
import PopUp from './components/PopUp/PopUp.vue';
|
import PopUp from './components/PopUp/PopUp.vue';
|
||||||
import { useApiStore } from './store/apiStore';
|
import { useApiStore } from './store/apiStore';
|
||||||
import { Status } from './typings/common';
|
import { Status } from './typings/common';
|
||||||
import { usePopupStore } from './store/popupStore';
|
|
||||||
|
|
||||||
const STORAGE_VERSION_KEY = 'app_version';
|
const STORAGE_VERSION_KEY = 'app_version';
|
||||||
|
|
||||||
@@ -61,11 +61,12 @@ export default defineComponent({
|
|||||||
PopUp
|
PopUp
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mixins: [popupMixin],
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
VERSION: version,
|
VERSION: version,
|
||||||
store: useMainStore(),
|
store: useMainStore(),
|
||||||
apiStore: useApiStore(),
|
apiStore: useApiStore(),
|
||||||
popupStore: usePopupStore(),
|
|
||||||
|
|
||||||
currentLang: 'pl',
|
currentLang: 'pl',
|
||||||
releaseURL: '',
|
releaseURL: '',
|
||||||
@@ -83,33 +84,7 @@ export default defineComponent({
|
|||||||
this.apiStore.fetchActiveData();
|
this.apiStore.fetchActiveData();
|
||||||
});
|
});
|
||||||
|
|
||||||
// popup handling
|
window.addEventListener('mousemove', (e: MouseEvent) => this.handlePopUpEvents(e));
|
||||||
window.addEventListener('mousemove', (e: MouseEvent) => {
|
|
||||||
const targetEl = e
|
|
||||||
.composedPath()
|
|
||||||
.find((p) => p instanceof HTMLElement && p.getAttribute('data-popup-key'));
|
|
||||||
|
|
||||||
if (!targetEl || !(targetEl instanceof HTMLElement)) {
|
|
||||||
if (this.popupStore.currentPopupComponent != null) this.popupStore.onPopUpHide();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const popupComponentKey = targetEl.getAttribute('data-popup-key');
|
|
||||||
const popupContent = targetEl.getAttribute('data-popup-content');
|
|
||||||
|
|
||||||
if (popupComponentKey && popupContent)
|
|
||||||
this.popupStore.onPopUpShow(e, popupComponentKey, popupContent);
|
|
||||||
else if (this.popupStore.currentPopupComponent != null) this.popupStore.onPopUpHide();
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => this.store.blockScroll,
|
|
||||||
(value) => {
|
|
||||||
if (value) document.body.classList.add('no-scroll');
|
|
||||||
else document.body.classList.remove('no-scroll');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -162,6 +137,27 @@ export default defineComponent({
|
|||||||
this.apiStore.connectToAPI();
|
this.apiStore.connectToAPI();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handlePopUpEvents(e: MouseEvent) {
|
||||||
|
const targetEl = e
|
||||||
|
.composedPath()
|
||||||
|
.find((p) => p instanceof HTMLElement && p.getAttribute('data-popup-key'));
|
||||||
|
|
||||||
|
if (!targetEl || !(targetEl instanceof HTMLElement)) {
|
||||||
|
if (this.store.popUpData.key != null) this.hidePopUp();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const popupComponentKey = targetEl.getAttribute('data-popup-key');
|
||||||
|
const popupContent = targetEl.getAttribute('data-popup-content');
|
||||||
|
|
||||||
|
if (popupComponentKey && popupContent) this.showPopUp(e, popupComponentKey, popupContent);
|
||||||
|
else if (this.store.popUpData.key != null) this.hidePopUp();
|
||||||
|
|
||||||
|
this.store.mousePos.x = e.pageX;
|
||||||
|
this.store.mousePos.y = e.pageY;
|
||||||
|
},
|
||||||
|
|
||||||
changeLang(lang: string) {
|
changeLang(lang: string) {
|
||||||
this.$i18n.locale = lang;
|
this.$i18n.locale = lang;
|
||||||
this.currentLang = lang;
|
this.currentLang = lang;
|
||||||
@@ -241,7 +237,7 @@ export default defineComponent({
|
|||||||
grid-template-columns: 100%;
|
grid-template-columns: 100%;
|
||||||
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
position: relative;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app_main {
|
.app_main {
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="popup-content">
|
<div class="popup-content">
|
||||||
<img src="/images/icon-diamond.svg" alt="" />
|
<img src="/images/icon-diamond.svg" alt="" />
|
||||||
<span>{{ popupStore.currentPopupContent }}</span>
|
<span>{{ store.popUpData.content }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { usePopupStore } from '../../store/popupStore';
|
import { useMainStore } from '../../store/mainStore';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
popupStore: usePopupStore()
|
store: useMainStore()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="popup" v-show="popupStore.currentPopupComponent" ref="preview">
|
<div class="popup" v-show="store.popUpData.key" ref="preview">
|
||||||
<component v-if="popupStore.currentPopupComponent" :is="popupStore.currentPopupComponent" />
|
<component v-if="store.popUpData.key" :is="store.popUpData.key" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,47 +9,48 @@ import { defineComponent } from 'vue';
|
|||||||
import DonatorPopUp from './DonatorPopUp.vue';
|
import DonatorPopUp from './DonatorPopUp.vue';
|
||||||
import TrainCommentsPopUp from './TrainCommentsPopUp.vue';
|
import TrainCommentsPopUp from './TrainCommentsPopUp.vue';
|
||||||
import VehiclePreviewPopUp from './VehiclePreviewPopUp.vue';
|
import VehiclePreviewPopUp from './VehiclePreviewPopUp.vue';
|
||||||
import { usePopupStore } from '../../store/popupStore';
|
import { useMainStore } from '../../store/mainStore';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { DonatorPopUp, TrainCommentsPopUp, VehiclePreviewPopUp },
|
components: { DonatorPopUp, TrainCommentsPopUp, VehiclePreviewPopUp },
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
popupStore: usePopupStore()
|
store: useMainStore()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'popupStore.popupPosition': {
|
'store.mousePos': {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler(val: typeof this.popupStore.popupPosition) {
|
handler(val: typeof this.store.mousePos) {
|
||||||
const previewEl = this.$refs['preview'] as HTMLElement;
|
|
||||||
const clientWidth = document.body.clientWidth;
|
|
||||||
const boxWidth = previewEl.getBoundingClientRect().width;
|
|
||||||
|
|
||||||
let translateX = '0px',
|
|
||||||
translateY = '30px';
|
|
||||||
|
|
||||||
if (clientWidth < 500) {
|
|
||||||
previewEl.style.left = '50%';
|
|
||||||
translateX = '-50%';
|
|
||||||
} else if (val.x <= boxWidth / 2) {
|
|
||||||
previewEl.style.left = '0';
|
|
||||||
translateX = '0px';
|
|
||||||
} else if (val.x >= clientWidth - boxWidth / 2) {
|
|
||||||
previewEl.style.left = '100%';
|
|
||||||
translateX = '-100%';
|
|
||||||
} else {
|
|
||||||
previewEl.style.left = `${val.x}px`;
|
|
||||||
translateX = '-50%';
|
|
||||||
}
|
|
||||||
|
|
||||||
previewEl.style.top = `${val.y}px`;
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
const previewEl = this.$refs['preview'] as HTMLElement;
|
||||||
|
const clientWidth = document.body.clientWidth;
|
||||||
|
const boxWidth = previewEl.getBoundingClientRect().width;
|
||||||
|
|
||||||
|
let translateX = '0px',
|
||||||
|
translateY = '30px';
|
||||||
|
|
||||||
|
if (clientWidth < 500) {
|
||||||
|
previewEl.style.left = '50%';
|
||||||
|
translateX = '-50%';
|
||||||
|
} else if (val.x <= boxWidth / 2) {
|
||||||
|
previewEl.style.left = '0';
|
||||||
|
translateX = '0px';
|
||||||
|
} else if (val.x >= clientWidth - boxWidth / 2) {
|
||||||
|
previewEl.style.left = '100%';
|
||||||
|
translateX = '-100%';
|
||||||
|
} else {
|
||||||
|
previewEl.style.left = `${val.x}px`;
|
||||||
|
translateX = '-50%';
|
||||||
|
}
|
||||||
|
|
||||||
|
previewEl.style.top = `${val.y}px`;
|
||||||
|
|
||||||
const isOutside =
|
const isOutside =
|
||||||
val.y + previewEl.getBoundingClientRect().height >= window.innerHeight + window.scrollY;
|
val.y + previewEl.getBoundingClientRect().height + 30 >=
|
||||||
|
window.innerHeight + window.scrollY;
|
||||||
|
|
||||||
if (isOutside) translateY = 'calc(-100% - 30px)';
|
if (isOutside) translateY = 'calc(-100% - 30px)';
|
||||||
previewEl.style.transform = `translate(${translateX}, ${translateY})`;
|
previewEl.style.transform = `translate(${translateX}, ${translateY})`;
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="popup-content">
|
<div class="popup-content">
|
||||||
<span>{{ popupStore.currentPopupContent }}</span>
|
<span>{{ store.popUpData.content }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { usePopupStore } from '../../store/popupStore';
|
import { useMainStore } from '../../store/mainStore';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
popupStore: usePopupStore()
|
store: useMainStore()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,29 +7,29 @@
|
|||||||
<div v-if="imageState == 'error'">{{ $t('vehicle-preview.error') }}</div>
|
<div v-if="imageState == 'error'">{{ $t('vehicle-preview.error') }}</div>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
v-if="popupStore.currentPopupContent"
|
v-if="store.popUpData.key"
|
||||||
@load="onImageLoad"
|
@load="onImageLoad"
|
||||||
@error="onImageError"
|
@error="onImageError"
|
||||||
width="300"
|
width="300"
|
||||||
height="176"
|
height="176"
|
||||||
class="rounded-md w-full h-auto"
|
class="rounded-md w-full h-auto"
|
||||||
:src="`https://static.spythere.eu/images/${popupStore.currentPopupContent}--300px.jpg`"
|
:src="`https://static.spythere.eu/images/${store.popUpData.content}--300px.jpg`"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="vehicle-name" v-if="imageState != 'error'">
|
<div class="vehicle-name" v-if="imageState != 'error'">
|
||||||
{{ popupStore.currentPopupContent.replace(/_/g, ' ') }}
|
{{ store.popUpData.content.replace(/_/g, ' ') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { usePopupStore } from '../../store/popupStore';
|
import { useMainStore } from '../../store/mainStore';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
popupStore: usePopupStore(),
|
store: useMainStore(),
|
||||||
imageState: 'loading'
|
imageState: 'loading'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ import { HeadIdsTypes, headIconsIds, headIds } from '../../scripts/data/stationH
|
|||||||
import StationStatusBadge from '../Global/StationStatusBadge.vue';
|
import StationStatusBadge from '../Global/StationStatusBadge.vue';
|
||||||
import { Status } from '../../typings/common';
|
import { Status } from '../../typings/common';
|
||||||
import { useApiStore } from '../../store/apiStore';
|
import { useApiStore } from '../../store/apiStore';
|
||||||
import { usePopupStore } from '../../store/popupStore';
|
import popupMixin from '../../mixins/popupMixin';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
@@ -324,7 +324,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
emits: ['toggleDonationModal'],
|
emits: ['toggleDonationModal'],
|
||||||
components: { Loading, StationStatusBadge },
|
components: { Loading, StationStatusBadge },
|
||||||
mixins: [styleMixin, dateMixin, stationInfoMixin],
|
mixins: [styleMixin, dateMixin, stationInfoMixin, popupMixin],
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
headIconsIds,
|
headIconsIds,
|
||||||
@@ -341,7 +341,6 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
const apiStore = useApiStore();
|
const apiStore = useApiStore();
|
||||||
const popupStore = usePopupStore();
|
|
||||||
|
|
||||||
const stationFiltersStore = useStationFiltersStore();
|
const stationFiltersStore = useStationFiltersStore();
|
||||||
|
|
||||||
@@ -349,8 +348,7 @@ export default defineComponent({
|
|||||||
Status: Status.Data,
|
Status: Status.Data,
|
||||||
stationFiltersStore,
|
stationFiltersStore,
|
||||||
mainStore,
|
mainStore,
|
||||||
apiStore,
|
apiStore
|
||||||
popupStore
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -373,7 +371,7 @@ export default defineComponent({
|
|||||||
openDonationModal(e: Event) {
|
openDonationModal(e: Event) {
|
||||||
this.$emit('toggleDonationModal', true);
|
this.$emit('toggleDonationModal', true);
|
||||||
this.mainStore.modalLastClickedTarget = e.target;
|
this.mainStore.modalLastClickedTarget = e.target;
|
||||||
this.popupStore.currentPopupComponent = null;
|
this.hidePopUp();
|
||||||
},
|
},
|
||||||
|
|
||||||
openForumSite(e: Event, url: string | undefined) {
|
openForumSite(e: Event, url: string | undefined) {
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ import ProgressBar from '../Global/ProgressBar.vue';
|
|||||||
import { useMainStore } from '../../store/mainStore';
|
import { useMainStore } from '../../store/mainStore';
|
||||||
import { useApiStore } from '../../store/apiStore';
|
import { useApiStore } from '../../store/apiStore';
|
||||||
import StockList from '../Global/StockList.vue';
|
import StockList from '../Global/StockList.vue';
|
||||||
import { usePopupStore } from '../../store/popupStore';
|
|
||||||
import modalTrainMixin from '../../mixins/modalTrainMixin';
|
import modalTrainMixin from '../../mixins/modalTrainMixin';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -183,8 +182,7 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
store: useMainStore(),
|
store: useMainStore(),
|
||||||
apiStore: useApiStore(),
|
apiStore: useApiStore()
|
||||||
popupStore: usePopupStore()
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { useMainStore } from '../store/mainStore';
|
import { useMainStore } from '../store/mainStore';
|
||||||
import { usePopupStore } from '../store/popupStore';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
store: useMainStore(),
|
store: useMainStore()
|
||||||
popupStore: usePopupStore()
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -25,7 +23,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
closeModal() {
|
closeModal() {
|
||||||
this.store.chosenModalTrainId = undefined;
|
this.store.chosenModalTrainId = undefined;
|
||||||
this.popupStore.currentPopupComponent = null;
|
this.store.popUpData.key = null;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
(this.store.modalLastClickedTarget as any)?.focus();
|
(this.store.modalLastClickedTarget as any)?.focus();
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import { useMainStore } from '../store/mainStore';
|
||||||
|
import { PopUpType, popupKeys } from '../store/typings';
|
||||||
|
|
||||||
|
const isPopUp = (v: any): v is PopUpType => popupKeys.includes(v);
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
store: useMainStore()
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
showPopUp(e: MouseEvent, componentKey: string, value?: string) {
|
||||||
|
if (!isPopUp(componentKey)) return;
|
||||||
|
|
||||||
|
this.store.popUpData['key'] = componentKey;
|
||||||
|
this.store.popUpData['content'] = value ?? '';
|
||||||
|
},
|
||||||
|
|
||||||
|
hidePopUp() {
|
||||||
|
this.store.popUpData['key'] = null;
|
||||||
|
this.store.popUpData['content'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -26,8 +26,10 @@ export const useMainStore = defineStore('store', {
|
|||||||
|
|
||||||
chosenModalTrainId: undefined,
|
chosenModalTrainId: undefined,
|
||||||
|
|
||||||
blockScroll: false,
|
modalLastClickedTarget: null,
|
||||||
modalLastClickedTarget: null
|
|
||||||
|
mousePos: { x: 0, y: 0 },
|
||||||
|
popUpData: { key: null, content: '' }
|
||||||
}) as StoreState,
|
}) as StoreState,
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
import { defineStore } from 'pinia';
|
|
||||||
|
|
||||||
export const popupKeys = ['DonatorPopUp', 'TrainCommentsPopUp', 'VehiclePreviewPopUp'] as const;
|
|
||||||
export type PopUp = (typeof popupKeys)[number];
|
|
||||||
|
|
||||||
const isPopUp = (v: any): v is PopUp => popupKeys.includes(v);
|
|
||||||
|
|
||||||
export const usePopupStore = defineStore('popupStore', {
|
|
||||||
state: () => ({
|
|
||||||
popupPosition: { x: 0, y: 0 },
|
|
||||||
currentPopupComponent: null as PopUp | null,
|
|
||||||
currentPopupContent: '',
|
|
||||||
donatorPopupVisible: false
|
|
||||||
}),
|
|
||||||
|
|
||||||
actions: {
|
|
||||||
onPopUpShow(e: MouseEvent, componentKey: string, value?: string) {
|
|
||||||
if (!isPopUp(componentKey)) return;
|
|
||||||
|
|
||||||
this.popupPosition.x = e.pageX;
|
|
||||||
this.popupPosition.y = e.pageY;
|
|
||||||
|
|
||||||
this.currentPopupComponent = componentKey;
|
|
||||||
this.currentPopupContent = value ?? '';
|
|
||||||
},
|
|
||||||
|
|
||||||
onPopUpMove(e: MouseEvent) {
|
|
||||||
this.popupPosition.x = e.pageX;
|
|
||||||
this.popupPosition.y = e.pageY;
|
|
||||||
},
|
|
||||||
|
|
||||||
onPopUpHide() {
|
|
||||||
this.currentPopupComponent = null;
|
|
||||||
this.currentPopupContent = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
import { API } from '../typings/api';
|
import { API } from '../typings/api';
|
||||||
import { Status } from '../typings/common';
|
import { Status } from '../typings/common';
|
||||||
|
|
||||||
|
export const popupKeys = ['DonatorPopUp', 'TrainCommentsPopUp', 'VehiclePreviewPopUp'] as const;
|
||||||
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
|
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
|
||||||
|
export type PopUpType = (typeof popupKeys)[number];
|
||||||
|
|
||||||
export interface RegionCounters {
|
export interface RegionCounters {
|
||||||
stationCount: number;
|
stationCount: number;
|
||||||
@@ -19,8 +21,9 @@ export interface StoreState {
|
|||||||
driverStatsData?: API.DriverStats.Response;
|
driverStatsData?: API.DriverStats.Response;
|
||||||
driverStatsStatus: Status.Data;
|
driverStatsStatus: Status.Data;
|
||||||
chosenModalTrainId?: string;
|
chosenModalTrainId?: string;
|
||||||
blockScroll: boolean;
|
|
||||||
modalLastClickedTarget: EventTarget | null;
|
modalLastClickedTarget: EventTarget | null;
|
||||||
|
mousePos: { x: number; y: number };
|
||||||
|
popUpData: { key: PopUpType | null; content: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StationRoutesInfo {
|
export interface StationRoutesInfo {
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ body {
|
|||||||
-webkit-font-smoothing: antialiased !important;
|
-webkit-font-smoothing: antialiased !important;
|
||||||
|
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
&.no-scroll {
|
&.no-scroll {
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
|
|||||||
Reference in New Issue
Block a user