From 0d9a3f4b4f5f2e7c43bc08f5c0f538e904e6f471 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 6 Sep 2022 12:44:18 +0200 Subject: [PATCH 01/15] =?UTF-8?q?Rozszerzone=20opcje=20filtr=C3=B3w=20dzie?= =?UTF-8?q?nnik=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JournalView/JournalDispatchers.vue | 34 ++-- src/components/JournalView/JournalOptions.vue | 167 +++++++++++------- .../JournalView/JournalTimetables.vue | 30 ++-- src/styles/JournalSection.scss | 9 +- src/styles/global.scss | 17 +- src/styles/search_box.scss | 11 +- 6 files changed, 155 insertions(+), 113 deletions(-) diff --git a/src/components/JournalView/JournalDispatchers.vue b/src/components/JournalView/JournalDispatchers.vue index 96464e8..f6d8a8b 100644 --- a/src/components/JournalView/JournalDispatchers.vue +++ b/src/components/JournalView/JournalDispatchers.vue @@ -8,7 +8,7 @@ :sorter-option-ids="['timestampFrom', 'duration']" /> -
+
@@ -34,10 +34,10 @@
-
-
{{ $t('journal.no-further-data') }}
-
{{ $t('journal.loading-further-data') }}
+
{{ $t('journal.no-further-data') }}
+
{{ $t('journal.loading-further-data') }}
+ @@ -137,8 +137,6 @@ export default defineComponent({ this.searchersValues['search-dispatcher'] = this.dispatcherName?.toString() || ''; this.search(); } - - window.addEventListener('scroll', this.handleScroll); }, mounted() { @@ -147,27 +145,15 @@ export default defineComponent({ } }, - deactivated() { - window.removeEventListener('scroll', this.handleScroll); - }, - methods: { - closeDispatcherStatsCard() { - this.statsCardOpen = false; - }, + handleScroll(e: Event) { + const listElement = e.target as HTMLElement; + const scrollTop = listElement.scrollTop; + const elementHeight = listElement.scrollHeight - listElement.offsetHeight; - handleScroll() { - this.showReturnButton = window.scrollY > window.innerHeight; + if (!this.scrollDataLoaded || this.scrollNoMoreData || this.dataStatus != DataStatus.Loaded) return; - const element = this.$refs.scrollElement as HTMLElement; - - if ( - element.getBoundingClientRect().bottom * 0.85 < window.innerHeight && - this.scrollDataLoaded && - !this.scrollNoMoreData && - this.dataStatus == DataStatus.Loaded - ) - this.addHistoryData(); + if (scrollTop > elementHeight * 0.85) this.addHistoryData(); }, search() { diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 56b4f1a..e31e565 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -1,16 +1,30 @@ @@ -143,6 +136,19 @@ export default defineComponent({ @import '../../styles/search_box.scss'; @import '../../styles/variables.scss'; +.options-anim { + &-enter-from, + &-leave-to { + opacity: 0; + transform: translateY(10px); + } + + &-enter-active, + &-leave-active { + transition: all 150ms ease; + } +} + .bg { position: fixed; top: 0; @@ -155,8 +161,6 @@ export default defineComponent({ .journal-options { position: relative; - - margin-bottom: 0.5em; } .options_wrapper { diff --git a/src/components/TrainsView/TrainOptions.vue b/src/components/TrainsView/TrainOptions.vue index 94e305c..d7910c1 100644 --- a/src/components/TrainsView/TrainOptions.vue +++ b/src/components/TrainsView/TrainOptions.vue @@ -7,59 +7,51 @@ FILTRY -
-
-

{{ $t('options.sort-title') }}

- -
-
- + +
+
+

{{ $t('options.sort-title') }}

+
+
+ +
-
- -

{{ $t('options.filter-title') }}

- -
-
- +

{{ $t('options.filter-title') }}

+
+
+ +
-
- -
-
- +
+
+ +
+
+ +
- -
- -
-
- -

{{ $t('options.search-title') }}

- - -
+
@@ -145,6 +137,19 @@ export default defineComponent({ @import '../../styles/search_box.scss'; @import '../../styles/variables.scss'; +.options-anim { + &-enter-from, + &-leave-to { + opacity: 0; + transform: translateY(10px); + } + + &-enter-active, + &-leave-active { + transition: all 150ms ease; + } +} + .bg { position: fixed; top: 0; diff --git a/src/components/TrainsView/TrainTable.vue b/src/components/TrainsView/TrainTable.vue index b42ac36..ba1dc09 100644 --- a/src/components/TrainsView/TrainTable.vue +++ b/src/components/TrainsView/TrainTable.vue @@ -139,8 +139,6 @@ img.train-image { &-list { overflow: auto; - margin-top: 1em; - @include smallScreen() { width: 100%; } From 3d519e874fef0d39cee3aff2d18b74b9d9b37f28 Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 8 Sep 2022 23:24:58 +0200 Subject: [PATCH 06/15] =?UTF-8?q?Opcje=20filtr=C3=B3w:=20t=C5=82umaczenia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/JournalView/JournalOptions.vue | 17 +++++++---------- .../JournalView/JournalTimetables.vue | 2 +- src/components/TrainsView/TrainOptions.vue | 5 +++-- src/locales/en.json | 7 +++++-- src/locales/pl.json | 5 ++++- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 2ad5fc8..6f16f2e 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -10,7 +10,8 @@
-

SORTUJ WG:

+

{{ $t('options.sort-title') }}

+
-

FILTRUJ WG:

+ +

{{ $t('options.filter-title') }}

-

SZUKAJ:

+ +

{{ $t('options.search-title') }}

+

{{ $t('options.filter-title') }}

@@ -28,10 +29,10 @@
- +
- +

{{ $t('options.search-title') }}

diff --git a/src/locales/en.json b/src/locales/en.json index 9f954a8..d976578 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -84,7 +84,8 @@ "search-train": "Train no.", "search-driver": "Driver name", "search-dispatcher": "Dispatcher name", - "search-scenery": "Scenery name", + "search-station": "Scenery name", + "search-date": "Timetable date", "sort-mass": "mass", "sort-speed": "speed", @@ -107,7 +108,9 @@ "filter-freight": "FREIGHT", "filter-other": "OTHER", "filter-noTimetable": "NO TIMETABLE", - "filter-reset": "X RESET", + + "filter-reset": "RESET FILTERS", + "filter-clear": "CLEAR FILTERS", "filter-all": "ALL ENTRIES", "filter-abandoned": "ABANDONED", diff --git a/src/locales/pl.json b/src/locales/pl.json index 3aa31b5..7459d9d 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -87,6 +87,7 @@ "search-driver": "Nick maszynisty", "search-dispatcher": "Nick dyżurnego", "search-station": "Nazwa scenerii", + "search-date": "Data rozkładu jazdy", "sort-distance": "kilometraż", "sort-total-stops": "stacje", @@ -110,7 +111,9 @@ "filter-freight": "TOWAROWE", "filter-other": "INNE", "filter-noTimetable": "BEZ RJ", - "filter-reset": "X RESETUJ", + + "filter-reset": "ZRESETUJ FILTRY", + "filter-clear": "WYŁĄCZ FILTRY", "filter-all": "WSZYSTKIE", "filter-abandoned": "PORZUCONE", From 6c83ce90bf876531c3425d76e03b5219d5e95982 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 9 Sep 2022 00:23:18 +0200 Subject: [PATCH 07/15] Dodano filtrowanie po dacie w opcjach --- src/components/JournalView/JournalOptions.vue | 26 +++++++++++-------- .../JournalView/JournalTimetables.vue | 8 +++--- src/styles/search_box.scss | 9 ++++--- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 6f16f2e..26398ac 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -35,17 +35,21 @@

{{ $t('options.search-title') }}