diff options
| -rw-r--r-- | assets/js/miracles.min.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js index 27d1a1f..c7ec942 100644 --- a/assets/js/miracles.min.js +++ b/assets/js/miracles.min.js @@ -68,6 +68,7 @@ function gotoPosition(e){ /**
* Dark theme
*/
+
//toggleDark
function Dark() {
//Add classs to use dark theme
@@ -116,16 +117,12 @@ function Sepia() { */
//explore and load dark theme
var whetherDark = getCookie("darkTheme");
-var whetherGray = getCookie("grayFilter");
-var whetherSepia = getCookie("sepiaFilter");
var schemeGeter = window.matchMedia ("(prefers-color-scheme: dark)");
if (whetherDark == "on" || schemeGeter.matches) {
$("body").addClass("body-dark");
-} else if (whetherGray == "on") {
- $("html").addClass("html-filter-gray");
-} else if (whetherSepia == "on") {
- $("html").addClass("html-filter-sepia");
-}
+ $("#toggle-dark-button").html('<i class="iconfont icon-sun"></i>');
+ $("#toggle-dark-mobile").html('<i class="iconfont icon-sun"></i>');
+}
//支持系统深色模式
function swDarkMode(scheme){
if(scheme.matches)
@@ -396,7 +393,7 @@ if (loadPjax = true) { /**
* NavBar Scroll Change
*/
-var navBar_height = navBar.clientHeight
+var navBar_height = navBar.clientHeight;
function navUpdate() {
if(allowNavAero==true) {
@@ -404,10 +401,16 @@ var navBar_height = navBar.clientHeight if (scrollTop > navBar_height) {
navBar.classList.remove("nav-aero");
navBarMobile.classList.remove("nav-aero");
+ $(".nav-icon-button").css("color", "#000");
} else {
navBar.classList.add("nav-aero");
navBarMobile.classList.add("nav-aero");
-
+ if ($(".index-banner").css("background-image")=="url('')") {
+ $(".nav-icon-button").css("color", "#000");
+ }
+ else {
+ $(".nav-icon-button").css("color", "#fff");
+ }
}
}
}
|
