INNER CODE UNIT · JavaScript
updateA11y
yashab-cyber/opendroid · website/js/main.js:8
const updateA11y = () => {
const isLight = root.getAttribute('data-theme') === 'light';
toggle.setAttribute('aria-pressed', String(isLight));
toggle.setAttribute('aria-label', isLight ? 'Enable dark mode' : 'Enable light mode');
};
updateA11y();
toggle.addEventListener('click', () => {
const next = root.getAttribute('data-theme') === 'light' ? 'dark' : 'light';
root.setAttribute('data-theme', next);
try { localStorage.setItem(STORAGE_KEY, next); } catch (e) { /* storage unavailable, ignore */ }
updateA11y();
});
})();
// ── Hamburger Menu ──
const hamburger = document.getElementById('nav-hamburger');
const navLinks = document.getElementById('nav-links');