50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import "../apps/Dashboard/Dashboard.js"
|
|
import "../apps/Forum/Forum.js"
|
|
import "../apps/Tasks/Tasks.js"
|
|
import "../apps/Messages/Messages.js"
|
|
import "../apps/Market/Market.js"
|
|
import "../apps/Jobs/Jobs.js"
|
|
import "../apps/People/People.js"
|
|
|
|
class AppWindow extends Shadow {
|
|
|
|
calculateWidth() {
|
|
let sidebar = $("sidebar-").getBoundingClientRect()
|
|
let w = sidebar.width
|
|
return w
|
|
}
|
|
|
|
calculateHeight() {
|
|
let appmenu = $("app-menu").getBoundingClientRect()
|
|
let h = appmenu.height
|
|
return h
|
|
}
|
|
|
|
render() {
|
|
ZStack(() => {
|
|
switch(window.currentApp) {
|
|
case "Dashboard":
|
|
Dashboard()
|
|
break;
|
|
case "People":
|
|
People()
|
|
break;
|
|
}
|
|
})
|
|
.overflow("scroll")
|
|
.position("absolute")
|
|
.onEvent("resize", () => {
|
|
this.rerender()
|
|
})
|
|
.width(window.innerWidth - this.calculateWidth(), px)
|
|
.height(window.innerHeight - this.calculateHeight(), px)
|
|
.background("var(--app)")
|
|
.x(this.calculateWidth(), px)
|
|
.yBottom(this.calculateHeight(), px)
|
|
.onEvent("appchange", () => {
|
|
this.rerender()
|
|
})
|
|
}
|
|
}
|
|
|
|
register(AppWindow, "app-window") |