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

@@ -9,43 +9,49 @@ class Home extends Shadow {
ZStack(() => {
Sidebar()
switch(window.location.pathname) {
case "/":
AppWindow()
AppMenu()
break
case "/app/jobs":
AppWindow("Jobs")
AppMenu("Jobs")
break;
case "/app/messages":
AppWindow("Messages")
AppMenu("Messages")
break;
case "/app/market":
AppWindow("Market")
AppMenu("Market")
break;
case "/app/forum":
AppWindow("Forum")
AppMenu("Forum")
break;
default:
throw new Error("Unknown route!")
}
AppMenu()
AppWindow()
HStack(() => {
// ProfileButton()
// .zIndex(1)
// .cursor("default")
let selected = document.documentElement.className
console.log(selected)
select(() => {
option("")
option("Light").attr({value: "light"})
option("Dark").attr({value: "dark"})
option("Red").attr({value: "red"})
$(`option[value=${selected}]`).selected = "true"
})
.outline("none")
.background("transparent")
.height(2, em)
.color("var(--accent)")
.border("1px solid var(--accent)")
.attr({value: "dark"})
.onChange((e) => {
console.log("onchange")
document.documentElement.className = e.target.value
localStorage.setItem("theme", e.target.value);
const event = new CustomEvent('themechange', {
detail: {}
});
window.dispatchEvent(event)
})
.onHover(function (hovering) {
if(hovering) {
this.style.background = "var(--green)"
} else {
this.style.background = "transparent"
}
})
a("/signout", "Sign Out")
.background("transparent")
.border(window.location.pathname === "/" ? "1px solid var(--tan)" : "0.5px solid #bb7c36")
.color(window.location.pathname === "/" ? "var(--tan)" : "var(--accent)")
.borderRadius(5, px)
.border("1px solid var(--accent")
.color("var(--accent)")
.onHover(function (hovering) {
if(hovering) {
this.style.background = "var(--green)"
@@ -53,15 +59,6 @@ class Home extends Shadow {
this.style.background = ""
}
})
.onNavigate(function () {
if(window.location.pathname === "/") {
this.style.border = "1px solid var(--tan)"
this.style.color = "var(--tan)"
} else {
this.style.border = "0.5px solid #bb7c36"
this.style.color = "var(--accent)"
}
})
})
.gap(1, em)
.xRight(2, em).y(2.3, em)