forked from Nathced/nathced.eu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (38 loc) · 1.57 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="src/assets/icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="title" content="Nathced - Maintenance" />
<meta name="description" content="Site en maintenance pour l'instant. Mail : indisponible" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<title>En Maintenance -- Nathced</title>
</head>
<body>
<div id="root"></div>
<button id="toggleTheme">
<i id="themeIcon" class="fas fa-sun"></i>
</button>
<script type="module" src="/src/main.tsx"></script>
<script>
const toggleButton = document.getElementById('toggleTheme');
const themeIcon = document.getElementById('themeIcon');
const currentTheme = localStorage.getItem('theme') || 'dark'; // Par défaut, sombre
if (currentTheme === 'light') {
document.body.classList.add('light-mode');
themeIcon.classList.replace('fa-sun', 'fa-moon');
}
toggleButton.addEventListener('click', () => {
document.body.classList.toggle('light-mode');
if (document.body.classList.contains('light-mode')) {
themeIcon.classList.replace('fa-moon', 'fa-sun');
localStorage.setItem('theme', 'light');
} else {
themeIcon.classList.replace('fa-sun', 'fa-moon');
localStorage.setItem('theme', 'dark');
}
});
</script>
</body>
</html>