From df6d8d63d51a04fa13fd5b24599845a3dfc34de3 Mon Sep 17 00:00:00 2001 From: SooryaSoorya Date: Tue, 28 Apr 2020 22:10:15 +0300 Subject: [PATCH] ui changes --- src/app/loader/loader.component.scss | 2 +- src/app/movie/movie.component.html | 20 +++++++++++--------- src/app/movie/movie.component.scss | 8 +++++--- src/app/movie/movie.component.ts | 17 ++++++++++++++++- src/app/nav-menu/nav-menu.component.html | 5 ++--- src/app/search-bar/search-bar.component.html | 4 ++-- src/app/search-bar/search-bar.component.scss | 7 +++++++ src/assets/icons/calender.svg | 7 +++++++ 8 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 src/assets/icons/calender.svg diff --git a/src/app/loader/loader.component.scss b/src/app/loader/loader.component.scss index 19a8e9c..120d076 100644 --- a/src/app/loader/loader.component.scss +++ b/src/app/loader/loader.component.scss @@ -5,7 +5,7 @@ border-radius: 50%; width: 50px; height: 50px; - animation: spin 0.8s linear infinite; + animation: spin 1s linear infinite; margin: 20px auto; } diff --git a/src/app/movie/movie.component.html b/src/app/movie/movie.component.html index ec5961d..e3788b1 100644 --- a/src/app/movie/movie.component.html +++ b/src/app/movie/movie.component.html @@ -8,18 +8,19 @@ {{movies.length}} Movies -
- SORT BY: - + + +

diff --git a/src/app/movie/movie.component.scss b/src/app/movie/movie.component.scss index bb2931c..c99f2e4 100644 --- a/src/app/movie/movie.component.scss +++ b/src/app/movie/movie.component.scss @@ -110,12 +110,14 @@ .ngmp-movie-year { color: $grey; margin: 0; - margin-left: 34px; + margin-left: 70px; } .ngma-rateimg { - height: 16px; - position: relative; + height: 27px; + position: absolute; width: 25px; + margin-top: 0px; + margin-left: -30px; } .ngmp-noimageposter { text-align: center; diff --git a/src/app/movie/movie.component.ts b/src/app/movie/movie.component.ts index bd71631..588f05e 100644 --- a/src/app/movie/movie.component.ts +++ b/src/app/movie/movie.component.ts @@ -16,7 +16,7 @@ export class MovieComponent implements OnInit { public MOVIE_PROPS = MOVIE_PROPS; public loading: boolean; - sortBy: any = "id"; + sortBy: any = "Select"; public l = console.log; constructor(private movieService: MovieService) { @@ -44,4 +44,19 @@ export class MovieComponent implements OnInit { showLoading(loading: boolean) { this.loading = loading; } + + sortMovies() { + this.loading = true; + const sortValue = this.sortBy; + this.movies.sort((a: any, b: any) => { + if (a[sortValue] > b[sortValue]) { + return -1; + } else if (a[sortValue] < b[sortValue]) { + return 1; + } else { + return 0; + } + }); + this.loading = false; + } } diff --git a/src/app/nav-menu/nav-menu.component.html b/src/app/nav-menu/nav-menu.component.html index cb69d0c..695d305 100644 --- a/src/app/nav-menu/nav-menu.component.html +++ b/src/app/nav-menu/nav-menu.component.html @@ -2,9 +2,8 @@