commit
8c4d463f1e
96 files changed
+3319
No files matched your search
@@ -0,0 +1,18 @@
|
||||
/* 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';
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user