diff --git a/app/app.html b/app/app.html index 8f5223b..66f0a53 100644 --- a/app/app.html +++ b/app/app.html @@ -129,7 +129,7 @@
-
-
+
@@ -309,7 +309,10 @@
-
+
+

+ Restart may be required for some settings to take effect. +

diff --git a/app/css/player.css b/app/css/player.css index 7cb003c..799a6f1 100644 --- a/app/css/player.css +++ b/app/css/player.css @@ -8,6 +8,7 @@ color: #b6b6b6; --sidebar-width: 19rem; --ts: ""; + --miniplayer-display: flex; } @@ -39,7 +40,7 @@ #player { position: fixed; - display: flex; + display: var(--miniplayer-display); bottom: 2rem; right: 2rem; width: 25%; @@ -66,7 +67,7 @@ video[src=""] { video::cue { background: none; - font-family: "Open Sans", sans-serif; + font-family: var(--sub-font); color: #fff; text-shadow: 2px 2px 0 #000, 2px -2px 0 #000, @@ -196,7 +197,9 @@ video::cue { height: var(--height); top: -2rem; } - +.ctrl[disabled]{ + display: none; +} .controls input#prog[type=range]::before { top: 0rem; content: attr(data-ts); diff --git a/app/js/animeHandler.js b/app/js/animeHandler.js index 3d50a48..4fdbe21 100644 --- a/app/js/animeHandler.js +++ b/app/js/animeHandler.js @@ -245,7 +245,7 @@ async function nyaaSearch(media, episode) { for (let title of titles) { if (results.children.length == 0) { title = title.replace(/ /g, "+") - let url = new URL(`https://nyaa.si/?page=rss&c=1_2&f=2&s=seeders&o=desc&q=${title}"+${episode}+"`) + let url = new URL(`https://nyaa.si/?page=rss&c=1_2&f=${settings.torrent3 == true ? 2 : 0}&s=seeders&o=desc&q=${title}"+${episode}+"+${settings.torrent1}`) results = await nyaaRss(url) } } @@ -271,19 +271,24 @@ async function nyaaRss(url) { await res.text().then((xmlTxt) => { try { let doc = DOMPARSER(xmlTxt, "text/xml") + if (settings.torrent2 && doc.querySelectorAll("infoHash")[0]) { + addTorrent(doc.querySelectorAll("infoHash")[0].textContent) + halfmoon.toggleModal("tsearch") + } doc.querySelectorAll("item").forEach((item, index) => { let i = item.querySelector.bind(item) let template = document.createElement("tr") template.innerHTML += ` - ${(index + 1)} - ${i("title").textContent} - ${i("size").textContent} - ${i("seeders").textContent} - ${i("leechers").textContent} - ${i("downloads").textContent} - Play` + ${(index + 1)} + ${i("title").textContent} + ${i("size").textContent} + ${i("seeders").textContent} + ${i("leechers").textContent} + ${i("downloads").textContent} + Play` frag.appendChild(template) }) + } catch (e) { console.error(e) } @@ -386,6 +391,6 @@ async function hsRss(url) { } }) } -document.querySelector("#refRel").onclick = function(){ +document.querySelector("#refRel").onclick = function () { hsRss(`http://www.horriblesubs.info/rss.php?res=${settings.torrent1}`) } \ No newline at end of file diff --git a/app/js/playerHandler.js b/app/js/playerHandler.js index 3036f8c..155b6e2 100644 --- a/app/js/playerHandler.js +++ b/app/js/playerHandler.js @@ -10,6 +10,7 @@ const controls = document.getElementsByClassName('ctrl'), btnpp = document.querySelector('#bpp'), btnm = document.querySelector("#bmute"), btnfull = document.querySelector('#bfull'), + btnpip = document.querySelector('#bpip'), elapsed = document.querySelector("#elapsed"), remaining = document.querySelector("#remaining"), buffering = document.querySelector("#buffering"), @@ -256,6 +257,17 @@ async function bpip() { } } +if (settings.player7){ + video.setAttribute("autoPictureInPicture", ""); +} else { + video.setAttribute("disablePictureInPicture", ""); + btnpip.setAttribute("disabled", ""); +} + +//miniplayer +if (!settings.player4){ + document.documentElement.style.setProperty("--miniplayer-display", "none"); +} // theathe mode function btheatre() { @@ -279,7 +291,9 @@ function seek(a) { video.currentTime += a; updateDisplay() } -// subtitles button, generates content every single time its opened because fuck knows when the parser will find new shit + +// subtitles, generates content every single time its opened because fuck knows when the parser will find new shit + let off function bcap() { let frag = document.createDocumentFragment() @@ -322,6 +336,8 @@ function selectLang(lang) { } bcap() } + +document.documentElement.style.setProperty("--sub-font", `"${settings.subtitle1}"`); // keybinds document.onkeydown = function (a) {