-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
238 lines (229 loc) · 9.41 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie Planet</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
</head>
<body>
<header>
<div class="logo">
<a href="#"><img src="images/logo.png" alt="logo" width="150"></a>
</div>
<div class="btn-nav">☰</div>
<nav>
<ul>
<li><a href="#featured" onclick="toggleNav()">Featured</a></li>
<li><a href="#monthly" onclick="toggleNav()">Monthly's Picks</a></li>
<li><a href="#upcoming" onclick="toggleNav()">Upcoming Soon</a></li>
</ul>
</nav>
</header>
<div class="jumbotron">
<h1>Movie Planet</h1>
<h2>Planetnya Film-Film di berbagai Negara</h2>
</div>
<main>
<div class="featured" id="featured">
<h1>Featured This Week</h1>
<div class="content">
<a href="">
<div class="card">
<img src="images/poster_a_start_is_born.jpg" alt="">
<div class="title">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Natus aliquid explicabo distinctio repellendus quasi placeat, vero dolorem? Quos nesciunt necessitatibus nihil qui nisi voluptates rem praesentium dolor? Laudantium, impedit molestiae?
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_dragon_ball.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_doom_patrol.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_family_guy.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_gotham.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_fairytail.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
</div>
</div>
<div class="monthly" id="monthly">
<h1>Monthly's Picks</h1>
<div class="content">
<a href="">
<div class="card">
<img src="images/poster_a_start_is_born.jpg" alt="">
<div class="title">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Natus aliquid explicabo distinctio repellendus quasi placeat, vero dolorem? Quos nesciunt necessitatibus nihil qui nisi voluptates rem praesentium dolor? Laudantium, impedit molestiae?
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_dragon_ball.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_doom_patrol.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_family_guy.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_gotham.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_fairytail.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
</div>
</div>
<div class="upcoming" id="upcoming">
<h1>Upcoming Soon</h1>
<div class="content">
<a href="">
<div class="card">
<img src="images/poster_a_start_is_born.jpg" alt="">
<div class="title">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Natus aliquid explicabo distinctio repellendus quasi placeat, vero dolorem? Quos nesciunt necessitatibus nihil qui nisi voluptates rem praesentium dolor? Laudantium, impedit molestiae?
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_dragon_ball.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_doom_patrol.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_family_guy.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_gotham.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
<a href="">
<div class="card">
<img src="images/poster_fairytail.jpg" alt="">
<div class="title">
Ini judul
</div>
</div>
</a>
</div>
</div>
</main>
<footer>
<div class="sosmed">
<a href="#" target="_blank"><i class="fab fa-facebook"></i></a>
<a href="#" target="_blank"><i class="fab fa-github"></i></a>
<a href="#" target="_blank"><i class="fab fa-instagram"></i></a>
</div>
<p>© Movie Planet 2021 . All Rights Reserved.</p>
</footer>
<script src="js/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
const token = "01ae241ec98ea28e6420e34b95701a1b";
const getMovieDB = (url_api, element) => {
$.ajax({
url: url_api
}).done(function(data) {
let i = 0;
element.each(function() {
$(this).attr('href',`detail.html?id=${data.results[i].id}`);
$(this).find("img").attr('src',`https://www.themoviedb.org/t/p/w220_and_h330_face${data.results[i].poster_path}`);
$(this).find(".title").text(data.results[i].original_title);
i++;
})
}).fail(function() {
console.log("gagal dimuat")
});
}
getMovieDB(`https://api.themoviedb.org/3/movie/now_playing?api_key=${token}&language=en-US&page=1`, $(".featured .content a"));
getMovieDB(`https://api.themoviedb.org/3/movie/popular?api_key=${token}&language=en-US&page=2`, $(".monthly .content a"));
getMovieDB(`https://api.themoviedb.org/3/movie/upcoming?api_key=${token}&language=en-US&page=2`, $(".upcoming .content a"));
$(".btn-nav").click(function() {
$(this).parent().find("nav").toggleClass("nav-mobile");
});
})
function toggleNav() {
$("nav").toggleClass("nav-mobile");
}
</script>
</body>
</html>