Skip to content

Commit

Permalink
fix main actor card
Browse files Browse the repository at this point in the history
  • Loading branch information
cperdiansyah committed Sep 15, 2021
1 parent ec646f2 commit befdd98
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion belajar-fundamental-front-end-web-development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Materi yang dipelajari:

### 1. MovieNesia

[MovieNesia v.1.0](https://cperdiansyah.github.io/Dicoding-Front-End-Web-Developer/belajar-fundamental-front-end-web-development/v.1.0/dist/) [![wakatime](https://wakatime.com/badge/github/cperdiansyah/Dicoding-Front-End-Web-Developer.svg)](https://wakatime.com/badge/github/cperdiansyah/Dicoding-Front-End-Web-Developer)
[MovieNesia v.1.0](https://cperdiansyah.github.io/Dicoding-Front-End-Web-Developer/belajar-fundamental-front-end-web-development/v.1.0/dist/)

[![wakatime](https://wakatime.com/badge/github/cperdiansyah/Dicoding-Front-End-Web-Developer.svg)](https://wakatime.com/badge/github/cperdiansyah/Dicoding-Front-End-Web-Developer)

# Reference

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ class backdrop extends HTMLElement {
return new Date(a.published_at) - new Date(b.published_at);
});
/* Find first trailer on sorted video*/
const trailer = sorted.find((item) => item.type == 'Trailer');
const trailer =
sorted.length > 0
? sorted.find((item) => item.type == 'Trailer')
: '';

const trailerVideo =
trailer.length > 0
? `https://www.youtube.com/embed/${trailer.key}?enablejsapi=1&version=3&playerapiid=ytplayer`
: '';
this.innerHTML = `
<div class="backdrop">
<div class="backdrop-background">
Expand Down Expand Up @@ -196,9 +203,7 @@ class backdrop extends HTMLElement {
frameborder="0"
loading="lazy"
allowfullscreen=""
src="https://www.youtube.com/embed/${
trailer.key
}?enablejsapi=1&version=3&playerapiid=ytplayer"
src="${trailerVideo}"
alt="${this._movie.title} Trailer"
></iframe>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ body {
}
.content {
position: relative;
margin-top: -16.9rem;
margin-top: -4.9rem;
flex-wrap: wrap;
align-self: end;

Expand Down

0 comments on commit befdd98

Please sign in to comment.