filtry pociągów

This commit is contained in:
2023-03-15 17:56:27 +01:00
parent 0a78761928
commit e4c5f6a322
8 changed files with 27 additions and 15 deletions
+6 -2
View File
@@ -195,13 +195,17 @@ export default defineComponent({
display: flex;
width: 100%;
gap: 0.25em;
gap: 0.5em;
margin-bottom: 0.5em;
button {
width: 100%;
color: $accentCol;
color: springgreen;
font-weight: bold;
&[data-inactive=true] {
color: #aaa;
}
}
}
@@ -12,6 +12,11 @@ export const trainFilters: TrainFilter[] = [
section: TrainFilterSection.TRAIN_TYPE,
isActive: true,
},
{
id: TrainFilterType.common,
section: TrainFilterSection.TRAIN_TYPE,
isActive: true,
},
{
id: TrainFilterType.passenger,
+1
View File
@@ -116,6 +116,7 @@
"filter-withComments": "COMMENTS",
"filter-twr": "HIGH RISK CARGO",
"filter-skr": "EXCEEDED GAUGE",
"filter-common": "NO WARNINGS",
"filter-passenger": "PASSENGER",
"filter-freight": "FREIGHT",
"filter-other": "OTHER",
+3 -2
View File
@@ -117,8 +117,9 @@
"filter-withComments": "UWAGI EKSPLOATACYJNE",
"filter-noComments": "BEZ UWAG",
"filter-twr": "WYSOKIEGO RYZYKA",
"filter-skr": "PRZEKR. SKRAJNIA",
"filter-twr": "WYS. RYZYKA",
"filter-skr": "SKRAJNIA",
"filter-common": "ZWYKŁE",
"filter-passenger": "PASAŻERSKIE",
"filter-freight": "TOWAROWE",
"filter-other": "INNE",
+2
View File
@@ -11,6 +11,8 @@ export const enum TrainFilterType {
twr = 'twr',
skr = 'skr',
common = 'common',
passenger = 'passenger',
freight = 'freight',
other = 'other',
+9 -6
View File
@@ -31,17 +31,20 @@ function filterTrainList(trainList: Train[], searchedTrain: string, searchedDriv
case TrainFilterType.withTimetable:
return !train.timetableData;
case TrainFilterType.noComments:
return train.timetableData?.followingStops.some((stop) => stop.comments) || false;
case TrainFilterType.withComments:
return train.timetableData?.followingStops.every((stop) => stop.comments) || true;
return !train.timetableData?.followingStops.some((stop) => stop.comments);
case TrainFilterType.noComments:
return train.timetableData?.followingStops.some((stop) => stop.comments);
case TrainFilterType.twr:
return !train.timetableData?.TWR || true;
return !train.timetableData?.TWR;
case TrainFilterType.skr:
return !train.timetableData?.SKR || true;
return !train.timetableData?.SKR;
case TrainFilterType.common:
return train.timetableData?.SKR || train.timetableData?.TWR;
case TrainFilterType.passenger:
return !/^[AMRE]\D{2}$/.test(train.timetableData?.category || '');
+1 -1
View File
@@ -67,7 +67,7 @@ h1.option-title {
box-shadow: 0 5px 10px 2px #0f0f0f;
width: 97%;
max-width: 500px;
max-width: 550px;
padding: 1em;
z-index: 100;
-4
View File
@@ -202,10 +202,6 @@ button {
pointer-events: none;
opacity: 0.85;
}
&[data-inactive='true'] {
opacity: 0.55;
}
}
button.btn--filled {