Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #148 from redsPL/master

Added the night mode toggle button+fixed a few things in CSS
Cette révision appartient à :
keo 2017-05-07 20:01:44 +03:00 révisé par GitHub
révision a80c08b9be
6 fichiers modifiés avec 49 ajouts et 11 suppressions

Voir le fichier

@ -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 {

Voir le fichier

@ -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;

BIN
public/img/moon.png Fichier normal

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 4,7 Kio

BIN
public/img/sun.png Fichier normal

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 5,5 Kio

Voir le fichier

@ -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 = "<img id='sunmoon' src='/img/sun.png' alt='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 = "<img id='sunmoon' src='/img/sun.png' alt='Day!'>";
localStorage.setItem("night", "true");
}
else {
document.getElementById("style").href = "/css/style.css";
document.getElementById("nightbutton").innerHTML = "<img id='sunmoon' src='/img/moon.png' alt='Night!'>";
localStorage.setItem("night", "false");
}
}
// Used by spoiler tags
function toggleLayer(elem) {
if (elem.classList.contains("hide"))

Voir le fichier

@ -26,7 +26,7 @@
<![endif]-->
<!-- Website CSS -->
<link rel="stylesheet" href="{{.URL.Parse "/css/style.css"}}">
<link rel="stylesheet" id="style" href="{{.URL.Parse "/css/style.css"}}">
</head>
<body>
<nav class="navbar navbar-default" id="mainmenu">
@ -47,6 +47,8 @@
<li><a href="irc://irc.rizon.net/nyaapantsu">IRC</a></li>
<li><a href="{{ genRouteWithQuery "feed" .URL }}">RSS</a></li>
<li><a href="https://sukebei.pantsu.cat">Fap</a></li>
<li><a href="javascript:void(0);" id="nightbutton" onclick='toggleNightMode();'><img id="sunmoon" src="/img/moon.png" alt="Night!"></a></li>
</ul>
<form class="navbar-form navbar-right" role="search" action="/search" method="get">
<div class="form-group">
@ -54,7 +56,7 @@
{{block "search_button" .}}{{end}}
</div>
</form>
</div>
</div>
</div>
</nav>