Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Feb 13, 2024
1 parent 749302b commit ccd07e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion views/hand.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ headline="反馈"



<script>if (localStorage.darkTheme) {
<script>
if (localStorage.darkTheme) {
document.body.classList.add("mdui-theme-layout-dark");
document.body.classList.add("mdui-theme-dark");
document.documentElement.classList.add("mdui-theme-dark");
Expand Down
23 changes: 22 additions & 1 deletion views/python/python_edit.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,25 @@ href="<%= process.env.staticurl %>/vs/editor/editor.main.css"
</body>

</html>
<script>qiniuurl = '<%= process.env.qiniuurl %>'</script>
<script>qiniuurl = '<%= process.env.qiniuurl %>'</script>
<script>if (localStorage.darkTheme) {
document.body.classList.add("mdui-theme-layout-dark");
document.body.classList.add("mdui-theme-dark");
document.documentElement.classList.add("mdui-theme-dark");
document.body.setAttribute("dark", "");
$("#layui_theme_css").attr("href", "<%= process.env.staticurl %>/css/layui-theme-dark.css");
}
document.getElementById("switch-theme").addEventListener("click", () => {
document.body.classList.toggle("mdui-theme-layout-dark");
document.body.classList.toggle("mdui-theme-dark");
document.documentElement.classList.toggle("mdui-theme-dark");
document.body.toggleAttribute("dark");
if (document.body.hasAttribute("dark")) {
localStorage.darkTheme = true;
$("#layui_theme_css").attr("href", "<%= process.env.staticurl %>/css/layui-theme-dark.css");
} else {
delete localStorage.darkTheme;
$("#layui_theme_css").removeAttr("href");
}
});
mdui.setColorScheme('#2087fd');</script>

0 comments on commit ccd07e6

Please sign in to comment.