-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (63 loc) · 2.34 KB
/
index.html
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
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
<!-- Icona per il favicon e il PWA -->
<link rel="icon" href="/icon.png" sizes="32x32" type="image/png" />
<link rel="icon" href="/icon.png" sizes="192x192" type="image/png" />
<link rel="apple-touch-icon" href="/icon.png" />
<!-- Colore per la status bar su Safari iOS -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<!-- Barra di stato trasparente in Chrome -->
<meta name="theme-color" content="#f0f0f0" />
<!-- Descrizione del sito -->
<meta name="description" content="Gestisci le tue finanze in modo semplice e veloce." />
<!-- Manifest per PWA -->
<link rel="manifest" href="/manifest.json" />
<title>Soldi Sotto</title>
<!-- Script per applicare il tema salvato prima del caricamento di React -->
<script>
(function () {
const savedTheme = localStorage.getItem("theme") || "system";
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
const isDarkMode = savedTheme === "dark" || (savedTheme === "system" && systemPrefersDark);
document.documentElement.classList.toggle("dark-theme", isDarkMode);
document.documentElement.classList.toggle("light-theme", !isDarkMode);
// Aggiorna il colore del meta tag per il caricamento iniziale
document
.querySelector('meta[name="theme-color"]')
.setAttribute("content", isDarkMode ? "#1f1f1f" : "#f0f0f0");
})();
</script>
<style>
/* Tema scuro di default */
:root {
--background-color: #1f1f1f;
--text-color: #e0e0e0;
--primary-color: #1a73e8;
}
/* Tema chiaro */
.light-theme {
--background-color: #f0f0f0;
--text-color: #333333;
--primary-color: #007bff;
}
body {
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: var(--background-color);
color: var(--text-color);
transition: background-color 0.3s ease, color 0.3s ease;
}
</style>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!-- Script principale -->
<script type="module" src="/src/main.jsx"></script>
</body>
</html>