-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
203 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
/* 深色模式相关 */ | ||
/* .darkmode-layer, .darkmode-toggle{z-index:101} */ | ||
.darkmode--activated img{isolation:isolate;mix-blend-mode:difference} | ||
.darkmode--activated .btn{isolation:isolate;mix-blend-mode:difference} | ||
.darkmode--activated select{background-color:#000;color:#E0E0E0} | ||
.darkmode--activated .hmd-loading{isolation:isolate;mix-blend-mode:difference} | ||
.darkmode--activated .alert{isolation:isolate;mix-blend-mode:difference} | ||
/* 深色模式相关 */ | ||
/* .darkmode-layer, .darkmode-toggle{z-index:101} */ | ||
.darkmode--activated img{isolation:isolate;mix-blend-mode:difference} | ||
.darkmode--activated .btn{isolation:isolate;mix-blend-mode:difference} | ||
.darkmode--activated select{background-color:#000;color:#E0E0E0} | ||
.darkmode--activated .hmd-loading{isolation:isolate;mix-blend-mode:difference} | ||
.darkmode--activated .alert{isolation:isolate;mix-blend-mode:difference} | ||
|
||
/* 加载进度条 */ | ||
.loading-bar { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
z-index: 99999; | ||
opacity: 0; | ||
transition: opacity .4s linear; | ||
|
||
.progress { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 0; | ||
height: 4px; | ||
background-color: #007bff; | ||
box-shadow: 0 0 10px rgba(119, 182, 255, .7); | ||
} | ||
|
||
&.loading { | ||
opacity: 1; | ||
transition: none; | ||
|
||
.progress { | ||
transition: width .4s ease; | ||
} | ||
} | ||
} | ||
/* 加载进度条结束 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var pjax = new Pjax({ | ||
selectors: [ | ||
"head meta", | ||
"head title", | ||
".container", | ||
".pjax-reload" | ||
], | ||
}); | ||
|
||
function pjax_reload() { | ||
includeHTML(); | ||
} | ||
|
||
document.addEventListener("pjax:complete", function () { | ||
pjax_reload(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,60 @@ | ||
// 获取用户使用的语种。 | ||
var lang = translate.language.getCurrent(); | ||
var giscus_lang = "zh-CN"; | ||
switch (lang) { | ||
case "chinese_traditional": | ||
giscus_lang = "zh-TW"; | ||
break; | ||
case "english": | ||
giscus_lang = "en"; | ||
break; | ||
case "spanish": | ||
giscus_lang = "es"; | ||
break; | ||
case "japanese": | ||
giscus_lang = "ja"; | ||
break; | ||
case "korean": | ||
giscus_lang = "ko"; | ||
break; | ||
case "french": | ||
giscus_lang = "fr"; | ||
break; | ||
case "arabic": | ||
giscus_lang = "ar"; | ||
break; | ||
default: | ||
giscus_lang = "zh-CN"; | ||
break; | ||
} | ||
|
||
var giscus = function () { | ||
const script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.src = "https://giscus.app/client.js"; | ||
|
||
|
||
script.setAttribute("data-repo", "Hamud-Lang/Hamud_Book"); | ||
script.setAttribute("data-repo-id", "R_kgDOKAX-uw"); | ||
script.setAttribute("data-category", "Announcements"); | ||
script.setAttribute("data-category-id", "DIC_kwDOKAX-u84CYRSk"); | ||
|
||
script.setAttribute("data-mapping", "title"); | ||
script.setAttribute("data-strict", "1"); | ||
script.setAttribute("data-reactions-enabled", "1"); | ||
script.setAttribute("data-emit-metadata", "0"); | ||
script.setAttribute("data-input-position", "top"); | ||
script.setAttribute("data-theme", "light_high_contrast"); | ||
script.setAttribute("data-lang", giscus_lang); | ||
|
||
script.crossOrigin = "anonymous"; | ||
script.async = true; | ||
document.getElementById("giscus-container").appendChild(script); | ||
}; | ||
|
||
window.addEventListener('load', giscus); | ||
const getCurrentLanguage = function () { | ||
var lang = translate.language.getCurrent(); | ||
var giscus_lang = "zh-CN"; | ||
switch (lang) { | ||
case "chinese_traditional": | ||
giscus_lang = "zh-TW"; | ||
break; | ||
case "english": | ||
giscus_lang = "en"; | ||
break; | ||
case "spanish": | ||
giscus_lang = "es"; | ||
break; | ||
case "japanese": | ||
giscus_lang = "ja"; | ||
break; | ||
case "korean": | ||
giscus_lang = "ko"; | ||
break; | ||
case "french": | ||
giscus_lang = "fr"; | ||
break; | ||
case "arabic": | ||
giscus_lang = "ar"; | ||
break; | ||
default: | ||
giscus_lang = "zh-CN"; | ||
break; | ||
} | ||
return giscus_lang; | ||
}; | ||
|
||
var SetupGiscus = function (giscus_lang) { | ||
const script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.src = "https://giscus.app/client.js"; | ||
|
||
|
||
script.setAttribute("data-repo", "Hamud-Lang/Hamud_Book"); | ||
script.setAttribute("data-repo-id", "R_kgDOKAX-uw"); | ||
script.setAttribute("data-category", "Announcements"); | ||
script.setAttribute("data-category-id", "DIC_kwDOKAX-u84CYRSk"); | ||
|
||
script.setAttribute("data-mapping", "title"); | ||
script.setAttribute("data-strict", "1"); | ||
script.setAttribute("data-reactions-enabled", "1"); | ||
script.setAttribute("data-emit-metadata", "0"); | ||
script.setAttribute("data-input-position", "top"); | ||
script.setAttribute("data-theme", "light_high_contrast"); | ||
script.setAttribute("data-lang", giscus_lang); | ||
script.setAttribute("data-loading", "lazy"); | ||
|
||
script.crossOrigin = "anonymous"; | ||
script.async = true; | ||
if (document.getElementById("giscus-container") != null) { | ||
document.getElementById("giscus-container").appendChild(script); | ||
} | ||
}; | ||
|
||
window.addEventListener('load', () => SetupGiscus(getCurrentLanguage())); |
Oops, something went wrong.