-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
index.html
36 lines (30 loc) · 1.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!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 start
globalChangeTheme();
</script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>