add imdb link

This commit is contained in:
X4Lo committed 2024-04-03 21:40:36 +00:00
1 parent 1556924a76
commit 1d349a5d48
3 files changed
+34 -31

No files matched your search

@@ -1,42 +1,39 @@
.movie-card { .movie-card {
cursor: pointer; cursor: pointer;
display: flex; /* Makes sure the card stretches in flex container */ display: flex;
flex-direction: column; flex-direction: column;
} }
.movie-card .card-head { .movie-card .card-head {
position: relative; position: relative;
border-radius: 10px; border-radius: 10px;
height: auto; /* If you set a fixed height, ensure it allows for the aspect ratio */ height: auto;
overflow: hidden; overflow: hidden;
margin-bottom: 15px; margin-bottom: 15px;
} }
.movie-card .card-img { .movie-card .card-img {
width: 100%; /* Ensure the image covers the width */ width: 100%;
height: auto; /* Height should adjust automatically */ height: auto;
aspect-ratio: 2 / 3; /* Set the aspect ratio to 2:3 */ aspect-ratio: 2 / 3;
object-fit: cover; /* Cover the container without losing aspect ratio */ object-fit: cover;
transition: transform 0.3s ease; transition: transform 0.3s ease;
} }
/* Update styles for card-body, card-title, and card-info based on the new layout */
.movie-card .card-body { .movie-card .card-body {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */ background: rgba(0, 0, 0, 0.5);
color: #fff; color: #fff;
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
transition: max-height 0.3s ease, padding 0.3s ease; /* Smooth transition for height and padding */ transition: max-height 0.3s ease, padding 0.3s ease;
overflow: hidden; /* Hide overflow by default */ overflow: hidden;
max-height: 60px; /* Adjust based on your default card body height */ max-height: 60px;
} }
/* * HOVER */ /* * HOVER */
.movie-card:hover .card-img { .movie-card:hover .card-img {
transform: scale(1.1); transform: scale(1.1);
@@ -54,8 +51,8 @@
} }
.movie-card:hover .card-body { .movie-card:hover .card-body {
max-height: 100px; /* Adjust based on the needed height to show the full title */ max-height: 100px;
padding: 12px; /* Increase padding if desired */ padding: 12px;
} }
.movie-card:hover .card-title { .movie-card:hover .card-title {
white-space: normal; white-space: normal;
@@ -102,9 +99,9 @@
} }
.bookmark, .bookmark,
.info { .info {
display: flex; /* Use Flexbox */ display: flex;
justify-content: center; /* Center horizontally */ justify-content: center;
align-items: center; /* Center vertically */ align-items: center;
} }
/* ? rating */ /* ? rating */
@@ -144,11 +141,13 @@
.movie-card:hover .card-title, .movie-card:hover .card-title,
.movie-card:hover .card-info { .movie-card:hover .card-info {
/* color: var(--light-azure); */
text-overflow: clip; text-overflow: clip;
color: var(--white); color: var(--white);
} }
.movie-card:hover .card-title {
color: var(--yellow);
}
.movie-card .card-info { .movie-card .card-info {
display: flex; display: flex;
font-family: -apple-system, "Segoe UI", BlinkMacSystemFont, sans-serif; font-family: -apple-system, "Segoe UI", BlinkMacSystemFont, sans-serif;
@@ -23,8 +23,9 @@
<!-- card body moved inside card head --> <!-- card body moved inside card head -->
<div class="card-body" (click)="logEntry()"> <div class="card-body" (click)="logEntry()">
<a [href]="getTmdbLink()" target="_blank" rel="noopener noreferrer">
<h3 class="card-title">{{ entry.title }}</h3> <h3 class="card-title">{{ entry.title }}</h3>
</a>
<div class="card-info"> <div class="card-info">
<span class="Year">{{releaseYear}}</span> <span class="Year">{{releaseYear}}</span>
<i class="card-dot"></i> <i class="card-dot"></i>
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Entry } from '../../../shared/models/entry.model'; import { Entry } from '../../../shared/models/entry.model';
import { LibraryService } from '../../../core/services/library.service'; import { LibraryService } from '../../../core/services/library.service';
import { ListSelectionModalComponent } from '../../../list-selection-modal/list-selection-modal.component'; import { ListSelectionModalComponent } from '../../modals/list-selection-modal/list-selection-modal.component';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
@Component({ @Component({
@@ -70,25 +70,28 @@ export class MainCardComponent implements OnInit {
}); });
} }
logEntry() {
console.log(this.entry);
}
showAddToListModal() { showAddToListModal() {
if (this.entry) { if (this.entry) {
console.log("entry exist");
const dialogRef = this.dialog.open(ListSelectionModalComponent, { const dialogRef = this.dialog.open(ListSelectionModalComponent, {
width: '500px', width: '400px',
height: '300px', height: '55%',
data: { data: {
/* données que vous pourriez vouloir passer */ entryId: this.entry.id,
}, },
}); });
dialogRef.afterClosed().subscribe((result) => { dialogRef.afterClosed().subscribe((result) => {
console.log('Le dialogue a été fermé', result); console.log('Modal Closed: ', result);
// Traitez le résultat ici (par exemple, ajoutez la sélection à une liste)
}); });
} }
} }
logEntry() {
console.log(this.entry);
}
getTmdbLink() {
let type = this.entry.is_tvseries ? 'tv' : 'movie';
return `https://www.themoviedb.org/${type}/${this.entry.entryId.tmdb_id}`;
}
} }