-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14f72eb
commit 4345b67
Showing
18 changed files
with
318 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/app/shared/film-thumbnail/film-thumbnail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="wrapper" [routerLink]="['/film', id]" (click)="onClick()"> | ||
<div class="image-loader"> | ||
<img [hidden]="isLoading" class="img-loaded img-fluid" [src]="src" [alt]="alt" (load)="onLoad()"> | ||
<img *ngIf="isLoading" class="img-loading" [src]="loaderSrc" alt="loading..."> | ||
</div> | ||
<div *ngIf="!isLoading" class="movie-title-container"> | ||
<p class="h4 title">{{title}}</p> | ||
<p class="lead text-muted director-year">{{director}} | {{year}}</p> | ||
</div> | ||
</div> |
73 changes: 73 additions & 0 deletions
73
src/app/shared/film-thumbnail/film-thumbnail.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
$transition-duration: 0.15s; | ||
|
||
.image-loader { | ||
img.img-loaded { | ||
animation: fadeIn 0.8s; | ||
position: absolute; | ||
height: 100%; | ||
width: 100%; | ||
object-fit: cover; | ||
transition: filter $transition-duration ease-in-out; | ||
} | ||
img.img-loading { | ||
position: absolute; | ||
height: 60px; | ||
width: 60px; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
pointer-events: none; | ||
} | ||
} | ||
|
||
@keyframes fadeIn { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
.movie-title-container { | ||
z-index: 5; | ||
position: absolute; | ||
background-color: rgba(0,0,0,0.75); | ||
color: white; | ||
padding-top: 1rem; | ||
width: 100%; | ||
height: 100%; | ||
text-align: center; | ||
opacity: 0; | ||
transition: opacity $transition-duration ease-in-out; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
.text-muted { | ||
color: #999 !important; | ||
} | ||
p { | ||
transform: scaleX(0); | ||
} | ||
p:first-child { | ||
transition: transform 0.25s ease-in-out $transition-duration; | ||
} | ||
p:last-child { | ||
transition: transform 0.25s ease-in-out 0.3s; | ||
} | ||
} | ||
.wrapper { | ||
cursor: pointer; | ||
} | ||
.wrapper:hover { | ||
.movie-title-container { | ||
opacity: 1; | ||
p { | ||
transform: scaleX(1); | ||
} | ||
} | ||
.img-loaded { | ||
filter: grayscale(0.5); | ||
} | ||
} | ||
|
Oops, something went wrong.