forked from tanh1c/hcmut-tutor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (58 loc) · 1.88 KB
/
Copy pathindex.html
File metadata and controls
65 lines (58 loc) · 1.88 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
<!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>Tutor Support System</title>
<!-- Prevent flash of unstyled content (FOUC) in dark mode -->
<script>
// Load theme from localStorage immediately before page renders
(function() {
const theme = localStorage.getItem('theme') || 'light';
const root = document.documentElement;
if (theme === 'dark') {
root.classList.add('dark');
root.style.backgroundColor = '#111827'; // bg-gray-900
// document.body may not exist yet in <head>
if (document.body) {
document.body.style.backgroundColor = '#111827';
}
} else {
root.classList.remove('dark');
root.style.backgroundColor = '#f9fafb'; // bg-gray-50
// document.body may not exist yet in <head>
if (document.body) {
document.body.style.backgroundColor = '#f9fafb';
}
}
})();
</script>
<style>
/* Prevent white flash on page load */
html, body {
margin: 0;
padding: 0;
transition: background-color 0.2s ease;
}
/* Default dark mode background if theme is not set */
html.dark {
background-color: #111827;
}
html.dark body {
background-color: #111827;
}
/* Default light mode background */
html:not(.dark) {
background-color: #f9fafb;
}
html:not(.dark) body {
background-color: #f9fafb;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>