establishing ws connection, starting on messages section

This commit is contained in:
metacryst
2026-02-01 16:11:11 -06:00
parent 6d50337e3b
commit 6262ce53aa
10 changed files with 41 additions and 24 deletions

View File

@@ -11,6 +11,10 @@ css(`
color: var(--accent);
}
input::placeholder {
font-family: Arial;
}
input[type="checkbox"] {
appearance: none; /* remove default style */
-webkit-appearance: none;
@@ -34,13 +38,15 @@ class Forum extends Shadow {
ForumPanel()
input("Message Hyperia", "98%")
.paddingVertical(1, em)
.paddingLeft(2, pct)
input("Message", "70%")
.paddingVertical(0.75, em)
.paddingLeft(2, em)
.color("var(--accent)")
.background("var(--darkbrown)")
.marginBottom(6, em)
.border("none")
.background("#fff1dd")
.marginBottom(5.5, em)
.border("1px solid black")
.borderRadius(100, px)
.fontFamily("Arial")
.fontSize(1, em)
.onKeyDown(function (e) {
if (e.key === "Enter") {
@@ -55,7 +61,7 @@ class Forum extends Shadow {
.horizontalAlign("center")
.verticalAlign("end")
})
.onAppear(() => document.body.style.backgroundColor = "var(--darkbrown)")
.backgroundColor("var(--main)")
.width(100, pct)
.height(100, pct)
}

View File

@@ -52,12 +52,12 @@ class ForumPanel extends Shadow {
.paddingTop(5, em)
.paddingBottom(2, em)
.paddingLeft(4, pct)
.backgroundColor("var(--darkbrown)")
.backgroundColor("var(--main)")
.onAppear(async () => {
requestAnimationFrame(() => {
this.scrollTop = this.scrollHeight
});
let res = await Socket.send({app: "FORUM", operation: "GET", msg: {forum: "HY", number: 100}})
let res = await global.Socket.send({app: "FORUM", operation: "GET", msg: {forum: "HY", number: 100}})
if(!res) console.error("failed to get messages")
if(res.msg.length > 0 && this.messages.length === 0) {
this.messages = res.msg