1. fix algolia_search bug #1

2. add read mode
This commit is contained in:
hwy0127@gmail.com
2019-06-11 15:05:27 +08:00
Unverified
parent ee434f7dc4
commit 66d4f279f9
13 changed files with 362 additions and 291 deletions

View File

@@ -1,28 +1,31 @@
$(function() {
$(function () {
changeReadModel();
function switchReadMode() {
var next_mode = $("body").hasClass("night-mode") ? "day" : "night";
Cookies.set("read-mode", next_mode, {expires: 7, path: '/'});
Cookies.set("night-mode", next_mode, {
expires: 7,
path: '/'
});
changeReadModel();
}
function changeReadModel() {
if (Cookies.get("read-mode") == "night") {
if (Cookies.get("night-mode") == "night") {
$("body").addClass("night-mode");
$("#nightshift").removeClass("fa-moon-o").addClass("fa-sun-o");
}
// 非夜間模式
if (Cookies.get("read-mode") == "day") {
if (Cookies.get("night-mode") == "day") {
$("body").removeClass("night-mode");
$("#nightshift").removeClass("fa-sun-o").addClass("fa-moon-o");
}
}
$("#nightshift").click(function() {
$("#nightshift").click(function () {
switchReadMode();
});
});
});