diff options
author | metamuffin <metamuffin@disroot.org> | 2022-09-09 17:49:39 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-09-09 17:49:39 +0200 |
commit | 3a657c2f6d4cc9f82c993a8d390c8a84ab38bcb4 (patch) | |
tree | 731c854754d1408d189552da79bd81d79d11183f /client-web/source/menu.ts | |
parent | b0c6062607b037ba1a6e388e5c23746bdd8dbdcf (diff) | |
download | keks-meet-3a657c2f6d4cc9f82c993a8d390c8a84ab38bcb4.tar keks-meet-3a657c2f6d4cc9f82c993a8d390c8a84ab38bcb4.tar.bz2 keks-meet-3a657c2f6d4cc9f82c993a8d390c8a84ab38bcb4.tar.zst |
chat!
Diffstat (limited to 'client-web/source/menu.ts')
-rw-r--r-- | client-web/source/menu.ts | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/client-web/source/menu.ts b/client-web/source/menu.ts index a3755c3..5abb8f0 100644 --- a/client-web/source/menu.ts +++ b/client-web/source/menu.ts @@ -1,10 +1,10 @@ /// <reference lib="dom" /> -export function create_menu() { - const menu = document.createElement("div") - menu.classList.add("menu-overlay") - document.body.append(menu) +import { ep } from "./helper.ts" +import { BOTTOM_CONTAINER, MENU_BR, VERSION } from "./index.ts" +import { Room } from "./room.ts" +export function setup_menus(room: Room) { const item = (name: string, cb: (() => void) | string) => { const p = document.createElement("p") const a = document.createElement("a") @@ -17,9 +17,23 @@ export function create_menu() { return p } - menu.append( + MENU_BR.append( + ep(`keks-meet ${VERSION}`, { class: "version" }), item("Settings", () => alert("todo, refer to the url parameters in the docs for now")), item("Licence", "/licence"), item("Sources / Documentation", "https://codeberg.org/metamuffin/keks-meet"), ) + + + // TODO this should ideally be a checkbox + const chat_toggle = document.createElement("input") + chat_toggle.type = "button" + chat_toggle.id = "chat_toggle" + chat_toggle.value = "Toggle chat" + chat_toggle.onclick = () => { + room.chat.shown = !room.chat.shown + if (room.chat.shown) chat_toggle.classList.add("active") + else chat_toggle.classList.remove("active") + } + BOTTOM_CONTAINER.append(chat_toggle) } |