diff --git a/src/Home.js b/src/Home.js index d1cade4..587857e 100644 --- a/src/Home.js +++ b/src/Home.js @@ -3,7 +3,7 @@ import "./components/AppMenu.js" import "./apps/Forum/Forum.js" import "./apps/Messages/Messages.js" import "./apps/Jobs/Jobs.js" - + class Home extends Shadow { render() { @@ -11,16 +11,16 @@ class Home extends Shadow { Sidebar() ZStack(() => { - switch(window.location.pathname) { - case "/": + switch(global.currentApp) { + case "Dashboard": Forum() break; - case "/messages": + case "Messages": Messages() break; - case "/jobs": + case "Jobs": Jobs() break; } diff --git a/src/_/code/styles.css b/src/_/code/styles.css index 7ca742d..6f734b8 100644 --- a/src/_/code/styles.css +++ b/src/_/code/styles.css @@ -11,6 +11,10 @@ } } +input::placeholder { + font-family: Arial; + } + html, body { padding: 0; diff --git a/src/_/code/ws/Connection.js b/src/_/code/ws/Connection.js index 9119a35..51057e2 100644 --- a/src/_/code/ws/Connection.js +++ b/src/_/code/ws/Connection.js @@ -10,8 +10,8 @@ class Connection { init = async () => { return new Promise((resolve, reject) => { const url = window.location.hostname.includes("local") - ? "ws://" + window.location.host - : "wss://" + window.location.hostname + window.location.pathname; + ? "ws://" + window.location.host + "/ws" + : "wss://" + window.location.hostname + window.location.pathname + "/ws"; this.ws = new WebSocket(url); diff --git a/src/_/code/ws/Socket.js b/src/_/code/ws/Socket.js index 55c249c..debb7b9 100644 --- a/src/_/code/ws/Socket.js +++ b/src/_/code/ws/Socket.js @@ -11,6 +11,7 @@ export default class Socket { } async init() { + console.log("initting") await this.connection.init() } diff --git a/src/_/icons/columnwhite.png b/src/_/icons/columnwhite.png new file mode 100644 index 0000000..9e1ff13 Binary files /dev/null and b/src/_/icons/columnwhite.png differ diff --git a/src/_/icons/columnwhite.svg b/src/_/icons/columnwhite.svg index 5be3f63..39a43c2 100644 --- a/src/_/icons/columnwhite.svg +++ b/src/_/icons/columnwhite.svg @@ -1,7 +1,7 @@ - - - - - - + + + + + + diff --git a/src/apps/Forum/Forum.js b/src/apps/Forum/Forum.js index a507efc..68fb88d 100644 --- a/src/apps/Forum/Forum.js +++ b/src/apps/Forum/Forum.js @@ -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) } diff --git a/src/apps/Forum/ForumPanel.js b/src/apps/Forum/ForumPanel.js index 9dfdde6..ea3de03 100644 --- a/src/apps/Forum/ForumPanel.js +++ b/src/apps/Forum/ForumPanel.js @@ -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 diff --git a/src/index.js b/src/index.js index cfafaae..873d9f8 100644 --- a/src/index.js +++ b/src/index.js @@ -70,7 +70,7 @@ let Global = class { window.dispatchEvent(event) } - document.title = (this.currentNetwork === this.profile) ? "Parchment" : `${this.currentNetwork.abbreviation} | Parchment` + document.title = (this.currentNetwork === this.profile) ? "Forum" : `${this.currentNetwork.abbreviation} | Forum` } setCurrentNetworkAndApp() { @@ -140,8 +140,9 @@ let Global = class { this.getProfile().then(async (status) => { + await this.Socket.init() + if(status !== 401) { - console.log("it's legit") await this.onNavigate() Home() } else { diff --git a/vite.config.ts b/vite.config.ts index 7889a87..6019576 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,6 +9,11 @@ export default defineConfig({ }, server: { proxy: { + "/ws": { + target: "http://localhost:10002", + changeOrigin: true, + ws: true + }, "/login": { target: "http://localhost:10002", changeOrigin: true