bugfixes
This commit is contained in:
parent
3ab7614e7e
commit
ce57f633d5
5 changed files with 46 additions and 16 deletions
|
|
@ -21,6 +21,15 @@ export class BrowseComponent implements OnInit {
|
|||
imgPath: 'galaxy.png',
|
||||
videoPath: 'galaxy.mp4',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: 'Star Trek',
|
||||
description:
|
||||
'Join Captain Kirk and the crew of the starship USS Enterprise as they embark on thrilling adventures across the universe. "Star Trek" is a legendary sci-fi saga that explores the final frontier, filled with action, exploration, and unforgettable encounters with alien species. This epic journey showcases the spirit of discovery and the unwavering courage of the Starfleet members as they confront the unknown and protect the galaxy from various threats.',
|
||||
category: 'sci-fi',
|
||||
imgPath: 'star-trek.png',
|
||||
videoPath: 'star-trek.mp4',
|
||||
},
|
||||
];
|
||||
currentMovie: any[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
<section class="hide-scrollbar">
|
||||
<div class="category">
|
||||
<p>New Releases</p>
|
||||
@for (movie of movies; track movie) {
|
||||
<div class="movie" (click)="openCurrentMovie(movie.id)">
|
||||
<img
|
||||
src="./../../../../../assets/movies/banner/{{ movie.imgPath }}"
|
||||
alt=""
|
||||
/>
|
||||
<div class="movies">
|
||||
@for (movie of movies; track movie) {
|
||||
<div class="movie" (click)="openCurrentMovie(movie.id)">
|
||||
<img
|
||||
src="./../../../../../assets/movies/banner/{{ movie.imgPath }}"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="category">
|
||||
<p>Continue Watching</p>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ section {
|
|||
}
|
||||
}
|
||||
|
||||
.movies {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.movie {
|
||||
width: 213px;
|
||||
height: 120px;
|
||||
|
|
|
|||
|
|
@ -27,19 +27,18 @@ section {
|
|||
.title {
|
||||
font-size: 5vw;
|
||||
font-weight: 700;
|
||||
text-shadow: 1px 1px 2px $black;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 1.2vw;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
overflow: scroll;
|
||||
height: 40%;
|
||||
overflow: hidden;
|
||||
max-height: 145px;
|
||||
height: fit-content;
|
||||
margin-bottom: 24px;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
&::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
}
|
||||
text-shadow: 1px 1px 2px $black;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.movie-banner {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { CommonModule } from '@angular/common';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Component, ElementRef, Input } from '@angular/core';
|
||||
import { BtnLargeComponent } from '../../../../shared/components/btn-large/btn-large.component';
|
||||
|
||||
@Component({
|
||||
|
|
@ -12,7 +12,23 @@ import { BtnLargeComponent } from '../../../../shared/components/btn-large/btn-l
|
|||
export class HeroBannerComponent {
|
||||
@Input() currentMovie: any[] = [];
|
||||
|
||||
constructor(private el: ElementRef) {}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.truncateText();
|
||||
}
|
||||
getImagePath(): string {
|
||||
return `./../../../../../assets/movies/banner/${this.currentMovie[0]?.imgPath}`;
|
||||
}
|
||||
|
||||
truncateText() {
|
||||
const descriptionEl = this.el.nativeElement.querySelector('.description');
|
||||
const maxHeight = descriptionEl.offsetHeight;
|
||||
let text = descriptionEl.innerText;
|
||||
|
||||
while (descriptionEl.scrollHeight > maxHeight) {
|
||||
text = text.slice(0, -1);
|
||||
descriptionEl.innerText = text + '...';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue