Skip to content

Commit

Permalink
Merge pull request #170 from Kleostro/fix/tu-02-50/adaptive
Browse files Browse the repository at this point in the history
fix(tu-02-50): adaptive on the search page
  • Loading branch information
Kleostro authored Aug 29, 2024
2 parents 824b681 + 60a53c2 commit 8a780a6
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
display: flex;
flex-direction: column;
gap: 1rem;
width: 100%;
}

.deleteRouteWrapper {
Expand Down
2 changes: 0 additions & 2 deletions src/app/home/components/filter/filter.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

.filter-container {
width: 100%;
max-width: 90%;
margin: $offset-xs auto 0 auto;
}

.from-to-title {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@
background: $gray-100;
border: $three solid $gray-400;
border-radius: $border-radius-s;

@media (width <=1024px) {
flex-direction: column;
}
}

.item {
width: 50%;

@media (width <=1024px) {
width: 100%;
}
}

.carriages-info {
Expand All @@ -26,6 +34,13 @@
justify-content: flex-end;

padding: $offset-xxs;

@media (width <=1024px) {
overflow-x: scroll;
flex-flow: unset;
justify-content: start;
width: 100%;
}
}

.carriage-info {
Expand Down Expand Up @@ -61,13 +76,13 @@
}

.carriage-free-seats {
font-size: $font-size-s;
font-size: 1rem;
font-style: italic;
color: $gray-700;
}

.carriage-price {
font-size: $font-size-m;
font-size: 1.2rem;
font-weight: bold;
color: $main-color;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p-timeline [value]="events" layout="horizontal" align="top" class="timeline">
<p-timeline [value]="events" [layout]="windowWidth <= 768 ? 'vertical' : 'horizontal'" align="top" class="timeline">
<ng-template pTemplate="marker" let-event>
<span class="marker" [class]="event.duration ? 'custom-marker' : 'time-marker'">{{
event.duration ? event.duration : (event.date | date: 'HH:mm')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
@import 'variables';

::ng-deep .p-timeline {
align-items: flex-start;
@media (width <=768px) {
align-items: flex-start;
align-self: center;

width: max-content;
margin-right: auto;
margin-bottom: 1rem;
}
}

::ng-deep .p-timeline-event-opposite,
.p-timeline-event-content {
@media (width <=768px) {
display: none;
}
}

.marker {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DatePipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, HostListener, Input, OnInit } from '@angular/core';

import { TimelineModule } from 'primeng/timeline';

Expand All @@ -21,6 +21,14 @@ export class TripTimelineComponent implements OnInit {
@Input() public startStation = '';
@Input() public endStation = '';
@Input() public dateFormat = 'dd-MMM-yyyy';
public windowWidth = window.innerWidth;

@HostListener('window:resize', ['$event'])
public onResize(event: Event): void {
if (event.target instanceof Window) {
this.windowWidth = event.target.innerWidth;
}
}

public events: TimelineEvent[] = [];

Expand Down

0 comments on commit 8a780a6

Please sign in to comment.