1, 4: Fixing 404 after logged out, adding market entry

This commit is contained in:
metacryst
2025-11-10 04:05:21 -06:00
parent 6f9ed49b2e
commit 41c0bb57a3
16 changed files with 494 additions and 136 deletions

View File

@@ -64,12 +64,44 @@ class AppMenu extends Shadow {
.gap(1.5, em)
.paddingRight(2, em)
img("_/images/divider.svg", "40vw")
img("/_/images/divider.svg", "40vw")
.attr({
"id": "divider",
})
})
.gap(0.5, em)
.onNavigate(() => {
if(window.location.pathname === "/") {
this.styleMaximized()
$("app-window").close()
} else {
this.styleMinimized()
$("app-window").open(this.selected)
}
})
.onAppear(() => {
Array.from(this.querySelectorAll("p")).forEach((el) => {
el.addEventListener("mousedown", (e) => {
el.classList.add("touched")
})
})
window.addEventListener("mouseup", (e) => {
let target = e.target
if(!target.matches("app-menu p")) {
return
}
target.classList.remove("touched")
if(target.classList.contains("selected")) {
this.selected = ""
window.navigateTo("/")
} else {
this.selected = target.innerText
window.navigateTo("/app/" + target.innerText.toLowerCase())
}
})
})
if(this.selected) {
this.styleMinimized()
@@ -95,35 +127,6 @@ class AppMenu extends Shadow {
this.classList.add("minimized")
$("#divider").style.display = "none"
}
connectedCallback() {
Array.from(this.querySelectorAll("p")).forEach((el) => {
el.addEventListener("mousedown", (e) => {
el.classList.add("touched")
})
})
window.addEventListener("mouseup", (e) => {
let target = e.target
if(!target.matches("app-menu p")) {
return
}
target.classList.remove("touched")
if(target.classList.contains("selected")) {
this.selected = ""
this.styleMaximized(target)
window.navigateTo("/")
$("app-window").close()
} else {
this.selected = target.innerText
this.styleMinimized(target)
window.navigateTo("/app/" + target.innerText.toLowerCase())
$("app-window").open(target.innerText)
}
})
}
}
, "app-menu")

View File

@@ -1,6 +1,6 @@
import "../apps/Jobs/Jobs.js"
import "../apps/Messages.js"
import "../apps/Market.js"
import "../apps/Market/Market.js"
class AppWindow extends Shadow {
app;

View File

@@ -8,21 +8,20 @@ class Home extends Shadow {
render() {
ZStack(() => {
img("_/icons/logo.svg", "2.5em")
img("/_/icons/logo.svg", "2.5em")
.position("fixed")
.left("3em")
.top("3vh")
.zIndex(3)
// .onClick(() => {
// window.navigateTo("/")
// this.rerender()
// })
.onClick(() => {
window.navigateTo("/")
})
div()
.width(100, vw)
.height(100, vh)
.margin("0px")
.backgroundImage("url('_/images/the_return.webp')")
.backgroundImage("url('/_/images/the_return.webp')")
.backgroundSize("cover")
.backgroundPosition("48% 65%")
.backgroundRepeat("no-repeat")
@@ -69,7 +68,6 @@ class Home extends Shadow {
}
})
.onNavigate(function () {
console.log("navigate")
if(window.location.pathname === "/") {
this.style.border = "1px solid var(--tan)"
this.style.color = "var(--tan)"