mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
filtry pociągów
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
@@ -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",
|
||||
|
||||
@@ -11,6 +11,8 @@ export const enum TrainFilterType {
|
||||
|
||||
twr = 'twr',
|
||||
skr = 'skr',
|
||||
common = 'common',
|
||||
|
||||
passenger = 'passenger',
|
||||
freight = 'freight',
|
||||
other = 'other',
|
||||
|
||||
@@ -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 || '');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -202,10 +202,6 @@ button {
|
||||
pointer-events: none;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
&[data-inactive='true'] {
|
||||
opacity: 0.55;
|
||||
}
|
||||
}
|
||||
|
||||
button.btn--filled {
|
||||
|
||||
Reference in New Issue
Block a user