From e31c48f5a9cfe6fd8988b83b17e00538fa69d6d3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 21 Feb 2023 15:52:06 +0100 Subject: server-side appearance config --- client-web/source/index.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'client-web/source/index.ts') diff --git a/client-web/source/index.ts b/client-web/source/index.ts index 4590625..83f1dfc 100644 --- a/client-web/source/index.ts +++ b/client-web/source/index.ts @@ -18,7 +18,13 @@ export const VERSION = "0.1.12" export const ROOM_CONTAINER = esection({ class: "room", aria_label: "user list" }) export interface ClientConfig { - appearance: { accent: string } + appearance?: { + accent: string + accent_dark: string + accent_light: string + background: string + background_dark: string + } webrtc: { stun: string, turn?: string, @@ -73,6 +79,14 @@ export async function main() { username: config.webrtc.turn_user, }] } + if (config.appearance) { + document.body.style.setProperty("--ac", config.appearance.accent) + document.body.style.setProperty("--ac-dark", config.appearance.accent_dark) + document.body.style.setProperty("--ac-light", config.appearance.accent_light) + document.body.style.setProperty("--bg", config.appearance.background) + document.body.style.setProperty("--bg-dark", config.appearance.background_dark) + + } r = new Room(conn, rtc_config) -- cgit v1.2.3-70-g09d2