File tree 3 files changed +26
-7
lines changed
3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 8
8
</ head >
9
9
< body >
10
10
< header >
11
+ < h1 > Should I watch it?</ h1 >
11
12
< form id ="form ">
12
13
< input type ="text " placeholder ="Search " id ="search " class ="search " />
13
14
</ form >
14
15
</ header >
15
16
< 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 >
16
22
< script src ="script.js "> </ script >
17
23
</ body >
18
24
</ html >
Original file line number Diff line number Diff line change 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` ;
4
5
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=` ;
7
7
8
8
const main = document . getElementById ( "main" ) ;
9
9
const form = document . getElementById ( "form" ) ;
10
10
const search = document . getElementById ( "search" ) ;
11
11
12
12
const getClassByRate = ( vote ) => {
13
- if ( vote >= 8 ) return "green" ;
13
+ if ( vote >= 7.5 ) return "green" ;
14
14
else if ( vote >= 7 ) return "orange" ;
15
15
else return "red" ;
16
16
} ;
Original file line number Diff line number Diff line change @@ -18,10 +18,18 @@ body {
18
18
header {
19
19
padding : 1rem ;
20
20
display : flex;
21
- justify-content : flex-end;
21
+ justify-content : space-between;
22
+ align-items : center;
22
23
background-color : var (--secondary-color );
23
24
}
24
25
26
+ header h1 {
27
+ color : # eee ;
28
+ padding : 0 ;
29
+ margin : 0 ;
30
+ font-size : 1.5rem ;
31
+ }
32
+
25
33
.search {
26
34
background-color : transparent;
27
35
border : 2px solid var (--primary-color );
@@ -109,3 +117,8 @@ main {
109
117
.movie : hover .overview {
110
118
transform : translateY (0 );
111
119
}
120
+
121
+ .footer p {
122
+ color : # eee ;
123
+ text-align : center;
124
+ }
You can’t perform that action at this time.
0 commit comments