533 Star 6K Fork 767

qishibo / 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>
JavaScript
1
https://gitee.com/qishibo/AnotherRedisDesktopManager.git
git@gitee.com:qishibo/AnotherRedisDesktopManager.git
qishibo
AnotherRedisDesktopManager
AnotherRedisDesktopManager
master

搜索帮助