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
+35 -32

No files matched your search

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