diff --git a/frontend/src/app/features/cards/main-card/main-card.component.html b/frontend/src/app/features/cards/main-card/main-card.component.html index 7079ca2..b4785f2 100644 --- a/frontend/src/app/features/cards/main-card/main-card.component.html +++ b/frontend/src/app/features/cards/main-card/main-card.component.html @@ -1,8 +1,8 @@ -
+
- Movie Poster + Movie Poster -
+
{{formattedRate}} @@ -22,7 +22,7 @@
-
+

{{ entry.title }}

diff --git a/frontend/src/app/features/cards/main-card/main-card.component.ts b/frontend/src/app/features/cards/main-card/main-card.component.ts index c7c382e..500b5f6 100644 --- a/frontend/src/app/features/cards/main-card/main-card.component.ts +++ b/frontend/src/app/features/cards/main-card/main-card.component.ts @@ -3,11 +3,25 @@ import { Entry } from '../../../shared/models/entry.model'; import { LibraryService } from '../../../core/services/library.service'; import { ListSelectionModalComponent } from '../../modals/list-selection-modal/list-selection-modal.component'; import { MatDialog } from '@angular/material/dialog'; +import { trigger, transition, style, animate } from '@angular/animations'; @Component({ selector: 'app-main-card', templateUrl: './main-card.component.html', styleUrls: ['./main-card.component.css'], + animations: [ + trigger('fadeInOut', [ + transition(':enter', [ + // :enter is alias for 'void => *' + style({ opacity: 0 }), + animate('0.5s ease-out', style({ opacity: 1 })), + ]), + transition(':leave', [ + // :leave is alias for '* => void' + animate('0.5s ease-in', style({ opacity: 0 })), + ]), + ]), + ], }) export class MainCardComponent implements OnInit { @Input() entry!: Entry; @@ -86,7 +100,7 @@ export class MainCardComponent implements OnInit { } } - logEntry() { + cardClick() { console.log(this.entry); } @@ -94,4 +108,10 @@ export class MainCardComponent implements OnInit { let type = this.entry.is_tvseries ? 'tv' : 'movie'; return `https://www.themoviedb.org/${type}/${this.entry.entryId.tmdb_id}`; } + + getPostPath() { + if (this.entry.poster_path == null) return 'assets/images/default/default-poster.png'; + + return `https://image.tmdb.org/t/p/w500` + this.entry.poster_path; + } } diff --git a/frontend/src/assets/images/default/default-poster.png b/frontend/src/assets/images/default/default-poster.png new file mode 100644 index 0000000..cbf4965 Binary files /dev/null and b/frontend/src/assets/images/default/default-poster.png differ