Skip to content

Commit

Permalink
Improve on load screen
Browse files Browse the repository at this point in the history
  • Loading branch information
HuakunShen committed Jun 27, 2024
1 parent 08a8599 commit 3e0d073
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions devclean-ui/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<!doctype html>
<html lang="en">
<html lang="en" class="dark">

<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>Tauri + React + TS</title>
<style>
body {
html {
background-color: white;
}

body.dark {
html.dark {
background-color: hsl(222.2, 84%, 4.9%);
}
</style>
Expand All @@ -22,15 +22,20 @@
<script>
const themeColor = localStorage.getItem("devclean-ui-theme")
if (themeColor) {
document.body.classList.add(themeColor)
if (themeColor === "dark") {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
} else {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark')
document.documentElement.classList.add('dark')
} else {
document.body.classList.add('light')
document.documentElement.classList.remove('dark')
}
}
</script>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>

0 comments on commit 3e0d073

Please sign in to comment.