aboutsummaryrefslogtreecommitdiff
path: root/client-web
diff options
context:
space:
mode:
Diffstat (limited to 'client-web')
-rw-r--r--client-web/public/app.html4
-rw-r--r--client-web/public/start.html76
-rw-r--r--client-web/source/index.ts35
3 files changed, 46 insertions, 69 deletions
diff --git a/client-web/public/app.html b/client-web/public/app.html
index d88abbd..493796f 100644
--- a/client-web/public/app.html
+++ b/client-web/public/app.html
@@ -4,8 +4,8 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <script defer async type="module" src="/bundle.js"></script>
- <link rel="stylesheet" href="/style/master.css" />
+ <script defer async type="module" src="/_assets/bundle.js"></script>
+ <link rel="stylesheet" href="/_assets/style/master.css" />
<title>keks-meet</title>
</head>
diff --git a/client-web/public/start.html b/client-web/public/start.html
index 0852f8b..4a04174 100644
--- a/client-web/public/start.html
+++ b/client-web/public/start.html
@@ -4,49 +4,51 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <script defer async type="module" src="/bundle.js"></script>
- <link rel="stylesheet" href="/style/master.css" />
+ <link rel="stylesheet" href="/_assets/style/master.css" />
<title>keks-meet</title>
</head>
<body>
- <h2>keks-meet</h2>
- <p>A web conferencing application using webrtc</p>
- <p>
- keks-meet is free software! It is licenced under the terms of the
- third version of the GNU Affero General Public Licence only.
- </p>
- <p>
- To get started, just enter a unique idenfier, click 'Join', then
- share the URL with your partner.
- </p>
- <noscript>
- keks-meet needs evil javascript to be enabled. Don't be afraid
- though, all the code is free (AGPL-3.0-only)! Look at it on
- <a href="https://codeberg.org/metamuffin/keks-meet">codeberg</a>
- </noscript>
- <script>
- const room_input = document.createElement("input");
- room_input.type = "text";
- room_input.id = "room-id-input";
- room_input.placeholder = "Room ID (leave blank for random id)";
+ <div class="start-box">
+ <h2>keks-meet</h2>
+ <p>A web conferencing application using webrtc</p>
+ <p>
+ keks-meet is free software! It is licenced under the terms of
+ the third version of the GNU Affero General Public Licence only.
+ </p>
+ <p>
+ To get started, just enter a unique idenfier, click 'Join', then
+ share the URL with your partner.
+ </p>
+ <noscript>
+ keks-meet needs evil javascript to be enabled. Don't be afraid
+ though, all the code is free (AGPL-3.0-only)! Look at it on
+ <a href="https://codeberg.org/metamuffin/keks-meet">codeberg</a>
+ </noscript>
+ <script>
+ const room_input = document.createElement("input");
+ room_input.type = "text";
+ room_input.id = "room-id-input";
+ room_input.placeholder = "Room ID (leave blank for random id)";
- const submit = document.createElement("input");
- submit.type = "button";
- submit.addEventListener("click", () => {
- if (room_input.value.length == 0)
- room_input.value = Math.floor(Math.random() * 10000)
- .toString(16)
- .padStart(5, "0");
- window.location.pathname = `/${encodeURIComponent(
- room_input.value
- )}`;
- });
- submit.value = "Join room!";
+ const submit = document.createElement("input");
+ submit.type = "button";
+ submit.addEventListener("click", () => {
+ if (room_input.value.length == 0)
+ room_input.value = Math.floor(Math.random() * 0x100000)
+ .toString(16)
+ .padStart(5, "0");
+ window.location.pathname = `/${encodeURIComponent(
+ room_input.value
+ )}`;
+ });
+ submit.value = "Join room!";
- el.classList.add("start-box");
- el.append(room_input, document.createElement("br"), submit);
- </script>
+ document
+ .querySelector("div.start-box")
+ ?.append(room_input, document.createElement("br"), submit);
+ </script>
+ </div>
</body>
</html>
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index fbb77d4..6266aff 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -6,6 +6,7 @@ import { create_menu } from "./menu.ts";
import { Room } from "./room.ts"
export const servers: RTCConfiguration = {
+ // google stun!?
iceServers: [{ urls: ["stun:stun1.l.google.com:19302", "stun:stun2.l.google.com:19302"] }],
iceCandidatePoolSize: 10,
}
@@ -22,34 +23,8 @@ window.onload = () => main()
export function main() {
document.body.querySelector("p")?.remove()
log("*", "starting up")
- if (window.location.pathname.startsWith("/room/")) {
- const room_name = window.location.pathname.substring("/room/".length)
- const room = new Room(room_name)
- create_menu(room)
- document.body.append(room.el)
- } else {
- create_menu()
- document.body.append(create_start_screen())
- }
-}
-
-function create_start_screen() {
- const with_text_content = (a: string) => (b: string) => {
- const e = document.createElement(a)
- e.textContent = b
- return e
- }
- const p = with_text_content("p")
- const h2 = with_text_content("h2")
-
- const el = document.createElement("div")
- el.append(
- h2("keks-meet"),
- p("A web conferencing application using webrtc"),
- p("keks-meet is free software! It is licenced under the terms of the third version of the GNU Affero General Public Licence only."),
- p("To get started, just enter a unique idenfier, click 'Join', then share the URL with your partner.")
- )
-
-
- return el
+ const room_name = window.location.pathname.substring("/".length)
+ const room = new Room(room_name)
+ create_menu(room)
+ document.body.append(room.el)
}