forked from izu/student-web-if-development-kit
refactor(tapops): modularize page code
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { CounterAnimation } from './components/counter-animation.js';
|
||||
import { AccessibilityToggleController } from './controllers/accessibility-toggle-controller.js';
|
||||
import { DocumentRepository } from './controllers/document-repository.js';
|
||||
import { MobileMenuController } from './controllers/mobile-menu-controller.js';
|
||||
import { NavigationController } from './controllers/navigation-controller.js';
|
||||
import { pageTemplate } from './templates/page-template.js';
|
||||
|
||||
class TapopsApp {
|
||||
constructor(root = document.getElementById('tapops-page-root')) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
init() {
|
||||
if (!this.root) return;
|
||||
|
||||
this.root.innerHTML = pageTemplate();
|
||||
window.applyLang?.();
|
||||
window.applyTp?.(this.root);
|
||||
|
||||
new NavigationController().init();
|
||||
new MobileMenuController().init();
|
||||
new AccessibilityToggleController().init();
|
||||
new CounterAnimation().init();
|
||||
new DocumentRepository().init();
|
||||
}
|
||||
}
|
||||
|
||||
new TapopsApp().init();
|
||||
Reference in New Issue
Block a user