forked from QAZIMAAZARSHAD/Movie-Streaming-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.html
437 lines (388 loc) · 18.9 KB
/
action.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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>PHV | Hành động</title>
<link rel="shortcut icon" href="./Design/Netflix_icon.svg.png" type="image/x-icon">
<!-- fontawesome 6.0.0 -->
<link href="./fontawesome-free-6.4.0-web/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<link href="./static/style.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu&display=swap" rel="stylesheet">
<link rel="stylesheet" href="static/bootstrap.min.css">
<link rel="stylesheet" href="static/style-min.css">
<link rel="stylesheet" href="cards.css">
</head>
<!------------------------Scroll to top button------------------------------------------------>
<style>
#scrollToTopButton{
position:fixed;
bottom: 40px;
right: 25px;
font-size: 25px;
z-index: 99;
width: 50px;
height: 50px;
background-color:red;
color:black;
border: none;
cursor: pointer;
outline: none;
padding: 6px;
border-radius: 50%;
}
#scrollToTopButton:hover, i:hover {
background-color:white;
color:red;
}
#nav:hover
{
background-color:#e60e23!important;
}
.container {
text-align: center;
}
.layout_navbar__1COmD {
-webkit-transition: background-color .3s linear;
transition: background-color .3s linear
}
.layout_navbar__1COmD.layout_hasBg__1CDaI {
background-color: rgba(51,10,103,.93)
}
#header-nav {
z-index: 30;
position: fixed;
top: 0;
right: 0;
left: 0;
transition: background-color 0.5s;
}
@media only screen and (max-width: 990px) {
#header-nav {
z-index: 30;
position: fixed;
top: 0;
right: 0;
left: 0;
background-color: #06121e99;
transition: background-color 0.5s;
}
}
.navbar-nav{
display: flex;
align-items: center;
padding: 0px 7.5px;
}
.nav-item :hover{
margin-bottom: 10px;
/* background-color: aquamarine; */
border-bottom: 3px;
border-color: red;
border-bottom-style: solid;
}
</style>
<script>
setTimeout(function () {
$('.section').fadeToggle();
}, 4000);
window.addEventListener('scroll', function() {
var myDiv = document.getElementById('header-nav');
var scrollPosition = window.scrollY;
if (scrollPosition > 0) {
myDiv.classList.add('layout_hasBg__1CDaI');
} else {
myDiv.classList.remove('layout_hasBg__1CDaI');
}
});
</script>
<body style="background-color: #06121E;">
<div class="scroll-bar">
<!-- navbar starts -->
<nav class="navbar navbar-expand-lg navbar-light layout_navbar__1COmD" id="header-nav">
<div class="container-fluid">
<a class="navbar-brand" href="index.html"><img class="logo" src="./Design/LogoWebRedBlack-02.png" alt="" width="30"
height="24"></a>
<button id="nav" class="navbar-toggler" id="nav" style="background-color:#8b0000" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon" style="background-color:dark-grey;"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 font_1em">
<li class="nav-item">
<a class="nav-link " href="movies.html" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'">Phim ngắn</a>
</li>
<li class="nav-item">
<a class="nav-link " href="web-series.html" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'" >Phim dài tập</a>
</li>
<li class="nav-item">
<a class="nav-link" href="kids.html" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'">Anime</a>
</li>
<li class="nav-item">
<a class="nav-link" href="tv.html" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'">TV</a>
</li>
<li class="nav-item">
<a class="nav-link" href="premium.html" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'">Gói vip</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contactus.html" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'">Liên hệ</a>
</li>
<li>
<!-- Genre dropdown starts-->
<div>
<div class="dropdown" style="position: relative; disPlay: inline-block; padding-top: 5px; padding-left: 15px;">
<button class="btn text-white" type="button" id="dropdownMenuButton" style="font-size:16px;margin-bottom: 6px;">
Thể loại <i class="fa-solid fa-chevron-down"></i>
</button>
<div class="dropdown-content" style="color: white;">
<a href="action.html" onclick="searchByCategory(this)">Hành động</a>
<a href="war.html" onclick="searchByCategory(this)">Chiến tranh</a>
<a href="drama.html" onclick="searchByCategory(this)">Drama</a>
<a href="suspense.html" onclick="searchByCategory(this)">Giật gân</a>
<a href="romance.html" onclick="searchByCategory(this)">Tình cảm</a>
<a href="anime.html" onclick="searchByCategory(this)">Hoạt hình</a>
<a href="horror.html" onclick="searchByCategory(this)">Kinh dị</a>
<a href="documentary.html" onclick="searchByCategory(this)">Lịch sử</a>
<a href="fantasy.html" onclick="searchByCategory(this)">Khoa học viễn tưởng</a>
<a href="comedy.html" onclick="searchByCategory(this)">Phim tâm lý</a>
</div>
<!-- <script>
function searchByCategory(element) {
const text = element.textContent;
const searchParams = new URLSearchParams();
fetch(`http://localhost:8080/API/phims/search?theloai=${text}`)
.then(response => response.json())
.then(data => {
localStorage.setItem('searchResults1', JSON.stringify(data));
const url = element.getAttribute('href');
window.location.href = url ;
})
.catch(error => {
console.error('Lỗi khi lấy danh sách phim:', error);
});
}
// Thêm các sự kiện onclick cho các thẻ <a>
const anchors = document.getElementsByTagName('a');
for (let i = 0; i < anchors.length; i++) {
anchors[i].addEventListener('click', function(event) {
event.preventDefault(); // Ngăn chặn hành vi mặc định của thẻ <a>
searchByCategory(this); // Gọi hàm searchByCategory và truyền thẻ <a> hiện tại làm tham số
});
}
</script> -->
</div>
</div>
<!-- Genre dropdown ends-->
</li>
<div style="position: relative; display: inline-block; padding-top: 5px; padding-left: 15px;">
<li>
<button type="button" class="btn font-mulish btn-light" onclick="login()" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='white'">Đăng nhập</button>
</li>
</div>
</ul>
<form id="searchForm" class="d-flex" style=" justify-content: center;">
<input class="form-control me-2" type="text" id="searchText" placeholder="Tìm kiếm" aria-label="Search">
<button class="btn btn-danger" type="submit" onclick="searchMovies()"><i class="fa-solid fa-magnifying-glass"></i></button>
</form>
<script>
function searchMovies() {
const searchText = document.getElementById('searchText').value;
const searchParams = new URLSearchParams();
searchParams.append('searchResults', searchText);
window.location.href = 'search.html?' + searchParams.toString();
}
</script>
</div>
</div>
</nav>
<!-- navbar ends -->
<div class="maincontainer" style="margin-top: 54px;">
<h2 class="p-5">Hành động</h2>
<div class="container">
<div id="movies" class="row">
</div>
</div>
<div class="container" id="Movies">
<script>
function displaySearchResults() {
const text = "Hành động";
fetch(`http://localhost:8080/API/phims/search?theloai=${text}`)
.then(response => response.json())
.then(data => {
if (data) {
const srcImg = "http://localhost:8080/photos/phims/";
const movieListElement = document.getElementById('movies');
data.forEach(item => {
const ngaySanXuat = item.ngaysanxuat;
const imgId = item.idphim + "/";
const year = ngaySanXuat.substring(0, 4);
const movieCard = document.createElement('div');
movieCard.classList.add('col-md-3');
movieCard.innerHTML = `
<div class="poster">
<div class="flip-card_i">
<div class="flip-card-inner_i">
<div class="flip-card-front_i">
<img src="${srcImg+imgId+item.hinhanh}" alt="Avatar" style="width:250px;height:360px;object-fit: cover;">
</div>
<div class="flip-card-back_i">
<h5 class="p-2">${item.tenphim}</h5>
<p>Thời lượng: ${item.thoiluong} phút</p>
<p class="para_i text-content-movie">${item.noidungphim}</p>
<br/>
<button class="trailer_i" type="submit" value="" onclick="openWin('${item.trailer}')">▶ Trailer</button>
<br>
<br>
<button class="btn_i b4_i" onclick="openMovieDetail('${item.idphim}')">▶ Xem</button>
</div>
</div>
<div class="flim">
<b>${item.tenphim}</b><br>IMDB - ${item.diemIMDB}
</div>
</div>
</div>
`;
movieListElement.appendChild(movieCard);
});
}
});
}
// Gọi hàm displaySearchResults() khi view search.html được tải
displaySearchResults();
function openWin(trailerLink) {
window.open(trailerLink, "_blank", "top=100,left=250,height=400,width=600,channelmode=yes,fullscreen=yes,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,noopener=no");
}
function openMovieDetail(idphim) {
fetch(`http://localhost:8080/API/movies/${idphim}`)
.then(response => response.json())
.then(data => {
// Xử lý dữ liệu nhận được từ API
console.log(data);
// Ví dụ: Hiển thị thông tin phim trong một view khác
navigateToMovieDetail(data);
})
.catch(error => {
console.error('Lỗi khi lấy dữ liệu phim:', error);
});
}
function navigateToMovieDetail(movieData) {
// Chuyển đến view mới
window.location.href = 'path/to/movie-detail-view.html';
// Lưu dữ liệu phim vào Local Storage để sử dụng trong view mới
localStorage.setItem('movieData', JSON.stringify(movieData));
}
</script>
</div>
</div>
</div>
<!-------------------------------Footer-------------------------------->
<div id="waterdrop"></div>
<footer class="footer">
<hr class="footer-hr">
<div class="footer-content">
<div class="footer-left">
<a href="index.html"><img class="footer-logo" src="Design/LogoWebRedBlack-02.png" alt="" width="30"
height="24"></a>
<p class="footer-bottom-tagline">Xem và thật Chill</p>
</div>
<div class="footer-middle">
<h2 class="footer-heading">Theo dõi chúng tớ</h2>
<ul class="footer-middle-list icons">
<a class="footer-links" href="https://www.facebook.com/" target="_blank"><i
class="fab fa-facebook-f facebook" style="color:#027CEB"></i></a>
<a class="footer-links" href="https://twitter.com/login?lang=en" target="_blank"><i
class="fab fa-twitter twitter" style="color:#2EA9EF"></i></a>
<a class="footer-links" href="https://www.linkedin.com/login" target="_blank"><i
class="fab fa-linkedin linkedin" style="color:#005F90"></i></a>
<a class="footer-links" href="https://www.instagram.com/" target="_blank"><i
class="fab fa-instagram instagram" style="color:#D72843"></i></a>
<a class="footer-links" href="https://github.com/QAZIMAAZARSHAD/Movie-Streaming-Website" target="_blank"><i
class="fab fa-github github" style="color:#2F2F2F"></i></a>
</ul>
</div>
<div class="footer-middle">
<h2 class="footer-heading">Phim Hay Vai có gì</h2>
<ul class="footer-middle-list" style="padding-left: 0;">
<li class="footer-middle-list-item"><a href="index.html">Thưởng thức những bộ phim mới nhất</a> </li>
<li class="footer-middle-list-item"><a href="web-series.html">Xem các bộ phim dài tập chất lượng</a> </li>
<li class="footer-middle-list-item"><a href="kids.html">Có tất cả mọi thứ cho trẻ</a> </li>
<li class="footer-middle-list-item"><a href="news.html">Sắp ra mắt</a> </li>
<li class="footer-middle-list-item"><a href="premium.html">Gói đăng ký siêu cấp</a> </li>
<li class="footer-middle-list-item"><a href="faq.html">Hỏi & Đáp</a> </li>
</ul>
</div>
<div class="footer-middle">
<h2 class="footer-heading">Ứng dụng</h2>
<ul class="footer-middle-list icons">
<a class="footer-links" href="#"><i class="fab fa-google-play" style="color:#59C3ED"></i></a>
<a class="footer-links" href="#"><i class="fab fa-app-store-ios" style="color:#1899E9"></i></a>
</ul>
</div>
<div class="footer-right">
<p class="footer-links">
<h2 class="footer-heading">Liên hệ</h2>
<p class="footer-bottom-tagline">Hãy liên lạc nếu cần thiết </p>
<a class="footer-contact-button" href="contactus.html">Kết nối</a>
</p>
</div>
</div>
<hr class="footer-hr">
<div class="footer-copyright">
<p>Copyright © and ® Since
<script>
document.write(new Date().getFullYear())
</script> phimhayvai.vn : (Dự án được thực hiện bởi Nhất - Vũ - Vỹ)
</p>
</div>
</footer>
<!----------------------Scroll to top button--------------------------------------------->
<button id="scrollToTopButton" title="Go to top" class="ml-5" >
<i class="fa fa-angle-double-up" aria-hidden="true" ></i>
</button>
<script>
$(document).ready(function(){
var scrollTopButton = document.getElementById("scrollToTopButton");
// window.onscroll = function () { scrollFunction() };
// function scrollFunction() {
// if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
// scrollTopButton.style.display = "block";
// } else {
// scrollTopButton.style.display = "none";
// }
// }
$("#scrollToTopButton").click(function(){
$('html ,body').animate({scrollTop : 0},800)
});
});
</script>
<script>
function login(){
window.location.replace("login.html");
}
</script>
<!-- offcanva JS and footer js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://daniellaharel.com/raindrops/js/raindrops.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="js/main-min.js"></script>
<script>
jQuery('#waterdrop').raindrops({
color: '#292c2f',
canvasHeight: 150,
density: 0.1,
frequency: 20
});
</script>
</script>
<!-- bootsstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<script src="./static/script.js"></script>
</body>
</html>