Merge pull request #148 from redsPL/master
Added the night mode toggle button+fixed a few things in CSS
Cette révision appartient à :
révision
99244542b5
6 fichiers modifiés avec 49 ajouts et 11 suppressions
|
@ -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 {
|
||||
|
|
|
@ -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
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
BIN
public/img/sun.png
Fichier normal
Fichier binaire non affiché.
Après Largeur: | Hauteur: | Taille: 5,5 Kio |
|
@ -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"))
|
||||
|
|
|
@ -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">
|
||||
|
|
Référencer dans un nouveau ticket