summaryrefslogtreecommitdiff
path: root/client-web/source/menu.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client-web/source/menu.ts')
-rw-r--r--client-web/source/menu.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/client-web/source/menu.ts b/client-web/source/menu.ts
new file mode 100644
index 0000000..1401b42
--- /dev/null
+++ b/client-web/source/menu.ts
@@ -0,0 +1,26 @@
+import { Room } from "./room.ts";
+
+export function create_menu(room?: Room) {
+ const menu = document.createElement("div")
+ menu.classList.add("menu-overlay")
+ document.body.append(menu)
+
+ const item = (name: string, cb: (() => void) | string) => {
+ const p = document.createElement("p")
+ const a = document.createElement("a")
+ a.classList.add("menu-item")
+ a.textContent = name
+ if (typeof cb == "string") a.href = cb
+ else a.addEventListener("click", cb), a.href = "#"
+ p.append(a)
+ return p
+ }
+
+ if (room) menu.append(
+ item("Settings", () => alert("todo, refer to the url parameters in the docs for now"))
+ )
+ menu.append(
+ item("Licence", "/licence"),
+ item("Sources / Documentation", "https://codeberg.org/metamuffin/keks-meet"),
+ )
+} \ No newline at end of file