style poland-mode

This commit is contained in:
2025-06-01 17:55:19 +02:00
parent 504702700c
commit 42c60f9db5
2 changed files with 47 additions and 43 deletions

View File

@@ -21,7 +21,7 @@
<li><a href="/mecze">📅 Mecze</a></li>
<li><a href="/statystyki">📊 Statystyki</a></li>
<li><a href="/statystyki">📊 Statystyki</a></li>
<!--<li><button id="theme-toggle" onclick="toggleTheme()">🌙 / 🌞</button></li>-->
<li><button id="theme-toggle" onclick="toggleTheme()">🌙 / 🌞</button></li>
</ul>
<div class="hamburger"></div>
</nav>
@@ -44,16 +44,16 @@
</script>
<script>
function toggleTheme() {
const currentMode = document.body.classList.contains('dark-mode') ? 'dark' : 'light';
const newMode = currentMode === 'light' ? 'dark' : 'light';
document.body.classList.toggle('dark-mode');
const currentMode = document.body.classList.contains('poland-mode') ? 'poland' : 'fcb';
const newMode = currentMode === 'fcb' ? 'poland' : 'fcb';
document.body.classList.toggle('poland-mode');
localStorage.setItem('theme', newMode);
}
window.onload = function () {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {
document.body.classList.add('dark-mode');
if (savedTheme === 'poland') {
document.body.classList.add('poland-mode');
}
}
</script>