diff --git a/package.json b/package.json index 7f502d4..bff377b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.10.3", + "version": "1.10.4", "private": true, "scripts": { "dev": "vite", diff --git a/src/components/JournalView/JournalDispatchers.vue b/src/components/JournalView/JournalDispatchers.vue index 96464e8..368c5c4 100644 --- a/src/components/JournalView/JournalDispatchers.vue +++ b/src/components/JournalView/JournalDispatchers.vue @@ -2,48 +2,55 @@
-
- -
- +
+ + + -
- {{ $t('app.error') }} -
+
+ {{ $t('app.error') }} +
-
- {{ $t('app.no-result') }} -
+
+ {{ $t('app.no-result') }} +
-
- +
+ - -
-
- + +
+ + +
+ {{ $t('journal.no-further-data') }} +
+ +
+ {{ $t('journal.loading-further-data') }} +
- -
{{ $t('journal.no-further-data') }}
-
{{ $t('journal.loading-further-data') }}
+ \ No newline at end of file diff --git a/src/components/JournalView/JournalTimetables.vue b/src/components/JournalView/JournalTimetables.vue index d8c498b..40557fd 100644 --- a/src/components/JournalView/JournalTimetables.vue +++ b/src/components/JournalView/JournalTimetables.vue @@ -6,54 +6,58 @@
-
- -
- +
+ + + -
- {{ $t('app.error') }} -
+
+ {{ $t('app.error') }} +
-
- {{ $t('app.no-result') }} -
+
+ {{ $t('app.no-result') }} +
-
- +
+ - -
-
- + +
+ + + +
{{ $t('journal.no-further-data') }}
+
{{ $t('journal.loading-further-data') }}
- -
{{ $t('journal.no-further-data') }}
-
{{ $t('journal.loading-further-data') }}
diff --git a/src/components/TrainsView/TrainOptionsCard.vue b/src/components/TrainsView/TrainOptionsCard.vue deleted file mode 100644 index 0183d02..0000000 --- a/src/components/TrainsView/TrainOptionsCard.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - - diff --git a/src/components/TrainsView/TrainTable.vue b/src/components/TrainsView/TrainTable.vue index b42ac36..a68b28b 100644 --- a/src/components/TrainsView/TrainTable.vue +++ b/src/components/TrainsView/TrainTable.vue @@ -118,11 +118,10 @@ export default defineComponent({ text-align: center; padding: 1em 0; - margin: 1em 0; font-size: 1.5em; - background: #333; + background: #1a1a1a; } img.train-image { @@ -139,8 +138,6 @@ img.train-image { &-list { overflow: auto; - margin-top: 1em; - @include smallScreen() { width: 100%; } @@ -197,4 +194,4 @@ img.train-image { text-align: center; } } - + \ No newline at end of file diff --git a/src/constants/Journal/JournalTimetablesConsts.ts b/src/constants/Journal/JournalTimetablesConsts.ts new file mode 100644 index 0000000..d969b7f --- /dev/null +++ b/src/constants/Journal/JournalTimetablesConsts.ts @@ -0,0 +1,28 @@ +import { JournalFilterType } from "../../scripts/enums/JournalFilterType"; +import { JournalTimetableFilter } from "../../types/Journal/JournalTimetablesTypes"; + +export const journalTimetableFilters: JournalTimetableFilter[] = [ + { + id: JournalFilterType.all, + filterSection: 'timetable-status', + isActive: true, + }, + + { + id: JournalFilterType.active, + filterSection: 'timetable-status', + isActive: false, + }, + + { + id: JournalFilterType.fulfilled, + filterSection: 'timetable-status', + isActive: false, + }, + + { + id: JournalFilterType.abandoned, + filterSection: 'timetable-status', + isActive: false, + }, +]; diff --git a/src/data/trainOptions.ts b/src/constants/Trains/TrainOptionsConsts.ts similarity index 79% rename from src/data/trainOptions.ts rename to src/constants/Trains/TrainOptionsConsts.ts index 852422d..641f472 100644 --- a/src/data/trainOptions.ts +++ b/src/constants/Trains/TrainOptionsConsts.ts @@ -1,60 +1,60 @@ -import { TrainFilter } from "vue"; -import { TrainFilterType } from "../scripts/enums/TrainFilterType"; - -export const trainFilters: TrainFilter[] = [ - { - id: TrainFilterType.twr, - isActive: true, - }, - { - id: TrainFilterType.skr, - isActive: true, - }, - { - id: TrainFilterType.passenger, - isActive: true, - }, - { - id: TrainFilterType.freight, - isActive: true, - }, - { - id: TrainFilterType.other, - isActive: true, - }, - { - id: TrainFilterType.comments, - isActive: true, - }, - { - id: TrainFilterType.noTimetable, - isActive: true, - }, -]; - -export const sorterOptions = [ - { - id: 'distance', - value: 'kilometraż', - }, - { - id: 'progress', - value: 'przebyta trasa', - }, - { - id: 'delay', - value: 'opóźnienie', - }, - { - id: 'mass', - value: 'masa', - }, - { - id: 'speed', - value: 'prędkość', - }, - { - id: 'length', - value: 'długość', - } -]; \ No newline at end of file +import { TrainFilterType } from '../../scripts/enums/TrainFilterType'; +import { TrainFilter } from '../../types/Trains/TrainOptionsTypes'; + +export const trainFilters: TrainFilter[] = [ + { + id: TrainFilterType.twr, + isActive: true, + }, + { + id: TrainFilterType.skr, + isActive: true, + }, + { + id: TrainFilterType.passenger, + isActive: true, + }, + { + id: TrainFilterType.freight, + isActive: true, + }, + { + id: TrainFilterType.other, + isActive: true, + }, + { + id: TrainFilterType.comments, + isActive: true, + }, + { + id: TrainFilterType.noTimetable, + isActive: true, + }, +]; + +export const sorterOptions = [ + { + id: 'distance', + value: 'kilometraż', + }, + { + id: 'progress', + value: 'przebyta trasa', + }, + { + id: 'delay', + value: 'opóźnienie', + }, + { + id: 'mass', + value: 'masa', + }, + { + id: 'speed', + value: 'prędkość', + }, + { + id: 'length', + value: 'długość', + }, +]; diff --git a/src/data/journalFilters.ts b/src/data/journalFilters.ts deleted file mode 100644 index 4f1e25e..0000000 --- a/src/data/journalFilters.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { JournalFilter } from "vue"; -import { JournalFilterType } from "../scripts/enums/JournalFilterType"; - -export const journalTimetableFilters: JournalFilter[] = [ - { - id: JournalFilterType.all, - filterSection: "timetable-status", - isActive: true - }, - - { - id: JournalFilterType.active, - filterSection: "timetable-status", - isActive: false - }, - - { - id: JournalFilterType.fulfilled, - filterSection: "timetable-status", - isActive: false - }, - - { - id: JournalFilterType.abandoned, - filterSection: "timetable-status", - isActive: false - }, -] - -export const journalDispatcherFilters: JournalFilter[] = [] \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 39b35f9..96bc5c4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -11,10 +11,10 @@ "migration-confirm": "Roger that!" }, "update": { - "title": "New Stacjownik version is available!", - "paragraph1": "Enjoy the application and may the green signal be with you!", - "release-link": "Click here to browse version changelog (GitHub)", - "confirm-button": "Understood!" + "title": "New Stacjownik version is available!", + "paragraph1": "Enjoy the application and may the green signal be with you!", + "release-link": "Click here to browse version changelog (GitHub)", + "confirm-button": "Understood!" }, "data-status": { "S1a-connection": "S1a signal
Cannot connect with Stacjownik API service!", @@ -72,7 +72,51 @@ }, "options": { "filters": "FILTERS", - "donate": "DONATE" + "donate": "DONATE", + + "search-button": "Search", + "reset-button": "Reset", + + "sort-title": "SORT BY:", + "filter-title": "FILTER BY:", + "search-title": "SEARCH:", + + "search-train-no": "Train no. / #", + "search-train": "Train no.", + "search-driver": "Driver name", + "search-dispatcher": "Dispatcher name", + "search-station": "Scenery name", + "search-date": "Timetable date (CEST / GMT+2)", + + "sort-mass": "mass", + "sort-speed": "speed", + "sort-length": "length", + "sort-distance": "distance", + "sort-timetable": "train no.", + "sort-progress": "route progress", + "sort-delay": "current delay", + + "sort-total-stops": "total stops", + "sort-beginDate": "date", + "sort-timetableId": "timetable ID", + "sort-timestampFrom": "date", + "sort-duration": "duration", + + "filter-comments": "COMMENTS", + "filter-twr": "TWR", + "filter-skr": "SKR", + "filter-passenger": "PASSENGER", + "filter-freight": "FREIGHT", + "filter-other": "OTHER", + "filter-noTimetable": "NO TIMETABLE", + + "filter-reset": "RESET FILTERS", + "filter-clear": "CLEAR FILTERS", + + "filter-all": "ALL ENTRIES", + "filter-abandoned": "ABANDONED", + "filter-fulfilled": "FULFILLED", + "filter-active": "ACTIVE" }, "filters": { "endingStatus": "ENDS SOON", @@ -116,7 +160,7 @@ "hour": "h", "no-limit": "NO LIMIT", "include-selected": "INCLUDE SELECTED", - "save": "↵ SAVE FILTERS", + "save": "SAVE FILTERS", "reset": "RESET FILTERS", "close": "CLOSE FILTERS" }, @@ -150,28 +194,6 @@ "current-signal": "at signal", "current-track": "on track", - "option-mass": "mass", - "option-speed": "speed", - "option-length": "length", - "option-distance": "distance", - "option-timetable": "train no.", - "option-progress": "route progress", - "option-delay": "current delay", - "option-comments": "comments", - - "filter-comments": "comments", - "filter-twr": "TWR", - "filter-skr": "SKR", - "filter-passenger": "passenger", - "filter-freight": "freight", - "filter-other": "other", - "filter-noTimetable": "no timetable", - "filter-reset": "X RESET", - - "sorter-prefix": "Sort: ", - "search-train": "Train no.", - "search-driver": "Driver name", - "delayed": "Delayed: ", "preponed": "Ahead of schedule: ", "on-time": "On time", @@ -205,26 +227,6 @@ "section-timetables": "TIMETABLES", "section-dispatchers": "DISPATCHERS", - "search": "Search", - "search-train": "Train no. / #", - "search-driver": "Driver name", - "search-dispatcher": "Dispatcher name", - "search-station": "Scenery name", - - "sort-prefix": "Sort: ", - - "option-distance": "distance", - "option-total-stops": "total stops", - "option-beginDate": "date", - "option-timetableId": "timetable ID", - "option-timestampFrom": "date", - "option-duration": "duration", - - "filter-all": "ALL ENTRIES", - "filter-abandoned": "ABANDONED", - "filter-fulfilled": "FULFILLED", - "filter-active": "ACTIVE", - "no-further-data": "No further data for current parameters", "loading-further-data": "Loading...", diff --git a/src/locales/pl.json b/src/locales/pl.json index c3343dc..c75c24b 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -74,7 +74,52 @@ }, "options": { "filters": "FILTRY", - "donate": "WESPRZYJ" + "donate": "WESPRZYJ", + + "search-button": "Szukaj", + "reset-button": "Zresetuj", + + "sort-title": "SORTUJ WG:", + "filter-title": "FILTRUJ WG:", + "search-title": "SZUKAJ:", + + "search-train-no": "Nr pociągu", + "search-train": "Nr pociągu / #", + "search-driver": "Nick maszynisty", + "search-dispatcher": "Nick dyżurnego", + "search-station": "Nazwa scenerii", + "search-date": "Data rozkładu jazdy (czas polski)", + + "sort-distance": "kilometraż", + "sort-total-stops": "stacje", + "sort-beginDate": "data", + "sort-timetableId": "ID rozkładu", + "sort-timestampFrom": "data", + "sort-duration": "czas dyżuru", + + "sort-mass": "masa", + "sort-speed": "prędkość", + "sort-length": "długość", + "sort-timetable": "nr pociągu", + "sort-progress": "przebyta trasa", + "sort-delay": "opóźnienie", + "sort-comments": "uwagi ekspl.", + + "filter-comments": "UWAGI EKSPLOATACYJNE", + "filter-twr": "TWR", + "filter-skr": "PRZEKR. SKRAJNIA", + "filter-passenger": "PASAŻERSKIE", + "filter-freight": "TOWAROWE", + "filter-other": "INNE", + "filter-noTimetable": "BEZ RJ", + + "filter-reset": "ZRESETUJ FILTRY", + "filter-clear": "WYŁĄCZ FILTRY", + + "filter-all": "WSZYSTKIE", + "filter-abandoned": "PORZUCONE", + "filter-fulfilled": "WYPEŁNIONE", + "filter-active": "AKTYWNE" }, "filters": { "endingStatus": "KOŃCZY", @@ -152,28 +197,6 @@ "current-signal": "przy semaforze", "current-track": "na szlaku", - "option-mass": "masa", - "option-speed": "prędkość", - "option-length": "długość", - "option-distance": "kilometraż", - "option-timetable": "nr pociągu", - "option-progress": "przebyta trasa", - "option-delay": "opóźnienie", - "option-comments": "uwagi ekspl.", - - "filter-comments": "uwagi ekspl.", - "filter-twr": "TWR", - "filter-skr": "SKR", - "filter-passenger": "pasażerskie", - "filter-freight": "towarowe", - "filter-other": "inne", - "filter-noTimetable": "bez RJ", - "filter-reset": "X RESETUJ", - - "sorter-prefix": "Sortuj: ", - "search-train": "Numer pociągu", - "search-driver": "Nick maszynisty", - "delayed": "Opóźniony: ", "preponed": "Przed czasem: ", "on-time": "Planowo", @@ -207,26 +230,6 @@ "section-timetables": "ROZKŁADY JAZDY", "section-dispatchers": "DYŻURNI", - "search": "Szukaj", - "search-train": "Nr pociągu / #", - "search-driver": "Nick maszynisty", - "search-dispatcher": "Nick dyżurnego", - "search-station": "Nazwa scenerii", - - "sort-prefix": "Sortuj: ", - - "option-distance": "kilometraż", - "option-total-stops": "stacje", - "option-beginDate": "data", - "option-timetableId": "ID rozkładu", - "option-timestampFrom": "data", - "option-duration": "czas dyżuru", - - "filter-all": "WSZYSTKIE", - "filter-abandoned": "PORZUCONE", - "filter-fulfilled": "WYPEŁNIONE", - "filter-active": "AKTYWNE", - "no-further-data": "Brak dalszych wyników dla podanych parametrów", "loading-further-data": "Ładowanie...", diff --git a/src/scripts/managers/trainFilterManager.ts b/src/scripts/managers/trainFilterManager.ts index ded5115..a006e96 100644 --- a/src/scripts/managers/trainFilterManager.ts +++ b/src/scripts/managers/trainFilterManager.ts @@ -1,115 +1,115 @@ -import { TrainFilter } from "vue"; -import { TrainFilterType } from "../enums/TrainFilterType"; -import Train from "../interfaces/Train"; -import TrainStop from "../interfaces/TrainStop"; - -function confirmedPercentage(stops: TrainStop[] | undefined) { - if (!stops) return -1; - - return Number(((stops.filter((stop) => stop.confirmed).length / stops.length) * 100).toFixed(0)); -}; - -function currentDelay(stops: TrainStop[] | undefined) { - if (!stops) return -Infinity; - - const delay = - stops.find((stop, i) => (i == 0 && !stop.confirmed) || (i > 0 && stops[i - 1].confirmed && !stop.confirmed)) - ?.departureDelay || 0; - - return delay; -}; - -function filterTrainList(trainList: Train[], searchedTrain: string, searchedDriver: string, filters: TrainFilter[]) { - return trainList.filter( - (train) => { - const isFiltered = filters.every(f => { - if (f.isActive) return true; - - if (!train.timetableData) return filters.find(filter => filter.id == TrainFilterType.noTimetable)!.isActive; - - switch (f.id) { - case TrainFilterType.comments: - return !train.timetableData.followingStops.some(stop => stop.comments); - - case TrainFilterType.twr: - return !train.timetableData.TWR; - - case TrainFilterType.skr: - return !train.timetableData.SKR; - - case TrainFilterType.passenger: - return !/^[AMRE]\D{2}$/.test(train.timetableData.category); - - case TrainFilterType.freight: - return !train.timetableData.category.startsWith('T'); - - case TrainFilterType.other: - return !/^[PXZL]\D{2}$/.test(train.timetableData.category); - - default: - return true; - } - }) - - return (searchedTrain.length > 0 ? train.trainNo.toString().startsWith(searchedTrain) : true) && - (searchedDriver.length > 0 ? train.driverName.toLowerCase().startsWith(searchedDriver.toLowerCase()) : true) && isFiltered - } - - ); -} - -function sortTrainList(trainList: Train[], sorterActive: { id: string; dir: number }) { - return trainList.sort((a: Train, b: Train) => { - switch (sorterActive.id) { - case 'mass': - if (a.mass > b.mass) return sorterActive.dir; - return -sorterActive.dir; - - case 'distance': - if ((a.timetableData?.routeDistance || -1) > (b.timetableData?.routeDistance || -1)) return sorterActive.dir; - - return -sorterActive.dir; - - case 'progress': - if (confirmedPercentage(a.timetableData?.followingStops) > confirmedPercentage(b.timetableData?.followingStops)) - return sorterActive.dir; - - return -sorterActive.dir; - - case 'delay': - if (currentDelay(a.timetableData?.followingStops) > currentDelay(b.timetableData?.followingStops)) - return sorterActive.dir; - - return -sorterActive.dir; - - case 'speed': - if (a.speed > b.speed) return sorterActive.dir; - return -sorterActive.dir; - - case 'timetable': - if (a.trainNo > b.trainNo) return sorterActive.dir; - return -sorterActive.dir; - - case 'length': - if (a.length > b.length) return sorterActive.dir; - return -sorterActive.dir; - - default: - break; - } - - return 0; - }); -} - -export function filteredTrainList( - trainList: Train[], - searchedTrain: string, - searchedDriver: string, - sorterActive: { id: string; dir: number }, - filters: TrainFilter[] -) { - - const filtered = filterTrainList(trainList, searchedTrain, searchedDriver, filters); - return [...sortTrainList(filtered, sorterActive)]; +import { TrainFilter } from "../../types/Trains/TrainOptionsTypes"; +import { TrainFilterType } from "../enums/TrainFilterType"; +import Train from "../interfaces/Train"; +import TrainStop from "../interfaces/TrainStop"; + +function confirmedPercentage(stops: TrainStop[] | undefined) { + if (!stops) return -1; + + return Number(((stops.filter((stop) => stop.confirmed).length / stops.length) * 100).toFixed(0)); +}; + +function currentDelay(stops: TrainStop[] | undefined) { + if (!stops) return -Infinity; + + const delay = + stops.find((stop, i) => (i == 0 && !stop.confirmed) || (i > 0 && stops[i - 1].confirmed && !stop.confirmed)) + ?.departureDelay || 0; + + return delay; +}; + +function filterTrainList(trainList: Train[], searchedTrain: string, searchedDriver: string, filters: TrainFilter[]) { + return trainList.filter( + (train) => { + const isFiltered = filters.every(f => { + if (f.isActive) return true; + + if (!train.timetableData) return filters.find(filter => filter.id == TrainFilterType.noTimetable)!.isActive; + + switch (f.id) { + case TrainFilterType.comments: + return !train.timetableData.followingStops.some(stop => stop.comments); + + case TrainFilterType.twr: + return !train.timetableData.TWR; + + case TrainFilterType.skr: + return !train.timetableData.SKR; + + case TrainFilterType.passenger: + return !/^[AMRE]\D{2}$/.test(train.timetableData.category); + + case TrainFilterType.freight: + return !train.timetableData.category.startsWith('T'); + + case TrainFilterType.other: + return !/^[PXZL]\D{2}$/.test(train.timetableData.category); + + default: + return true; + } + }) + + return (searchedTrain.length > 0 ? train.trainNo.toString().startsWith(searchedTrain) : true) && + (searchedDriver.length > 0 ? train.driverName.toLowerCase().startsWith(searchedDriver.toLowerCase()) : true) && isFiltered + } + + ); +} + +function sortTrainList(trainList: Train[], sorterActive: { id: string; dir: number }) { + return trainList.sort((a: Train, b: Train) => { + switch (sorterActive.id) { + case 'mass': + if (a.mass > b.mass) return sorterActive.dir; + return -sorterActive.dir; + + case 'distance': + if ((a.timetableData?.routeDistance || -1) > (b.timetableData?.routeDistance || -1)) return sorterActive.dir; + + return -sorterActive.dir; + + case 'progress': + if (confirmedPercentage(a.timetableData?.followingStops) > confirmedPercentage(b.timetableData?.followingStops)) + return sorterActive.dir; + + return -sorterActive.dir; + + case 'delay': + if (currentDelay(a.timetableData?.followingStops) > currentDelay(b.timetableData?.followingStops)) + return sorterActive.dir; + + return -sorterActive.dir; + + case 'speed': + if (a.speed > b.speed) return sorterActive.dir; + return -sorterActive.dir; + + case 'timetable': + if (a.trainNo > b.trainNo) return sorterActive.dir; + return -sorterActive.dir; + + case 'length': + if (a.length > b.length) return sorterActive.dir; + return -sorterActive.dir; + + default: + break; + } + + return 0; + }); +} + +export function filteredTrainList( + trainList: Train[], + searchedTrain: string, + searchedDriver: string, + sorterActive: { id: string; dir: number }, + filters: TrainFilter[] +) { + + const filtered = filterTrainList(trainList, searchedTrain, searchedDriver, filters); + return [...sortTrainList(filtered, sorterActive)]; }; \ No newline at end of file diff --git a/src/styles/JournalSection.scss b/src/styles/JournalSection.scss index 6be3530..bd946df 100644 --- a/src/styles/JournalSection.scss +++ b/src/styles/JournalSection.scss @@ -8,16 +8,24 @@ } &-enter-active { - transition: all 150ms ease-out; + transition: all 150ms 100ms ease-out; } &-leave-active { - transition: all 150ms ease-out; + transition: all 150ms 100ms ease-out; } } //Styles +.list_wrapper { + overflow-y: scroll; + height: 90vh; + min-height: 550px; + + padding-right: 0.2em; +} + .journal_wrapper { max-width: 1350px; width: 100%; @@ -40,9 +48,9 @@ .journal_item, .journal_warning { - background: #202020; + background-color: #1a1a1a; padding: 1em; - margin: 1em 0; + margin-bottom: 1em; } .journal_top-bar { @@ -69,3 +77,9 @@ flex-wrap: wrap; } } + +@media (orientation: landscape) { + .journal_wrapper { + font-size: 1em; + } +} diff --git a/src/styles/global.scss b/src/styles/global.scss index 8f800b2..db20d16 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -12,6 +12,24 @@ --clr-error: #df3e3e; --clr-warning: #c59429; + + font-size: 16px; +} + +::-webkit-scrollbar { + width: 1rem; + height: 1rem; + background-color: transparent; + + &-track { + border-radius: 0.5em; + background-color: #333; + } + + &-thumb { + border-radius: 0.5em; + background-color: #666; + } } html { @@ -36,28 +54,6 @@ body { } } -*:focus-visible { - outline: 1px solid white; - outline-offset: 1px; -} - -:root { - font-size: 16px; -} - -::-webkit-scrollbar { - width: 1rem; - height: 1rem; - - &-track { - background-color: #222; - } - - &-thumb { - background-color: #777; - } -} - .g-tooltip { position: relative; @@ -113,7 +109,6 @@ select { } input { - border: 1px solid white; background: none; color: white; font-size: 1em; @@ -190,6 +185,16 @@ ul { } } +button { + cursor: pointer; + + color: white; + background-color: #333; + + border-radius: 0.25em; + padding: 0.25em 0.5em; +} + .btn { background: none; cursor: pointer; @@ -211,8 +216,18 @@ ul { } &--image { - color: white; - transition: color 0.3s; + display: flex; + + padding: 0.4em 1em; + font-weight: bold; + font-size: 1em; + + border-radius: 0.75em 0.75em 0 0; + + img { + height: 1.3em; + margin-right: 0.5em; + } } &--option { @@ -224,10 +239,6 @@ ul { border-radius: 0.25em; padding: 0.25em 0.5em; - &:hover:not(:disabled) { - background-color: #3c3c3c; - } - &.checked { color: var(--clr-primary); font-weight: bold; diff --git a/src/styles/search_box.scss b/src/styles/search_box.scss index e74da0d..e3848d5 100644 --- a/src/styles/search_box.scss +++ b/src/styles/search_box.scss @@ -1,6 +1,12 @@ @import 'responsive.scss'; .search { + label { + display: block; + color: #ccc; + margin-bottom: 0.25em; + } + &-box { position: relative; @@ -9,7 +15,6 @@ border-radius: 0.5em; min-width: 200px; margin-right: 0.25em; - background-color: #333; } &-input { @@ -18,7 +23,6 @@ background-color: #333; padding: 0.35em 0.5em; - margin-right: 0.2em; width: 100%; } @@ -33,6 +37,11 @@ } } + &-button { + width: 80%; + max-width: 300px; + } + @include smallScreen { &-box, &-button { @@ -42,10 +51,5 @@ &-box { width: 100%; } - - &-button { - width: 80%; - max-width: 300px; - } } } diff --git a/src/types/Journal/JournalDispatcherTypes.ts b/src/types/Journal/JournalDispatcherTypes.ts new file mode 100644 index 0000000..2c101e4 --- /dev/null +++ b/src/types/Journal/JournalDispatcherTypes.ts @@ -0,0 +1,8 @@ +export type JournalDispatcherSearcher = { + [key in 'search-dispatcher' | 'search-station' | 'search-date']: string; +}; + +export interface JournalDispatcherSorter { + id: 'timestampFrom' | 'duration'; + dir: -1 | 1; +} \ No newline at end of file diff --git a/src/types/Journal/JournalTimetablesTypes.ts b/src/types/Journal/JournalTimetablesTypes.ts new file mode 100644 index 0000000..c38d3f4 --- /dev/null +++ b/src/types/Journal/JournalTimetablesTypes.ts @@ -0,0 +1,16 @@ +import { JournalFilterType } from '../../scripts/enums/JournalFilterType'; + +export type JorunalTimetableSearchType = { + [key in 'search-driver' | 'search-train' | 'search-date']: string; +}; + +export interface JournalTimetableFilter { + id: JournalFilterType; + filterSection: string; + isActive: boolean; +} + +export interface JournalTimetableSorter { + id: 'timetableId' | 'beginDate' | 'distance' | 'total-stops'; + dir: -1 | 1; +} diff --git a/src/types/JournalDispatcherTypes.ts b/src/types/JournalDispatcherTypes.ts deleted file mode 100644 index abfd4a3..0000000 --- a/src/types/JournalDispatcherTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type JournalDispatcherSearcher = { - [key in 'search-dispatcher' | 'search-station']: string; -}; diff --git a/src/types/JournalTimetablesTypes.ts b/src/types/JournalTimetablesTypes.ts deleted file mode 100644 index 0805257..0000000 --- a/src/types/JournalTimetablesTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type JournalTimetableSearcher = { - [key in 'search-driver' | 'search-train']: string; -}; diff --git a/src/types/Trains/TrainOptionsTypes.ts b/src/types/Trains/TrainOptionsTypes.ts new file mode 100644 index 0000000..b9db0a3 --- /dev/null +++ b/src/types/Trains/TrainOptionsTypes.ts @@ -0,0 +1,6 @@ +import { TrainFilterType } from "../../scripts/enums/TrainFilterType"; + +export interface TrainFilter { + id: TrainFilterType; + isActive: boolean; +} \ No newline at end of file diff --git a/src/views/TrainsView.vue b/src/views/TrainsView.vue index 5e52fa9..a3225d8 100644 --- a/src/views/TrainsView.vue +++ b/src/views/TrainsView.vue @@ -2,7 +2,7 @@
- +
@@ -11,14 +11,15 @@ @@ -102,5 +97,4 @@ export default defineComponent({ margin: 1rem auto; max-width: 1350px; } - diff --git a/src/vuex.d.ts b/src/vuex.d.ts deleted file mode 100644 index 5d99612..0000000 --- a/src/vuex.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ComponentCustomProperties } from 'vue' -import { Store } from 'vuex' -import { JournalFilterType } from './scripts/enums/JournalFilterType'; -import { TrainFilterType } from './scripts/enums/TrainFilterType'; - -declare module '@vue/runtime-core' { - // declare your own store states - interface State { - count: number - } - - // provide typings for `this.$store` - interface ComponentCustomProperties { - $store: Store - } - - // Train filter for TrainView - interface TrainFilter { - id: TrainFilterType; - isActive: boolean; - } - - interface JournalFilter { - id: JournalFilterType; - filterSection: string; - isActive: boolean; - } - - -} \ No newline at end of file