-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (57 loc) · 2.07 KB
/
index.html
File metadata and controls
62 lines (57 loc) · 2.07 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!doctype html>
<html class="[scrollbar-width:] overflow-auto [&::-webkit-scrollbar]:hidden">
<head>
<link
rel="icon"
type="image/png"
href="/src/assets/images/favicon/favicon-96x96.png"
sizes="96x96"
/>
<link rel="icon" type="image/svg+xml" href="/src/assets/images/favicon/favicon.svg" />
<link rel="shortcut icon" href="/src/assets/images/favicon/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/src/assets/images/favicon/apple-touch-icon.png"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" />
<title>WebStray Authenticator</title>
<script>
(function () {
try {
const fs = require('fs');
const path = require('path');
const dataPath = nw.App.dataPath;
const dbPath = path.join(dataPath, 'vault.db');
let theme = 'dark';
if (fs.existsSync(dbPath)) {
const data = fs.readFileSync(dbPath, 'utf8');
const lines = data.split('\n');
for (const line of lines) {
if (line.includes('settings_config')) {
const configLine = lines.reverse().find((l) => l.includes('settings_config'));
if (configLine) theme = JSON.parse(configLine).theme;
break;
}
}
}
if (theme === 'system') {
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
document.documentElement.classList.add(theme);
document.documentElement.style.colorScheme = theme;
} catch (e) {
console.error('Theme injection failed', e);
document.documentElement.classList.add('dark');
}
})();
</script>
</head>
<body
class="bg-background h-dvh w-full selection:bg-black selection:text-white dark:selection:bg-white dark:selection:text-black"
>
<div id="root" class="flex h-screen"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>