1 Star 0 Fork 813

感兴趣的项目/AnotherRedisDesktopManager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.html 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
qishibo 提交于 2024-03-04 22:20 . change title bar theme while toggle mode
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" id="theme-link">
<title>Another Redis Desktop Manager</title>
</head>
<body>
<!-- this script must be placed here after body -->
<script type="text/javascript">
const ipcRenderer = require('electron').ipcRenderer;
function globalChangeTheme(theme) {
theme && (localStorage.theme = theme);
!theme && (theme = localStorage.theme);
const themeName = (theme == 'dark' ? 'dark' : 'chalk');
const themeHref = 'static/theme/' + themeName + '/index.css';
document.getElementById('theme-link').href = themeHref;
themeName == 'dark' ? document.body.classList.add('dark-mode') :
document.body.classList.remove('dark-mode');
// change native theme
ipcRenderer.invoke('changeTheme', themeName);
}
// theme init
globalChangeTheme();
</script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yat-project/AnotherRedisDesktopManager.git
git@gitee.com:yat-project/AnotherRedisDesktopManager.git
yat-project
AnotherRedisDesktopManager
AnotherRedisDesktopManager
master

搜索帮助