forked from r1n7aro/Locus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (63 loc) · 2.14 KB
/
index.html
File metadata and controls
69 lines (63 loc) · 2.14 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
63
64
65
66
67
68
69
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Locus</title>
<style>
html,
body,
#app {
width: 100%;
height: 100%;
margin: 0;
}
body {
background: #1d1d21;
color: #a1a4ad;
font-family: var(--font-ui, ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", monospace);
font-size: 14px;
}
html[data-theme="light"] body {
background: #f6f7f8;
color: #5b6270;
}
html[data-theme="dark"] body {
background: #1d1d21;
color: #a1a4ad;
}
#app:empty {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}
#app:empty::before {
content: "Locus";
}
</style>
</head>
<body>
<script>
// Apply theme before Vue mounts to prevent flash of wrong theme.
// Canvas windows (/canvas or ?specId=) keep their own styles.
(function(){
if(/\/canvas|specId=/.test(location.pathname+location.search))return;
var params=new URLSearchParams(location.search);
var isUnityEmbed=location.pathname!=='/unity-embed-test'&&
(location.pathname==='/unity-embed'||params.get('host')==='unity');
var key=isUnityEmbed?'locus-unity-embed-theme-preference':'locus-theme-preference';
var fallback='dark';
var p;try{p=localStorage.getItem(key)}catch(e){}
p=p==='light'||p==='dark'||p==='system'?p:fallback;
var t=p==='light'?'light':p==='dark'?'dark':
(window.matchMedia('(prefers-color-scheme:dark)').matches?'dark':'light');
document.documentElement.setAttribute('data-theme',t);
})();
</script>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>