diff --git a/static/remote.js b/static/remote.js index b631402..d881411 100644 --- a/static/remote.js +++ b/static/remote.js @@ -100,6 +100,12 @@ function renderControls(roomId, clientId, adminSecret, prnt, es) { controls.classList.remove("enable"); } }); + const clockDiv = create(prnt, "div", "\u00a0Time: "); + const clock = create(clockDiv, "span"); + setInterval(() => { + const now = new Date(); + clock.innerText = `${now.getHours().toString().padStart(2, "0")}:${now.getMinutes().toString().padStart(2, "0")}:${now.getSeconds().toString().padStart(2, "0")}`; + }, 250); } function renderAdmin(roomId, adminSecret, prnt, es) { const table = create(prnt, "table", undefined, ["users"]); diff --git a/static/remote.ts b/static/remote.ts index 01c2b7a..905d142 100644 --- a/static/remote.ts +++ b/static/remote.ts @@ -180,6 +180,13 @@ function renderControls(roomId: string, clientId: string, adminSecret: string | controls.classList.remove("enable"); } }); + + const clockDiv = create(prnt, "div", "\u00a0Time: "); + const clock = create(clockDiv, "span"); + setInterval(() => { + const now = new Date(); + clock.innerText = `${now.getHours().toString().padStart(2, "0")}:${now.getMinutes().toString().padStart(2, "0")}:${now.getSeconds().toString().padStart(2, "0")}`; + }, 250); } function renderAdmin(roomId: string, adminSecret: string, prnt: HTMLElement, es: EventSource) {