style poland-mode
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user