/* EasyDNS UI progressive enhancements. No secrets, auth state or API tokens in JS. */ (() => { 'use strict'; const side = document.getElementById('sidebar'); const toggle = document.getElementById('menuToggle'); const cover = document.getElementById('sidebarOverlay'); const close = () => { side?.classList.remove('open'); cover?.classList.remove('open'); toggle?.setAttribute('aria-expanded', 'false'); }; toggle?.addEventListener('click', () => {const on = side.classList.toggle('open');cover?.classList.toggle('open', on);toggle.setAttribute('aria-expanded', String(on));}); cover?.addEventListener('click', close); document.addEventListener('keydown', e => {if(e.key === 'Escape') close();}); document.querySelectorAll('.notice-dismiss').forEach(el => el.addEventListener('click', () => el.closest('.notice')?.remove())); document.querySelectorAll('.bar-fill[data-count]').forEach(bar => { const count = Number(bar.dataset.count), total = Number(bar.dataset.total); const ratio = Number.isFinite(count) && Number.isFinite(total) && total > 0 ? 100 * count / total : 0; bar.style.width = Math.max(0, Math.min(100, ratio)) + '%'; bar.title = ratio.toFixed(1) + '% of total'; }); })();