diff --git a/README.md b/README.md index 0a1c42d..014619b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [STACJOWNIK TD2](https://stacjownik-td2.web.app) +# [STACJOWNIK TD2](https://stacjownik-td2.spythere.eu) ODŚWIEŻANA LISTA SCENERII I SKŁADÓW ONLINE DLA [SYMULATORA TRAIN DRIVER 2](https://td2.info.pl) diff --git a/index.html b/index.html index 8b55ce7..00ab729 100644 --- a/index.html +++ b/index.html @@ -89,7 +89,7 @@ - +
- + pojazdownik app logo

Pojazdownik

{{ $t('welcome.pojazdownik-desc') }}

- + generator app logo

GeneraTOR

{{ $t('welcome.generator-desc') }}

- + srjp app logo

Rozkładownik

{{ $t('welcome.srjp-desc') }}

diff --git a/src/components/App/MigrateInfoCard.vue b/src/components/App/MigrateInfoCard.vue deleted file mode 100644 index cc9146e..0000000 --- a/src/components/App/MigrateInfoCard.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - - - diff --git a/src/components/App/UpdateCard.vue b/src/components/App/UpdateCard.vue index 248bda3..4b77441 100644 --- a/src/components/App/UpdateCard.vue +++ b/src/components/App/UpdateCard.vue @@ -1,7 +1,7 @@ diff --git a/src/components/Global/StockList.vue b/src/components/Global/StockList.vue index 273915a..fd0b6bb 100644 --- a/src/components/Global/StockList.vue +++ b/src/components/Global/StockList.vue @@ -7,6 +7,7 @@ :vehicle-string="vehicleString" :images="images" :image-fallbacks="imagesFallbacks" + :show-previews="showPreviews" /> @@ -23,7 +24,8 @@ export default defineComponent({ props: { trainStockList: { type: Array as PropType, required: true }, - tractionOnly: { type: Boolean, required: false } + tractionOnly: { type: Boolean, required: false }, + showPreviews: { type: Boolean } }, data() { diff --git a/src/components/Global/VehicleThumbnail.vue b/src/components/Global/VehicleThumbnail.vue index a7d8ace..d83e314 100644 --- a/src/components/Global/VehicleThumbnail.vue +++ b/src/components/Global/VehicleThumbnail.vue @@ -11,7 +11,8 @@ :src="`https://stacjownik.spythere.eu/static/thumbnails/${thumbnailImage}.png`" height="70" loading="lazy" - data-tooltip-type="VehiclePreviewTooltip" + :data-crosshair-cursor="showPreviews" + :data-tooltip-type="showPreviews ? 'VehiclePreviewTooltip' : ''" :data-tooltip-content="vehicleString" @error="onImageError($event, imageFallbacks[imageIndex])" @load="onImageLoad" @@ -20,13 +21,14 @@
- diff --git a/src/components/SceneryView/SceneryTimetable/SceneryTimetableHeader.vue b/src/components/SceneryView/SceneryTimetable/SceneryTimetableHeader.vue new file mode 100644 index 0000000..044139e --- /dev/null +++ b/src/components/SceneryView/SceneryTimetable/SceneryTimetableHeader.vue @@ -0,0 +1,139 @@ + + + + + diff --git a/src/components/SceneryView/SceneryTimetable/SceneryTimetableList.vue b/src/components/SceneryView/SceneryTimetable/SceneryTimetableList.vue new file mode 100644 index 0000000..d62d37a --- /dev/null +++ b/src/components/SceneryView/SceneryTimetable/SceneryTimetableList.vue @@ -0,0 +1,464 @@ + + + + + diff --git a/src/components/SceneryView/ScheduledTrainStatus.vue b/src/components/SceneryView/SceneryTimetable/ScheduledTrainStatus.vue similarity index 97% rename from src/components/SceneryView/ScheduledTrainStatus.vue rename to src/components/SceneryView/SceneryTimetable/ScheduledTrainStatus.vue index 4fe0dc8..c935bf9 100644 --- a/src/components/SceneryView/ScheduledTrainStatus.vue +++ b/src/components/SceneryView/SceneryTimetable/ScheduledTrainStatus.vue @@ -18,8 +18,8 @@ + + diff --git a/src/components/StationsView/StationFilterCard.vue b/src/components/StationsView/StationFilterCard.vue index 51973ea..8cdfeb9 100644 --- a/src/components/StationsView/StationFilterCard.vue +++ b/src/components/StationsView/StationFilterCard.vue @@ -137,20 +137,16 @@
-
- - {{ filters[slider.id] }} +
+ + + + {{ filters[sliderGroupsOptions[sliderGroup][0].id] }} - + {{ filters[sliderGroupsOptions[sliderGroup][1].id] }} + +
- {{ $t(`filters.sliders.${slider.id}`) }} + {{ $t(`filters.sliders.${sliderGroups[i]}`) }}
@@ -190,13 +186,15 @@ import routerMixin from '../../mixins/routerMixin'; import { useMainStore } from '../../store/mainStore'; import FilterOption from './FilterOption.vue'; +import FilterSlider from './FilterSlider.vue'; import StorageManager from '../../managers/storageManager'; import { filtersSections, - sliderStates, initFilters, - getChangedFilters + sliderGroups, + getChangedFilters, + sliderGroupsOptions } from '../../managers/stationFilterManager'; import { StationFilterSection } from '../../managers/stationFilterManager'; @@ -206,14 +204,15 @@ import { watch } from 'vue'; const STORAGE_KEY = 'options_saved'; export default defineComponent({ - components: { FilterOption }, + components: { FilterOption, FilterSlider }, mixins: [keyMixin, routerMixin], data: () => ({ saveOptions: false, filtersSections, - sliderStates, + sliderGroups, + sliderGroupsOptions, minimumHours: 0, @@ -516,7 +515,7 @@ h3.hours-section-header { .section-filters { display: grid; - grid-template-columns: repeat(3, 1fr); + grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.5em; margin: 1em 0; } @@ -528,9 +527,11 @@ h3.hours-section-header { -moz-user-select: none; span { + display: flex; + justify-content: center; + align-items: center; + height: 100%; cursor: pointer; - display: inline-block; - width: 100%; text-align: center; padding: 0.25em; font-weight: bold; @@ -588,112 +589,34 @@ h3.hours-section-header { } } -.slider { +.card_sliders { + margin-top: 1em; +} + +.option-slider { display: grid; - grid-template-columns: 1fr 50px 1fr; align-items: center; + grid-template-columns: 250px 100px 1fr; gap: 0.25em; + min-height: 35px; margin-bottom: 1em; +} - &-value { - color: var(--clr-primary); - padding: 0.1em 0.2em; - text-align: center; - } - - &-input { - -webkit-appearance: none; - appearance: none; - background: none; - border: none; - outline: none; - - min-width: 25%; - - &:focus-visible ~ * { - color: gold; - } - - &::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - - height: 20px; - width: 20px; - margin-top: -7px; - - border-radius: 50%; - - background: white; - border: 3px solid var(--clr-primary); - background-color: #333; - - @include responsive.smallScreen { - width: 15px; - height: 15px; - margin-top: -5px; - border: 3px solid var(--clr-primary); - } - } - - &::-moz-range-thumb { - height: 1em; - width: 1em; - - border-radius: 50%; - - background: white; - border: 4px solid var(--clr-primary); - - cursor: pointer; - - @include responsive.smallScreen { - width: 1em; - height: 1em; - border: 3px solid var(--clr-primary); - } - } - - &::-webkit-slider-runnable-track { - width: 100%; - height: 5px; - cursor: pointer; - background: #ffffff; - border-radius: 1em; - } - - &::-moz-range-track { - width: 100%; - height: 5px; - cursor: pointer; - background: #ffffff; - border-radius: 1em; - } - - &::-ms-track { - width: 100%; - height: 5px; - cursor: pointer; - background: #ffffff; - border-radius: 1em; - } - } +.slider-value { + color: var(--clr-primary); + padding: 0.1em 0.2em; + text-align: center; + font-weight: bold; } @include responsive.smallScreen { - .slider { - display: flex; - flex-wrap: wrap; - justify-content: center; + .option-slider { + grid-template-columns: 1fr; + } - &-input { - width: 90%; - } - - &-content { - text-align: center; - } + .slider-content { + text-align: center; } .card_controls > button > p { diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index a400a1c..5b343f9 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -578,6 +578,7 @@ tbody tr { .station-name { font-weight: bold; max-width: 200px; + padding: 0.25em; &.default { color: var(--clr-primary); diff --git a/src/components/StationsView/utils.ts b/src/components/StationsView/utils.ts index f280939..003feee 100644 --- a/src/components/StationsView/utils.ts +++ b/src/components/StationsView/utils.ts @@ -120,28 +120,40 @@ function filterSliderValues(filters: Record, generalInfo: StationGe const otherAvailability = availability == 'nonPublic' || availability == 'unavailable' || availability == 'abandoned'; - const internalRoutes = routes.all.filter((r) => r.isInternal && !r.isRouteSBL && !r.hidden); + if (filters['minLevel'] > reqLevel + (otherAvailability ? 1 : 0)) return true; + if (filters['maxLevel'] < reqLevel + (otherAvailability ? 1 : 0)) return true; + if (filters['minVmax'] > routes.maxRouteSpeed) return true; + if (filters['maxVmax'] < routes.minRouteSpeed) return true; - return ( - filters['minLevel'] > reqLevel + (otherAvailability ? 1 : 0) || - filters['maxLevel'] < reqLevel + (otherAvailability ? 1 : 0) || - filters['minVmax'] > routes.maxRouteSpeed || - filters['maxVmax'] < routes.minRouteSpeed || - (filters['no-1track'] && routes.single.length != 0) || - (filters['no-2track'] && routes.double.length != 0) || - filters['minOneWayCatenary'] > routes.singleElectrifiedNames.length || - filters['minOneWay'] > routes.singleOtherNames.length || - filters['minTwoWayCatenary'] > routes.doubleElectrifiedNames.length || - filters['minTwoWay'] > routes.doubleOtherNames.length || - filters['minOneWayCatenaryInt'] > - internalRoutes.filter((r) => r.routeTracks == 1 && r.isElectric == true).length || - filters['minOneWayInt'] > - internalRoutes.filter((r) => r.routeTracks == 1 && r.isElectric == false).length || - filters['minTwoWayCatenaryInt'] > - internalRoutes.filter((r) => r.routeTracks == 2 && r.isElectric == true).length || - filters['minTwoWayInt'] > - internalRoutes.filter((r) => r.routeTracks == 2 && r.isElectric == false).length - ); + if (filters['oneWay'] && routes.singleOtherNames.length > 0) return true; + if (filters['oneWayCatenary'] && routes.singleElectrifiedNames.length > 0) return true; + if (filters['twoWay'] && routes.doubleOtherNames.length > 0) return true; + if (filters['twoWayCatenary'] && routes.doubleElectrifiedNames.length > 0) return true; + + if (filters['minOneWay'] > routes.singleOtherNames.length) return true; + if (filters['maxOneWay'] < routes.singleOtherNames.length) return true; + if (filters['minOneWayCatenary'] > routes.singleElectrifiedNames.length) return true; + if (filters['maxOneWayCatenary'] < routes.singleElectrifiedNames.length) return true; + if (filters['minTwoWay'] > routes.doubleOtherNames.length) return true; + if (filters['maxTwoWay'] < routes.doubleOtherNames.length) return true; + if (filters['minTwoWayCatenary'] > routes.doubleElectrifiedNames.length) return true; + if (filters['maxTwoWayCatenary'] < routes.doubleElectrifiedNames.length) return true; + + if (filters['oneWayInt'] && routes.singleOtherInternalNames.length > 0) return true; + if (filters['oneWayCatenaryInt'] && routes.singleElectrifiedInternalNames.length > 0) return true; + if (filters['twoWayInt'] && routes.doubleOtherInternalNames.length > 0) return true; + if (filters['twoWayCatenaryInt'] && routes.doubleElectrifiedInternalNames.length > 0) return true; + + // Internal routes + if (filters['minOneWayInt'] > routes.singleOtherInternalNames.length) return true; + if (filters['maxOneWayInt'] < routes.singleOtherInternalNames.length) return true; + if (filters['minOneWayCatenaryInt'] > routes.singleElectrifiedInternalNames.length) return true; + if (filters['maxOneWayCatenaryInt'] < routes.singleElectrifiedInternalNames.length) return true; + + if (filters['minTwoWayInt'] > routes.doubleOtherInternalNames.length) return true; + if (filters['maxTwoWayInt'] < routes.doubleOtherInternalNames.length) return true; + if (filters['minTwoWayCatenaryInt'] > routes.doubleElectrifiedInternalNames.length) return true; + if (filters['maxTwoWayCatenaryInt'] < routes.doubleElectrifiedInternalNames.length) return true; } function filterInputValues(filters: Record, generalInfo: StationGeneralInfo) { diff --git a/src/components/TrainsView/TrainTableItem.vue b/src/components/TrainsView/TrainTableItem.vue index 939066b..f4f7c31 100644 --- a/src/components/TrainsView/TrainTableItem.vue +++ b/src/components/TrainsView/TrainTableItem.vue @@ -4,7 +4,7 @@
- +
{{ train.speed }}km/h diff --git a/src/composables/time.ts b/src/composables/time.ts index edb1eba..0bdbd25 100644 --- a/src/composables/time.ts +++ b/src/composables/time.ts @@ -35,3 +35,10 @@ export function dateToLocaleString(date: Date, dateOptions: Intl.DateTimeFormatO return date.toLocaleString(locale.value == 'pl' ? 'pl-PL' : 'en-GB', dateOptions); } + +export function timestampToTimeString(timestamp: number) { + return new Date(timestamp).toLocaleTimeString('pl-PL', { + hour: '2-digit', + minute: '2-digit' + }); +} diff --git a/src/locales/en.json b/src/locales/en.json index 65e8495..bff280e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -23,15 +23,6 @@ "bottom-text": "Enjoy!\n~Spythere", "button-confirm": "Start using the app!" }, - "migrate-info": { - "tooltip-content": "Information about migration of\nStacjownik site!", - "header-text": "Attention!", - "paragraph-1-html": "Due to the growing interest in Stacjownik and other applications I have made, as of January 1, 2026, Stacjownik will be permanently moved to a new dedicated domain:", - "paragraph-2-link-text": "https://stacjownik-td2.spythere.eu", - "paragraph-3-text": "This website will no longer receive future updates and after the New Year it will only redirect to the address above.", - "paragraph-4-italic-text": "\"Why are you messing this up? It's been fine for so long!\"", - "paragraph-4-html": "\"Why are you messing this up? It's been fine for so long!\"
The change is mainly caused by the growing website interest and exceeding the free limit plan of the current Google hosting, which forces additional fees for each use of the service above a certain threshold (or otherwise blocks access to it). By moving the site to a dedicated domain (which has already been purchased and is maintained with the financial help of Supporters), I will get rid of unnecessary expenses for a large corporation that can shut down my application at any given time." - }, "donations": { "button-title": "TOSS A COIN", "header": "Toss a coin to Stacjownik!", @@ -65,7 +56,7 @@ "refresh": "REFRESH" }, "update": { - "title": "Stacjownik update!", + "title": "Stacjownik has been updated!", "confirm": "ROGER THAT!", "no-data": "No data about the latest app update has been found", "info-1": "This changelog will be available to see once again after clicking the version number in the footer", @@ -302,6 +293,16 @@ "withoutActiveTimetables": "NO ACTIVE", "junction": "JUNCTIONS", "nonJunction": "OTHER", + + "oneWay": "OTHER SINGLE TRACK", + "oneWayCatenary": "CATENARY SINGLE TRACK", + "twoWayCatenary": "CATENARY DOUBLE TRACK", + "twoWay": "OTHER DOUBLE TRACK", + "oneWayCatenaryInt": "CATENARY SINGLE TRACK", + "oneWayInt": "OTHER SINGLE TRACK", + "twoWayCatenaryInt": "CATENARY DOUBLE TRACK", + "twoWayInt": "OTHER DOUBLE TRACK", + "sliders": { "minLevel": "MIN. REQUIRED DISPATCHER LEVEL", "maxLevel": "MAX. REQUIRED DISPATCHER LEVEL", @@ -325,7 +326,6 @@ "now": "NOW", "hour": "h", "no-limit": "NO LIMIT", - "include-selected": "INCLUDE SELECTED", "save": "REMEMBER FILTERS", "reset": "RESET FILTERS", "close": "CLOSE FILTERS" @@ -558,7 +558,7 @@ "no-users": "NO ACTIVE PLAYERS", "no-spawns": "NO OPEN SPAWNS", "no-scenery": "Oops! This scenery doesn't exist!", - "return-btn": "BACK TO THE LAST SITE", + "return-btn": "BACK TO THE MAIN SITE", "history-btn": "View the dispatcher history", "info-btn": "Return to the scenery view", "authors-title": "Scenery author | Scenery authors", @@ -572,6 +572,8 @@ "option-active-timetables": "Active timetables", "option-timetables-history": "Timetables history PL1", "option-dispatchers-history": "Dispatchers history PL1", + "btn-show-timetable-thumbnails": "Show rolling stock thumbnails", + "btn-hide-timetable-thumbnails": "Hide rolling stock thumbnails", "timetable-includesScenery": "ALL TIMETABLES", "timetable-via": "PASSES THROUGH", "timetable-issuedFrom": "BEGINS HERE", diff --git a/src/locales/pl.json b/src/locales/pl.json index adce89b..dd1db61 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -23,14 +23,6 @@ "bottom-text": "Miłego korzystania\n~Spythere", "button-confirm": "Zacznij korzystać z aplikacji!" }, - "migrate-info": { - "tooltip-content": "Informacja o migracji\nstrony Stacjownika!", - "header-text": "Uwaga!", - "paragraph-1-html": "Ze względu na coraz większe zainteresowanie Stacjownikiem oraz innymi aplikacjami mojego autorstwa z dniem 1 stycznia 2026r. Stacjownik zostaje permamentnie przeniesiony na nową dedykowaną domenę:", - "paragraph-2-link-text": "https://stacjownik-td2.spythere.eu", - "paragraph-3-text": "Obecna strona nie będzie otrzymywać już przyszłych aktualizacji, a po Nowym Roku będzie jedynie przenosić na powyższy adres.", - "paragraph-4-html": "\"Po co psujesz? Przecież było dobrze tyle czasu!\"
Zmiana podyktowana jest głównie wzrostem zainteresowania stroną i przekraczaniem darmowego limitu obecnego hostingu Google'a, który wymusza płatność za każde użycie serwisu ponad określoną wartość (lub w przeciwnym wypadku blokuje do niego dostęp). Przenosząc stronę na dedykowaną domenę (która jest już wykupiona i utrzymywana dzięki pomocy Wspierających), pozbędę się niepotrzebnego wydatku dla wielkiej korporacji, która w każdej chwili może mi wyłączyć aplikację." - }, "donations": { "button-title": "GROSZA DAJ", "header": "Grosza daj Stacjownikowi!", @@ -64,7 +56,7 @@ "refresh": "ODŚWIEŻ" }, "update": { - "title": "Aktualizacja Stacjownika!", + "title": "Stacjownik został zaktualizowany!", "confirm": "PRZYJĄŁEM!", "no-data": "Nie znaleziono informacji o ostatnich zmianach w aplikacji", "info-1": "Ten changelog będzie zawsze dostępny po kliknięciu numeru wersji w stopce strony", @@ -255,7 +247,9 @@ "blockades": "BLOKADY LINIOWE", "status": "STATUS ONLINE", "timetables": "AKTYWNE ROZKŁADY JAZDY", - "spawns": "OTWARTE SPAWNY" + "spawns": "OTWARTE SPAWNY", + "externalRoutes": "SZLAKI ZEWNĘTRZNE", + "internalRoutes": "SZLAKI WEWNĘTRZNE" }, "changed-filters-count": "Zmienione filtry:", "no-changed-filters": "Brak zmienionych filtrów", @@ -299,19 +293,27 @@ "withoutActiveTimetables": "BEZ AKTYWNYCH", "junction": "WĘZŁOWE", "nonJunction": "INNE", + + "oneWay": "JEDNOTOROWE NIEZELEKTRYFIKOWANE", + "oneWayCatenary": "JEDNOTOROWE ZELEKTRYFIKOWANE", + "twoWayCatenary": "DWUTOROWE ZELEKTRYFIKOWANE", + "twoWay": "DWUTOROWE NIEZELEKTRYFIKOWANE", + "oneWayCatenaryInt": "JEDNOTOROWE ZELEKTRYFIKOWANE", + "oneWayInt": "JEDNOTOROWE NIEZELEKTRYFIKOWANE", + "twoWayCatenaryInt": "DWUTOROWE ZELEKTRYFIKOWANE", + "twoWayInt": "DWUTOROWE NIEZELEKTRYFIKOWANE", + "sliders": { - "minLevel": "MIN. WYMAGANY POZIOM DYŻURNEGO", - "maxLevel": "MAKS. WYMAGANY POZIOM DYŻURNEGO", - "minVmax": "MIN. PRĘDKOŚĆ SZLAKOWA", - "maxVmax": "MAKS. PRĘDKOŚĆ SZLAKOWA", - "minOneWayCatenary": "SZLAKI JEDNOTOROWE ZELEKTR. (MINIMUM)", - "minOneWay": "SZLAKI JEDNOTOROWE NIEZELEKTR. (MINIMUM)", - "minTwoWayCatenary": "SZLAKI DWUTOROWE ZELEKTR. (MINIMUM)", - "minTwoWay": "SZLAKI DWUTOROWE NIEZELEKTR. (MINIMUM)", - "minOneWayCatenaryInt": "SZLAKI JEDNOTOROWE ZELEKTR. WEWNĘTRZNE (MINIMUM)", - "minOneWayInt": "SZLAKI JEDNOTOROWE NIEZELEKTR. WEWNĘTRZNE (MINIMUM)", - "minTwoWayCatenaryInt": "SZLAKI DWUTOROWE ZELEKTR. WEWNĘTRZNE (MINIMUM)", - "minTwoWayInt": "SZLAKI DWUTOROWE NIEZELEKTR. WEWNĘTRZNE (MINIMUM)" + "vMax": "PRĘDKOŚĆ SZLAKOWA", + "level": "WYMAGANY POZIOM DYŻURNEGO", + "routeOneWay": "SZLAKI 1-TOROWE NIEZELEKTR.", + "routeOneWayCatenary": "SZLAKI 1-TOROWE ZELEKTR.", + "routeTwoWayCatenary": "SZLAKI 2-TOROWE ZELEKTR.", + "routeTwoWay": "SZLAKI 2-TOROWE NIEZELEKTR.", + "routeOneWayInternalCatenary": "SZLAKI WEWN. 1-TOROWE ZELEKTR.", + "routeOneWayInternal": "SZLAKI WEWN. 1-TOROWE NIEZELEKTR.", + "routeTwoWayInternalCatenary": "SZLAKI WEWN. 2-TOROWE ZELEKTR.", + "routeTwoWayInternal": "SZLAKI WEWN. 2-TOROWE NIEZELEKTR." }, "sceneries-placeholder": "Wyszukaj scenerię", "line-numbers-placeholder": "Numery linii (oddzielone przecinkami)", @@ -322,7 +324,6 @@ "now": "TERAZ", "hour": " godz.", "no-limit": "BEZ LIMITU", - "include-selected": "POKAŻ ZAZNACZONE", "save": "ZAPAMIĘTAJ FILTRY", "reset": "RESETUJ FILTRY", "close": "ZAMKNIJ FILTRY" @@ -543,7 +544,7 @@ "no-users": "BRAK AKTYWNYCH GRACZY", "no-spawns": "BRAK OTWARTYCH SPAWNÓW", "no-scenery": "Ups! Ta sceneria nie istnieje!", - "return-btn": "POWRÓT DO POPRZEDNIEJ STRONY", + "return-btn": "POWRÓT DO STRONY GŁÓWNEJ", "history-btn": "Przejdź do widoku historii dyżurnych ruchu", "info-btn": "Wróć do widoku scenerii", "authors-title": "Autor scenerii | Autorzy scenerii", @@ -557,6 +558,8 @@ "option-active-timetables": "Aktywne rozkłady jazdy", "option-timetables-history": "Historia rozkładów PL1", "option-dispatchers-history": "Historia dyżurów PL1", + "btn-show-timetable-thumbnails": "Pokazuj podglądy składów", + "btn-hide-timetable-thumbnails": "Ukrywaj podglądy składów", "timetable-includesScenery": "WSZYSTKIE RJ", "timetable-via": "PRZEJEŻDŻA", "timetable-issuedFrom": "ROZPOCZYNA BIEG", diff --git a/src/managers/stationFilterManager.ts b/src/managers/stationFilterManager.ts index dac2b8c..c64de5a 100644 --- a/src/managers/stationFilterManager.ts +++ b/src/managers/stationFilterManager.ts @@ -1,5 +1,24 @@ import StorageManager from './storageManager'; +export type SliderGroup = + | 'vMax' + | 'level' + | 'routeOneWay' + | 'routeOneWayCatenary' + | 'routeOneWayInternal' + | 'routeOneWayInternalCatenary' + | 'routeTwoWay' + | 'routeTwoWayCatenary' + | 'routeTwoWayInternal' + | 'routeTwoWayInternalCatenary'; + +export interface SliderOptions { + id: string; + minRange: number; + maxRange: number; + step: number; +} + export const sections = [ 'status', 'timetables', @@ -10,7 +29,9 @@ export const sections = [ 'control', 'blockades', 'signals', - 'addons' + 'addons', + 'externalRoutes', + 'internalRoutes' ] as const; export const initFilters = { @@ -38,9 +59,6 @@ export const initFilters = { mixed: false, SBL: false, PBL: false, - 'include-selected': false, - 'no-1track': false, - 'no-2track': false, free: true, occupied: false, nonPublic: false, @@ -60,34 +78,111 @@ export const initFilters = { onlineFromHours: 0, minLevel: 0, maxLevel: 20, + oneWay: false, + oneWayCatenary: false, + twoWay: false, + twoWayCatenary: false, + oneWayCatenaryInt: false, + oneWayInt: false, + twoWayInt: false, + twoWayCatenaryInt: false, minOneWay: 0, minOneWayCatenary: 0, - minOneWayInt: 0, minOneWayCatenaryInt: 0, + minOneWayInt: 0, minTwoWay: 0, minTwoWayCatenary: 0, minTwoWayInt: 0, minTwoWayCatenaryInt: 0, + maxOneWay: 5, + maxOneWayCatenary: 5, + maxOneWayInt: 5, + maxOneWayCatenaryInt: 5, + maxTwoWay: 5, + maxTwoWayCatenary: 5, + maxTwoWayInt: 5, + maxTwoWayCatenaryInt: 5, authors: '', projects: '', lines: '' }; -export const sliderStates = [ - { id: 'maxVmax', minRange: 0, maxRange: 200, step: 10 }, - { id: 'minVmax', minRange: 0, maxRange: 200, step: 10 }, - { id: 'minLevel', minRange: 0, maxRange: 20, step: 1 }, - { id: 'maxLevel', minRange: 0, maxRange: 20, step: 1 }, - { id: 'minOneWay', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minOneWayCatenary', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minOneWayInt', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minOneWayCatenaryInt', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minTwoWay', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minTwoWayCatenary', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minTwoWayInt', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minTwoWayCatenaryInt', minRange: 0, maxRange: 5, step: 1 } +export const sliderGroups: SliderGroup[] = [ + 'vMax', + 'level', + 'routeOneWayCatenary', + 'routeOneWay', + 'routeTwoWayCatenary', + 'routeTwoWay', + 'routeOneWayInternalCatenary', + 'routeOneWayInternal', + 'routeTwoWayInternalCatenary', + 'routeTwoWayInternal' ]; +export const sliderGroupsOptions: Record = { + vMax: [ + { id: 'minVmax', minRange: 0, maxRange: 200, step: 10 }, + { id: 'maxVmax', minRange: 0, maxRange: 200, step: 10 } + ], + level: [ + { id: 'minLevel', minRange: 0, maxRange: 20, step: 1 }, + { id: 'maxLevel', minRange: 0, maxRange: 20, step: 1 } + ], + routeOneWay: [ + { id: 'minOneWay', minRange: 0, maxRange: 5, step: 1 }, + { id: 'maxOneWay', minRange: 0, maxRange: 5, step: 1 } + ], + routeOneWayCatenary: [ + { id: 'minOneWayCatenary', minRange: 0, maxRange: 5, step: 1 }, + { id: 'maxOneWayCatenary', minRange: 0, maxRange: 5, step: 1 } + ], + routeOneWayInternal: [ + { id: 'minOneWayInt', minRange: 0, maxRange: 5, step: 1 }, + { id: 'maxOneWayInt', minRange: 0, maxRange: 5, step: 1 } + ], + routeOneWayInternalCatenary: [ + { + id: 'minOneWayCatenaryInt', + minRange: 0, + maxRange: 5, + step: 1 + }, + { + id: 'maxOneWayCatenaryInt', + minRange: 0, + maxRange: 5, + step: 1 + } + ], + routeTwoWay: [ + { id: 'minTwoWay', minRange: 0, maxRange: 5, step: 1 }, + { id: 'maxTwoWay', minRange: 0, maxRange: 5, step: 1 } + ], + routeTwoWayCatenary: [ + { id: 'minTwoWayCatenary', minRange: 0, maxRange: 5, step: 1 }, + { id: 'maxTwoWayCatenary', minRange: 0, maxRange: 5, step: 1 } + ], + routeTwoWayInternal: [ + { id: 'minTwoWayInt', minRange: 0, maxRange: 5, step: 1 }, + { id: 'maxTwoWayInt', minRange: 0, maxRange: 5, step: 1 } + ], + routeTwoWayInternalCatenary: [ + { + id: 'minTwoWayCatenaryInt', + minRange: 0, + maxRange: 5, + step: 1 + }, + { + id: 'maxTwoWayCatenaryInt', + minRange: 0, + maxRange: 5, + step: 1 + } + ] +}; + export type StationFilter = keyof typeof initFilters; export type StationFilterSection = (typeof sections)[number]; @@ -112,7 +207,9 @@ export const filtersSections: Record = { 'manual' ], blockades: ['SBL', 'PBL'], - signals: ['modern', 'semaphores', 'mixed', 'historical'] + signals: ['modern', 'semaphores', 'mixed', 'historical'], + externalRoutes: ['oneWayCatenary', 'oneWay', 'twoWayCatenary', 'twoWay'], + internalRoutes: ['oneWayCatenaryInt', 'oneWayInt', 'twoWayCatenaryInt', 'twoWayInt'] }; export function setupFilters(currentFilters: Record) { @@ -135,7 +232,8 @@ export function getChangedFilters(currentFilters: Record): string[] return ( Object.keys(currentFilters).filter( (filterKey) => - currentFilters[filterKey] !== initFilters[filterKey as keyof typeof initFilters] + currentFilters[filterKey].toString() !== + initFilters[filterKey as keyof typeof initFilters].toString() ) ?? [] ); } diff --git a/src/store/apiStore.ts b/src/store/apiStore.ts index 0404bdd..5e697c5 100644 --- a/src/store/apiStore.ts +++ b/src/store/apiStore.ts @@ -7,6 +7,7 @@ import axios, { AxiosInstance } from 'axios'; export const useApiStore = defineStore('apiStore', { state: () => ({ dataStatuses: { + allData: Status.Data.Loading, connection: Status.Data.Loading, sceneries: Status.Data.Loading, vehicles: Status.Data.Loading, @@ -55,19 +56,21 @@ export const useApiStore = defineStore('apiStore', { window.requestAnimationFrame(this.updateTick); }, - updateTick(t: number) { + async updateTick(t: number) { // Static data refresh if (t >= this.nextDataCheckTime) { - this.fetchDonatorsData(); - this.fetchVehiclesInfo(); - this.fetchStationsGeneralInfo(); + await Promise.all([ + this.fetchStationsGeneralInfo(), + this.fetchVehiclesInfo(), + this.fetchDonatorsData() + ]); this.nextDataCheckTime = t + 3600000; } // Active data fefresh if (t >= this.nextUpdateTime) { - this.fetchActiveData(); + await this.fetchActiveData(); this.nextUpdateTime = t + 31000; } diff --git a/src/store/mainStore.ts b/src/store/mainStore.ts index d863e9c..8adc36d 100644 --- a/src/store/mainStore.ts +++ b/src/store/mainStore.ts @@ -29,9 +29,7 @@ export const useMainStore = defineStore('mainStore', { chosenModalTrainId: undefined, modalLastClickedTarget: null, - currentLocale: 'pl', - - isMigrateInfoCardOpen: false + currentLocale: 'pl' }) as MainStoreState, actions: { @@ -393,11 +391,13 @@ export const useMainStore = defineStore('mainStore', { const tracksKey = route.routeTracks == 2 ? 'double' : 'single'; const isElectric = route.isElectric; + const routesKey: keyof StationRoutes = `${tracksKey}${ !isElectric ? 'Other' : 'Electrified' - }Names`; + }${route.isInternal ? 'Internal' : ''}Names`; + + acc[routesKey].push(route.routeName); - if (!route.isInternal) acc[routesKey].push(route.routeName); if (route.isRouteSBL) acc['sblNames'].push(route.routeName); acc.minRouteSpeed = @@ -412,14 +412,21 @@ export const useMainStore = defineStore('mainStore', { return acc; }, { + all: [], single: [], + double: [], + singleElectrifiedNames: [], singleOtherNames: [], - double: [], doubleElectrifiedNames: [], doubleOtherNames: [], + + singleElectrifiedInternalNames: [], + singleOtherInternalNames: [], + doubleElectrifiedInternalNames: [], + doubleOtherInternalNames: [], + sblNames: [], - all: [], minRouteSpeed: 0, maxRouteSpeed: 0 } as StationRoutes diff --git a/src/store/typings.ts b/src/store/typings.ts index e7e9305..1a56d88 100644 --- a/src/store/typings.ts +++ b/src/store/typings.ts @@ -8,7 +8,6 @@ export interface MainStoreState { chosenModalTrainId?: string; modalLastClickedTarget: EventTarget | null; currentLocale: string; - isMigrateInfoCardOpen: boolean; } export interface StationJSONData { diff --git a/src/styles/_animations.scss b/src/styles/_animations.scss index f9db750..f93c46b 100644 --- a/src/styles/_animations.scss +++ b/src/styles/_animations.scss @@ -1,4 +1,4 @@ -$animDuration: 95ms; +$animDuration: 120ms; $animType: ease-in-out; // List animation diff --git a/src/typings/common.ts b/src/typings/common.ts index 684c030..ea98611 100644 --- a/src/typings/common.ts +++ b/src/typings/common.ts @@ -130,6 +130,12 @@ export interface StationRoutes { singleOtherNames: string[]; doubleElectrifiedNames: string[]; doubleOtherNames: string[]; + + singleElectrifiedInternalNames: string[]; + singleOtherInternalNames: string[]; + doubleElectrifiedInternalNames: string[]; + doubleOtherInternalNames: string[]; + sblNames: string[]; minRouteSpeed: number; @@ -241,4 +247,4 @@ export interface TooltipTrainInfo { headVehicleName: string; stockCount: number; trainTimetableCategory?: string; -} \ No newline at end of file +} diff --git a/src/views/SceneryView.vue b/src/views/SceneryView.vue index 767e293..590d7e8 100644 --- a/src/views/SceneryView.vue +++ b/src/views/SceneryView.vue @@ -196,6 +196,7 @@ function setViewMode(componentName: string) { display: grid; grid-template-rows: auto 1fr; gap: 1em; + } .scenery-actions { @@ -239,7 +240,7 @@ function setViewMode(componentName: string) { .scenery-view { height: auto; } - + .scenery-wrapper { grid-template-columns: 1fr; gap: 0; diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index 0f8717f..eb7ccc0 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -13,16 +13,6 @@