(function() { const body = document.body; const prefersDark = window.matchMedia('(prefers-color-scheme: dark)'); // ๐Ÿงน Hapus dulu class default dari tema biar nggak ke-lock di dark body.classList.remove('dark-theme', 'light-theme'); function applyTheme(mode) { if (mode === 'dark') { body.classList.add('dark-theme'); body.classList.remove('light-theme'); } else { body.classList.add('light-theme'); body.classList.remove('dark-theme'); } updateLogos(mode); } function updateLogos(mode) { document.querySelectorAll('.logo-light, .logo-dark').forEach(img => { img.style.display = 'none'; }); if (mode === 'dark') { document.querySelectorAll('.logo-dark').forEach(img => img.style.display = 'inline'); } else { document.querySelectorAll('.logo-light').forEach(img => img.style.display = 'inline'); } } // ๐Ÿ”ฅ Terapkan tema default sesuai preferensi OS/device applyTheme(prefersDark.matches ? 'dark' : 'light'); // ๐Ÿ” Dengar perubahan realtime dari sistem (tanpa reload) prefersDark.addEventListener('change', e => { applyTheme(e.matches ? 'dark' : 'light'); }); // ๐Ÿ–ฒ๏ธ Tombol toggle manual (tanpa localStorage) const toggleBtn = document.querySelector('#theme-toggle'); if (toggleBtn) { toggleBtn.addEventListener('click', () => { const isDark = body.classList.contains('dark-theme'); applyTheme(isDark ? 'light' : 'dark'); }); } })();
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the fast-indexing-api domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/metp5898/public_html/fokus.co.id/wp-includes/functions.php on line 6121
https://fokus.co.id