diff --git a/frontend/src/app/features/entry/cast-card/cast-card.component.html b/frontend/src/app/features/entry/cast-card/cast-card.component.html new file mode 100644 index 0000000..620c0d8 --- /dev/null +++ b/frontend/src/app/features/entry/cast-card/cast-card.component.html @@ -0,0 +1,10 @@ +
+ +
+
+

{{ cast?.person?.name }}

+

{{ cast?.character }}

+
+
+
diff --git a/frontend/src/app/features/entry/cast-card/cast-card.component.scss b/frontend/src/app/features/entry/cast-card/cast-card.component.scss new file mode 100644 index 0000000..141dacd --- /dev/null +++ b/frontend/src/app/features/entry/cast-card/cast-card.component.scss @@ -0,0 +1,56 @@ +.cast-card { + position: relative; + display: flex; + flex-direction: column; + background-color: #2a2a2a; + border-radius: 10px; + overflow: hidden; + cursor: pointer; + transition: transform 0.3s, box-shadow 0.3s; + height: 100%; + min-height: 200px; + width: 150px; +} + +.cast-card:hover { + transform: translateY(-5px); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); +} + +.cast-image { + width: 100%; + height: 150px; + object-fit: cover; +} + +.cast-info { + padding: 12px; + flex-grow: 1; + display: flex; + flex-direction: column; +} + +.cast-details { + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.actor-name { + font-size: 14px; + font-weight: 500; + margin: 0 0 6px 0; + color: white; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.character-name { + font-size: 12px; + color: #aaa; + margin: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/frontend/src/app/features/entry/cast-card/cast-card.component.ts b/frontend/src/app/features/entry/cast-card/cast-card.component.ts new file mode 100644 index 0000000..dce6d44 --- /dev/null +++ b/frontend/src/app/features/entry/cast-card/cast-card.component.ts @@ -0,0 +1,20 @@ +import { Component, Input } from '@angular/core'; +import { Router } from '@angular/router'; +import { Credit } from '../../../shared/models/credit.model'; + +@Component({ + selector: 'app-cast-card', + templateUrl: './cast-card.component.html', + styleUrls: ['./cast-card.component.scss'], +}) +export class CastCardComponent { + @Input() cast?: Credit; + + constructor(private router: Router) {} + + navigateToCastMember(): void { + if (this.cast?.person?.id) { + this.router.navigate(['/people', this.cast.person.id]); + } + } +} diff --git a/frontend/src/app/features/entry/cast-section/cast-section.component.html b/frontend/src/app/features/entry/cast-section/cast-section.component.html new file mode 100644 index 0000000..e4de9b3 --- /dev/null +++ b/frontend/src/app/features/entry/cast-section/cast-section.component.html @@ -0,0 +1,17 @@ +
+
+

Cast

+ +
+ +
+
+ + +
+
+
\ No newline at end of file diff --git a/frontend/src/app/features/entry/cast-section/cast-section.component.scss b/frontend/src/app/features/entry/cast-section/cast-section.component.scss new file mode 100644 index 0000000..1c4d380 --- /dev/null +++ b/frontend/src/app/features/entry/cast-section/cast-section.component.scss @@ -0,0 +1,59 @@ +.cast-section-container { + width: 100%; +} + +.cast-scroll-container { + width: 100%; + position: relative; + overflow: hidden; + margin-top: 10px; +} + +.cast-scroll { + display: flex; + flex-wrap: nowrap; + overflow-x: auto; + padding-bottom: 15px; /* Space for scrollbar */ + gap: 15px; + scroll-behavior: smooth; + -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */ +} + +.cast-card-item { + flex: 0 0 auto; + width: 150px; /* Fixed width for each card */ + margin-right: 5px; +} + +.cast-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; +} + +h3 { + margin: 0; +} + +/* Hide scrollbar for Chrome, Safari and Opera */ +.cast-scroll::-webkit-scrollbar { + height: 6px; +} + +/* Track */ +.cast-scroll::-webkit-scrollbar-track { + background: rgba(255, 255, 255, 0.1); + border-radius: 3px; +} + +/* Handle */ +.cast-scroll::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + border-radius: 3px; +} + +/* Handle on hover */ +.cast-scroll::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.5); +} diff --git a/frontend/src/app/features/entry/cast-section/cast-section.component.ts b/frontend/src/app/features/entry/cast-section/cast-section.component.ts new file mode 100644 index 0000000..2faa8a6 --- /dev/null +++ b/frontend/src/app/features/entry/cast-section/cast-section.component.ts @@ -0,0 +1,27 @@ +import { Component, Input } from '@angular/core'; +import { Credit } from '../../../shared/models/credit.model'; +import { trigger, transition, style, animate } from '@angular/animations'; + +@Component({ + selector: 'app-cast-section', + templateUrl: './cast-section.component.html', + styleUrls: ['./cast-section.component.scss'], + animations: [ + trigger('fadeInOut', [ + transition(':enter', [ + style({ opacity: 0 }), + animate('300ms', style({ opacity: 1 })), + ]), + ]), + ], +}) +export class CastSectionComponent { + @Input() credits: Credit[] = []; + + showAll: boolean = false; + initialCount: number = 5; + + toggleShowAllCast(): void { + this.showAll = !this.showAll; + } +} diff --git a/frontend/src/app/features/entry/cast-section/cast-section.module.ts b/frontend/src/app/features/entry/cast-section/cast-section.module.ts new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/app/features/entry/entries.module.ts b/frontend/src/app/features/entry/entries.module.ts index 3d4f027..7fa3279 100644 --- a/frontend/src/app/features/entry/entries.module.ts +++ b/frontend/src/app/features/entry/entries.module.ts @@ -11,6 +11,8 @@ import { EntrySettingsModalComponent } from './entry-settings-modal/entry-settin import { AlternateEntryPageComponent } from './alternate-entry-page/alternate-entry-page.component'; import { SeasonPageComponent } from './season-page/season-page.component'; import { EpisodeDialogComponent } from './episode-dialog/episode-dialog.component'; +import { CastCardComponent } from './cast-card/cast-card.component'; +import { CastSectionComponent } from './cast-section/cast-section.component'; @NgModule({ declarations: [ @@ -22,6 +24,8 @@ import { EpisodeDialogComponent } from './episode-dialog/episode-dialog.componen EntrySettingsModalComponent, SeasonPageComponent, EpisodeDialogComponent, + CastCardComponent, + CastSectionComponent ], imports: [ CommonModule, diff --git a/frontend/src/app/features/entry/entry-page/entry-page.component.html b/frontend/src/app/features/entry/entry-page/entry-page.component.html index be8887e..e78b9d9 100644 --- a/frontend/src/app/features/entry/entry-page/entry-page.component.html +++ b/frontend/src/app/features/entry/entry-page/entry-page.component.html @@ -143,6 +143,11 @@

{{this.entry.storyline}}

+ +
+ +
+

Seasons

diff --git a/frontend/src/app/features/entry/entry-page/entry-page.component.ts b/frontend/src/app/features/entry/entry-page/entry-page.component.ts index 1300c04..98e2939 100644 --- a/frontend/src/app/features/entry/entry-page/entry-page.component.ts +++ b/frontend/src/app/features/entry/entry-page/entry-page.component.ts @@ -87,10 +87,10 @@ export class EntryPageComponent implements OnInit { this.entry.seasons = this.entry.seasons.sort((a, b) => { // ? by changing the season number of 'special' season to 999 // ? it will show up as the last season. - if (b.season_number == 0) b.season_number = 999; // this will make the special season go last - if (a.season_number == 0) a.season_number = 999; // this will make the special season go last + if (b.season_number == 0) b.season_number = -5; // this will make the special season go last + if (a.season_number == 0) a.season_number = -5; // this will make the special season go last - return a.season_number - b.season_number; + return b.season_number - a.season_number; }); // ? getting seaons episodes diff --git a/frontend/src/app/shared/pipes/media-selector/media-selector.pipe.ts b/frontend/src/app/shared/pipes/media-selector/media-selector.pipe.ts index fd641c9..bcdca2e 100644 --- a/frontend/src/app/shared/pipes/media-selector/media-selector.pipe.ts +++ b/frontend/src/app/shared/pipes/media-selector/media-selector.pipe.ts @@ -16,7 +16,7 @@ export class MediaSelectorPipe implements PipeTransform { size: string = 'original' ): string { if (medias.length > 0) { - console.log(medias); + const selectedMedia = medias.filter( (m) => m.type == type && m.isSelected );