-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (65 loc) · 2.19 KB
/
index.html
File metadata and controls
69 lines (65 loc) · 2.19 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" itemscope="" itemtype="http://schema.org/Webpage">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<meta name="theme-color" content="#efeee5" />
<style>
/* Critical CSS - Inline for instant rendering */
body:not(.react-loaded) * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body:not(.react-loaded) {
font-family: system-ui, -apple-system, sans-serif;
background: rgb(10, 18, 40);
min-height: 100vh;
overflow: hidden;
}
body:not(.react-loaded) #loading-screen {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: rgb(10, 18, 40);
z-index: 50;
}
</style>
<script>
// Initialize theme before React mounts to prevent FOUC
(function () {
var themeColors = { light: '#efeee5', dark: '#1a1a1a', star: '#000a1a' };
var theme = localStorage.getItem('theme');
var resolved = 'light';
// Handle explicit theme from localStorage
if (theme === 'dark') {
document.documentElement.classList.add('dark');
resolved = 'dark';
} else if (theme === 'star') {
document.documentElement.classList.add('star');
resolved = 'star';
} else if (theme === 'light') {
// Light theme is default, no class needed
} else {
// No theme set, use system preference
var isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (isDark) {
document.documentElement.classList.add('dark');
resolved = 'dark';
}
}
// Set theme-color meta tag to match resolved theme
var meta = document.querySelector('meta[name="theme-color"]');
if (meta) meta.setAttribute('content', themeColors[resolved]);
})();
</script>
</head>
<body>
<div id="loading-screen"></div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>