Skip to content

Commit 8442e1b

Browse files
committed
Deploying to gh-pages from @ 4f12742 🚀
1 parent 01019c4 commit 8442e1b

22 files changed

+57
-15
lines changed

404.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,35 @@
137137

138138
<script src="_framework/blazor.webassembly.js"></script>
139139
<script>
140+
// Initialize theme on page load to prevent flash
141+
(function() {
142+
const savedTheme = localStorage.getItem('theme');
143+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
144+
const isDarkMode = savedTheme === 'dark' || (savedTheme === null && prefersDark);
145+
146+
if (isDarkMode) {
147+
document.documentElement.classList.add('dark');
148+
} else {
149+
document.documentElement.classList.remove('dark');
150+
}
151+
})();
152+
140153
window.toggleTheme = (isDarkMode) => {
141154
const html = document.documentElement;
142155
if (isDarkMode) {
143156
html.classList.add('dark');
157+
localStorage.setItem('theme', 'dark');
144158
} else {
145159
html.classList.remove('dark');
160+
localStorage.setItem('theme', 'light');
146161
}
147162
};
163+
164+
window.getTheme = () => {
165+
const savedTheme = localStorage.getItem('theme');
166+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
167+
return savedTheme === 'dark' || (savedTheme === null && prefersDark);
168+
};
148169
</script>
149170
<!-- <script>navigator.serviceWorker.register('service-worker.js');</script>-->
150171
</body>
-6.27 KB
Binary file not shown.
-2.18 KB
Binary file not shown.
-2.46 KB
Binary file not shown.
6.27 KB
Binary file not shown.
2.21 KB
Binary file not shown.
2.48 KB
Binary file not shown.
27.3 KB
Binary file not shown.
33.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)