2023-10-23 23:32:25 +02:00
|
|
|
import App from "../../App";
|
2023-10-30 11:08:22 +01:00
|
|
|
import Overview from "./Overview/Overview";
|
2023-10-23 23:32:25 +02:00
|
|
|
import Settings from "./Settings/Settings";
|
|
|
|
|
|
|
|
|
|
|
|
export default class More {
|
|
|
|
constructor() {
|
|
|
|
this.app = new App()
|
|
|
|
this.config = this.app.config
|
2023-10-30 11:08:22 +01:00
|
|
|
this.overview = new Overview()
|
2023-10-23 23:32:25 +02:00
|
|
|
this.settings = new Settings()
|
|
|
|
this.init()
|
|
|
|
}
|
|
|
|
|
|
|
|
init() {
|
2023-10-30 11:08:22 +01:00
|
|
|
this.overview.init()
|
2023-10-23 23:32:25 +02:00
|
|
|
this.settings.init()
|
|
|
|
this.initPager()
|
|
|
|
}
|
|
|
|
|
|
|
|
initPager() {
|
2023-10-30 11:08:22 +01:00
|
|
|
let switcher = document.querySelector(".subswitch")
|
2023-10-23 23:32:25 +02:00
|
|
|
let buttons = switcher.children
|
2023-10-30 11:08:22 +01:00
|
|
|
let subsettings = document.querySelector(".subpages")
|
2023-10-23 23:32:25 +02:00
|
|
|
|
|
|
|
for (let i = 0; i < buttons.length; i++) {
|
|
|
|
let button = buttons[i]
|
|
|
|
subsettings.children[i].setAttribute("style", `--n: ${i}`)
|
|
|
|
|
|
|
|
button.addEventListener("click", () => {
|
|
|
|
let calculatedHeight = subsettings.children[i].offsetHeight
|
|
|
|
subsettings.style.height = `${calculatedHeight}px`
|
|
|
|
subsettings.parentNode.setAttribute("style", `--id: ${i}`)
|
|
|
|
switcher.setAttribute("style", `--switches: ${buttons.length}`)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
buttons[0].click()
|
|
|
|
}
|
|
|
|
}
|