url scheme done, switch between apps and orgs mostly done

This commit is contained in:
metacryst
2026-01-12 14:10:17 -06:00
parent 434ecac47a
commit 419c8b1151
20 changed files with 406 additions and 215 deletions

View File

@@ -1,3 +1,4 @@
import "../apps/Dashboard/Dashboard.js"
import "../apps/Forum/Forum.js"
import "../apps/Tasks/Tasks.js"
import "../apps/Messages/Messages.js"
@@ -5,16 +6,25 @@ import "../apps/Market/Market.js"
import "../apps/Jobs/Jobs.js"
class AppWindow extends Shadow {
app;
constructor(app) {
super()
this.app = app
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(this.app) {
switch(window.currentApp) {
case "Dashboard":
Dashboard()
break;
case "Forum":
Forum()
break;
@@ -30,25 +40,13 @@ class AppWindow extends Shadow {
}
})
.position("fixed")
.display(this.app ? 'block' : 'none')
.width(100, "vw")
.height(100, "vh")
.background("#591d10")
.x(0)
.y(0)
// .backgroundImage("/_/images/fabric.png")
// .backgroundSize("33vw auto")
.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())
}
open(app) {
this.app = app
this.rerender()
}
close() {
this.style.display = "none"
}
}
register(AppWindow, "app-window")