-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
249 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#movie_title_info>h1{ | ||
font-size: 2.5rem; | ||
font-weight: bolder; | ||
} | ||
#movie_title_info>h2{ | ||
font-size: 1.25rem; | ||
line-height: 24px; | ||
margin-bottom: 0; | ||
font-weight: bolder; | ||
} | ||
.rating_info{ | ||
font-size: 1.25em; | ||
font-weight: bolder; | ||
} | ||
.trailer::before{ | ||
content: ''; | ||
display: block !important; | ||
position: absolute; | ||
top: 50px; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
pointer-events: none; | ||
background: url(https://yts.mx/assets/images/website/play-trailer.svg) no-repeat center center; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
const {remote} = require("electron"); | ||
|
||
let movie_id = getParameter(window.location); | ||
let url = new URL("https://yts.mx/api/v2/movie_details.json?movie_id=00&with_images=true&with_cast=true"); | ||
let details_content; | ||
let background_content = document.getElementById("background_content"); | ||
|
||
getData(url,movie_id) | ||
|
||
function getData(url,id){ | ||
background_content.innerHTML=`<div class="text-center"><img src="../Assets/images/preloader.gif" alt="preloading" class="img-fluid" width="400" height="400"></div>`; | ||
url.searchParams.set("movie_id",id); | ||
fetch(url) | ||
.then(res=>{res.json() | ||
.then(data=>{ | ||
let movie = data.data.movie; | ||
setBackground(movie); | ||
generalIntro(movie); | ||
screenshots(movie); | ||
descriptionAndTrailer(movie); | ||
}) | ||
.catch(err=>{ | ||
console.log(err); | ||
goBack(); | ||
}) | ||
}) | ||
.catch(err=>{ | ||
console.log(err); | ||
goBack(); | ||
}); | ||
} | ||
|
||
function setBackground(movie){ | ||
let content = `<div style="background: linear-gradient(to bottom,rgba(33,30,30,0.65) 0,rgba(33,30,30,1) 100%), url(${movie.background_image}) no-repeat center center; background-size: cover; height: 580px; overflow: visible;"> | ||
<div class="container" id="details_content"></div> | ||
</div>`; | ||
background_content.innerHTML = content; | ||
details_content = document.getElementById("details_content"); | ||
} | ||
|
||
function generalIntro(movie){ | ||
let content = `<div class="row pt-5 justify-content-center"> | ||
<div class="col-5 col-lg-3"> | ||
<div class="rounded" style="border:5px solid white; width: fit-content;"> | ||
<img src="${movie.medium_cover_image}" class="d-inline-block align-top"> | ||
</div> | ||
</div> | ||
<div class="col-1"></div> | ||
<div class="col-6 col-lg-5"> | ||
<div id="movie_title_info"> | ||
<h1 class="mb-4">${movie.title}</h1> | ||
<h2>${movie.year}</h2> | ||
<h2>${movie.genres.toString().replace(/,/gm," / ")}</h2> | ||
</div> | ||
<p class="mt-4 mb-4"> | ||
<em class="text-white align-middle" style="font-size: 1.3em;">Available in: </em> | ||
<a href="#" title="Watch ${movie.title} in 720p Torrent" class="btn btn-secondary border-dark">720p.WEB</a> | ||
<a href="#" title="Watch ${movie.title} in 1080p Torrent" class="btn btn-secondary border-dark ml-1">1080p.WEB</a> | ||
<br><br> | ||
${movie.imdb_code?`<a href="#" class="btn btn-success" title="Download subtitles for ${movie.title}" onclick="openSubtitleLink(event,'${movie.imdb_code}')">Download Subtitles</a>`:''} | ||
</p> | ||
<div> | ||
<div class="row"> | ||
<div class="col-3 col-lg-2"> | ||
<img src="../Assets/images/logo-imdb-svg.svg" alt="IMDb Rating"> | ||
</div> | ||
<div class="col rating_info text-white"> | ||
<span>${movie.rating}</span> | ||
<span class="text-success">★</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div>`; | ||
details_content.innerHTML += content; | ||
} | ||
|
||
function screenshots(movie){ | ||
let content = `<div class="row mt-5 justify-content-center"> | ||
<div class="col-4"> | ||
<img src="${movie.medium_screenshot_image1}" alt="${movie.title_long} watch" class="img-fluid"> | ||
</div> | ||
<div class="col-4"> | ||
<img src="${movie.medium_screenshot_image2}" alt="${movie.title_long} watch" class="img-fluid"> | ||
</div> | ||
<div class="col-4"> | ||
<img src="${movie.medium_screenshot_image3}" alt="${movie.title_long} watch" class="img-fluid"> | ||
</div> | ||
</div>`; | ||
details_content.innerHTML+= content; | ||
} | ||
|
||
function descriptionAndTrailer(movie){ | ||
let content = `<div class="row mt-5 mb-4 justify-content-center"> | ||
<div class="col-6"> | ||
<h3 style="font-size: 1.25em;" class="font-weight-bolder">Description :</h3> | ||
<p class="text-wrap text-justify" style="font-size: 1.1em;"> | ||
${movie.description_full} | ||
</p> | ||
</div> | ||
<div class="col-6 text-center" style="height: fit-content"> | ||
<h3 style="font-size: 1.25em;" class="font-weight-bolder mb-4">Watch Trailer :</h3> | ||
<div class="trailer"> | ||
<a href="#" onclick="openYoutubeLink(event,'${movie.yt_trailer_code}')"> | ||
<img src="${movie.medium_screenshot_image1}" | ||
alt="${movie.title}" class="img-fluid"> | ||
</a> | ||
</div> | ||
</div> | ||
</div>`; | ||
details_content.innerHTML += content; | ||
} | ||
|
||
function getParameter(url){ | ||
url = new URL(url); | ||
return url.searchParams.get("id"); | ||
} | ||
|
||
window.goBack = ()=>{ | ||
window.history.back(); | ||
} | ||
|
||
window.openYoutubeLink= (e,code)=>{ | ||
e.preventDefault(); | ||
if(code !== "") { | ||
openInBrowser("https://www.youtube.com/watch?v=" + code); | ||
} | ||
}; | ||
|
||
window.openSubtitleLink= (e,code)=>{ | ||
e.preventDefault(); | ||
if(code !== "") { | ||
openInBrowser("https://yifysubtitles.org/movie-imdb/" + code); | ||
} | ||
}; | ||
|
||
function openInBrowser(link){ | ||
remote.shell.openExternal(link) | ||
}; |