-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
157 lines (138 loc) · 5.92 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movies Now</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/movie.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
</head>
<body>
<header>
<a class="logo" href="/">
<div class="logoWords">
<img src="images/logo.svg" alt="logo">
</div>
</a>
<nav>
<ul class="nav__links">
<li><a href="/" data-navigo>Home</a></li>
<li><a href="/movies" data-navigo>Movies</a></li>
<li><a href="/tvshows" data-navigo>TV Shows</a></li>
<li><a href="/mylibrary" data-navigo>My library</a></li>
</ul>
</nav>
<a class="cta" href="https://github.com/ijiki16/MoviesNow">Contact</a>
<p class="menu cta">Menu</p>
</header>
<div class="overlay">
<a class="close">×</a>
<div class="overlay__content">
<a href="/" data-navigo>Home</a>
<a href="/movies" data-navigo>Movies</a>
<a href="/tvshows" data-navigo>TV Shows</a>
<a href="/mylibrary" data-navigo>My library</a>
</div>
</div>
<div id="content"></div>
<!-- routing -->
<script src="//unpkg.com/navigo"></script>
<script type="module">
import { getMovies, setMovieVideo, setMovieInfo , setSearchMovies } from './scripts/API.js';
const mainPageData = `
<div class="allData">
<h1>Top Today</h1>
<div class="root" id="root1"></div>
<h1>Latest Upload</h1>
<div class="root" id="root2"></div>
<h1>Top This Month</h1>
<div class="root" id="root3"></div>
</div>
`;
const moviePageData = `
<div class="movieVideoDiv" id="movieVideoDiv">
<video class="movieVideo" id="video" controls>
<source id="videoSrc" src="" type="video/mp4">
</video>
</div>
<div class="movieData">
<div class="movieImageDiv">
<img class="movieImage" id="movieImage"
src="https://static.adjaranet.com/movies/posters/240/939/878491939-51af06cfca8b5d316cc1701d8b5f762f.jpg">
</div>
<div class="movieInfo">
<div class="movieName" id="movieName"> ოქროს ძიებაში: ალასკა </div>
<div class="infoList">
<div class="infoLine">
<div class="infoType">წელი:</div>
<div class="infoData" id="year">2010</div>
</div>
<div class="infoLine">
<div class="infoType">ქვეყანა:</div>
<div class="infoData" id="cntry">
<a href="/episodes?country=125">აშშ</a>
</div>
</div>
<div class="infoLine">
<div class="infoType">ჟანრი:</div>
<div class="infoData" id="genrs">
<a href="/episodes?genre=272">Reality-TV, </a>
<a href="/episodes?genre=275">სერიალი</a>
</div>
</div>
</div>
<div class="movieDescription">
<div class="descriptionLabel">აღწერა:</div>
<div class="descriptionData" id="descriptionData">რეალითი სატელევიზიო შოუ, იუკონის ტერიტორიზე ოქროს მოპოვების შესახებ.</div>
</div>
</div>
</div>
`;
const moviesPageData = `
<div class="Search" id="Search">
<form class="example" action="/movies">
<input type="text" placeholder="Search.." name="search">
<button type="submit" >search<i class="fa fa-search"></i></button>
</form>
</div>
<h1>SearchResult</h1>
<div class="searchResult" id="searhData"></div>
`;
function renderHomePage() {
document.querySelector("#content").innerHTML = `${mainPageData}`;
getMovies('root1','?type=movie&period=day&page=1&per_page=20', '', '/top');
getMovies('root2','?page=1&per_page=20&filters%5Bwith_files%5D=yes&filters%5Btype%5D=movie', '&sort=-upload_date', '');
getMovies('root3','?type=movie&period=month&page=1&per_page=20', '', '/top');
}
function renderMoviePage() {
document.querySelector("#content").innerHTML = `${moviePageData}`;
// console.log(window.location.search);
let params = new URLSearchParams(window.location.search);
// console.log(params.get("id"));
var movieID = params.get("id")
setMovieVideo(movieID);
setMovieInfo(movieID);
}
function renderMoviesPage() {
document.querySelector("#content").innerHTML =`${moviesPageData}`;
setSearchMovies("gela");
}
window.addEventListener("load", () => {
const router = new Navigo("/");
router
// .on("/movie", (match) => {
// console.log(match);
// renderMoviePage();
// })
.on("/movie", renderMoviePage)
.on("/movies", renderMoviesPage)
.on("*", renderHomePage)
.resolve();
});
</script>
<!-- -->
<script type="text/javascript" src="/scripts/mobile.js"></script>
</body>
</html>