diff --git a/public/css/style-night.css b/public/css/style-night.css index a070eb3a..a303976e 100644 --- a/public/css/style-night.css +++ b/public/css/style-night.css @@ -1,3 +1,10 @@ +/* Night mode image */ +#sunmoon { + position: fixed; + top: 10px; + height: 30px; + +} /* Torrent status colors */ .remake { background-color: #795c46; @@ -25,6 +32,7 @@ #container { padding-top: 1.25em; + background-color: #29363d; } #container.cont-home { diff --git a/public/css/style.css b/public/css/style.css index fad0cc2a..338b38ae 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,3 +1,9 @@ +/* Night mode image */ +#sunmoon { + position: fixed; + top: 10px; + height: 30px; +} /* Torrent status colors */ .remake { background-color: rgb(240, 176, 128); @@ -10,29 +16,30 @@ } /* modified copy of NyaaTorrent theme */ -nav#mainmenu { +#mainmenu { background: #263238; position: fixed; color: white; width: 100%; z-index: 4; + border: 0px solid white; } -nav#mainmenu a { +#mainmenu a { color: white; } -div#container { +#container { padding-top: 1.25em; background: white; } -div#container.cont-home { +#container.cont-home { background: white url(/img/renchon.png) no-repeat; } -div#container.cont-view { +#container.cont-view { background: white url(/img/renchon.png) no-repeat; - background-size: 61px; + background-size: 75px, 100px; } body { @@ -42,9 +49,6 @@ body { margin: 0; padding: 0; } -.blockBody { - padding-bottom: 2rem; -} .torrentNav { text-align: center; diff --git a/public/img/moon.png b/public/img/moon.png new file mode 100644 index 00000000..cb758307 Binary files /dev/null and b/public/img/moon.png differ diff --git a/public/img/sun.png b/public/img/sun.png new file mode 100644 index 00000000..c1c92746 Binary files /dev/null and b/public/img/sun.png differ diff --git a/public/js/main.js b/public/js/main.js index 0af21ace..f34c0abe 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,3 +1,27 @@ +// Night mode +// also sorry that this code is soo bad, literally nothing else worked.. ima remake it in a near future +var night = localStorage.getItem("night"); +if (night=="true") { + document.getElementById("style").href = "/css/style-night.css"; + document.getElementById("nightbutton").innerHTML = "Day!"; +} + +function toggleNightMode() { + var styleshieeet = document.getElementById("style").href; + var styleshieet = new RegExp("style.css"); + var stylesheet = styleshieet.test(styleshieeet); + if (stylesheet==true) { + document.getElementById("style").href = "/css/style-night.css"; + document.getElementById("nightbutton").innerHTML = "Day!"; + localStorage.setItem("night", "true"); + } + else { + document.getElementById("style").href = "/css/style.css"; + document.getElementById("nightbutton").innerHTML = "Night!"; + localStorage.setItem("night", "false"); + } +} + // Used by spoiler tags function toggleLayer(elem) { if (elem.classList.contains("hide")) diff --git a/templates/index.html b/templates/index.html index 1d3b5153..bf00535a 100755 --- a/templates/index.html +++ b/templates/index.html @@ -26,7 +26,7 @@ - +