refactor(tapops): modularize page code

This commit is contained in:
Dodo
2026-06-04 18:13:23 +07:00
parent 529693cd5f
commit 1270ce60fd
41 changed files with 4678 additions and 4476 deletions
@@ -0,0 +1,22 @@
export class AccessibilityToggleController {
constructor({
triggerSelector = '[data-accessibility-toggle]',
panelId = 'access-panel',
} = {}) {
this.triggers = Array.from(document.querySelectorAll(triggerSelector));
this.panel = document.getElementById(panelId);
}
init() {
if (this.triggers.length === 0) return;
this.triggers.forEach(trigger => {
trigger.addEventListener('click', () => this.toggle());
});
}
toggle() {
if (!this.panel) return;
this.panel.classList.toggle('hidden');
this.panel.classList.toggle('flex');
}
}