diff --git a/index.html b/index.html index 0cfac60..a789943 100644 --- a/index.html +++ b/index.html @@ -547,7 +547,7 @@ width: min(calc(100% - 2.4rem), 24.5rem); height: 3.34rem; display: grid; - grid-template-columns: repeat(5, minmax(0, 1fr)); + grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 0.06rem; padding: 0.22rem; @@ -665,14 +665,18 @@
diff --git a/js/ui/bottomNav.js b/js/ui/bottomNav.js index 9f12cfd..e1f35c3 100644 --- a/js/ui/bottomNav.js +++ b/js/ui/bottomNav.js @@ -1,33 +1,4 @@ -function syncThemeToggleButton(btn, isDark) { - if (!btn) return; - const icon = btn.querySelector('i'); - if (icon) icon.className = isDark ? 'fas fa-sun' : 'fas fa-moon'; - btn.setAttribute('aria-label', isDark ? 'Włącz jasny motyw' : 'Włącz ciemny motyw'); - btn.title = isDark ? 'Jasny motyw' : 'Ciemny motyw'; -} - -function setupThemeToggle() { - const btn = document.getElementById('nav-theme-toggle'); - if (!btn) return; - - btn.addEventListener('click', () => { - const html = document.documentElement; - const isDark = html.classList.toggle('dark'); - localStorage.setItem('theme', isDark ? 'dark' : 'light'); - - syncThemeToggleButton(btn, isDark); - - const meta = document.querySelector('meta[name="theme-color"]'); - if (meta) { - const varName = isDark ? '--sunken-deep-rgb' : '--app-bg-rgb'; - const rgb = getComputedStyle(document.documentElement).getPropertyValue(varName).trim(); - if (rgb) meta.setAttribute('content', `rgb(${rgb})`); - } - }); -} - export function getBottomNavHTML() { - const isDark = document.documentElement.classList.contains('dark'); return `
`; @@ -99,7 +65,6 @@ export function setupBottomNav({ refreshPantry, refreshShoppingList } = {}) { if (TABS.includes(tab)) apply(tab); }); - setupThemeToggle(); apply('planner'); window.refreshStockViews = () => {