Skip to content

Commit 2dcda27

Browse files
committed
fix movie app
1 parent b17c6c1 commit 2dcda27

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

Diff for: 17-movie app/index.html

+6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@
88
</head>
99
<body>
1010
<header>
11+
<h1>Should I watch it?</h1>
1112
<form id="form">
1213
<input type="text" placeholder="Search" id="search" class="search" />
1314
</form>
1415
</header>
1516
<main id="main"></main>
17+
<footer class="footer">
18+
<p>
19+
This project uses the TMDb API but is not endorsed or certified by TMDb.
20+
</p>
21+
</footer>
1622
<script src="script.js"></script>
1723
</body>
1824
</html>

Diff for: 17-movie app/script.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const API_URL =
2-
"https://api.themoviedb.org/3/discover/movie?sort_by=popularity.desc&api_key=3fd2be6f0c70a2a598f084ddfb75487c&page=1";
3-
// For education purpose only - Do not use this key in production
1+
const KEY = "3fd2be6f0c70a2a598f084ddfb75487c";
2+
// For educational purposes only - DO NOT USE in production
3+
// Request your own key for free: https://developers.themoviedb.org/3
4+
const API_URL = `https://api.themoviedb.org/3/discover/movie?sort_by=popularity.desc&api_key=${KEY}&page=1`;
45
const IMG_PATH = "https://image.tmdb.org/t/p/w1280";
5-
const SEARCH_API =
6-
'https://api.themoviedb.org/3/search/movie?api_key=3fd2be6f0c70a2a598f084ddfb75487c&query="';
6+
const SEARCH_API = `https://api.themoviedb.org/3/search/movie?api_key=${KEY}&query=`;
77

88
const main = document.getElementById("main");
99
const form = document.getElementById("form");
1010
const search = document.getElementById("search");
1111

1212
const getClassByRate = (vote) => {
13-
if (vote >= 8) return "green";
13+
if (vote >= 7.5) return "green";
1414
else if (vote >= 7) return "orange";
1515
else return "red";
1616
};

Diff for: 17-movie app/style.css

+14-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ body {
1818
header {
1919
padding: 1rem;
2020
display: flex;
21-
justify-content: flex-end;
21+
justify-content: space-between;
22+
align-items: center;
2223
background-color: var(--secondary-color);
2324
}
2425

26+
header h1 {
27+
color: #eee;
28+
padding: 0;
29+
margin: 0;
30+
font-size: 1.5rem;
31+
}
32+
2533
.search {
2634
background-color: transparent;
2735
border: 2px solid var(--primary-color);
@@ -109,3 +117,8 @@ main {
109117
.movie:hover .overview {
110118
transform: translateY(0);
111119
}
120+
121+
.footer p {
122+
color: #eee;
123+
text-align: center;
124+
}

0 commit comments

Comments
 (0)