From ed7bd4a816cee12168b06d9e652d2ffc8a455cf7 Mon Sep 17 00:00:00 2001 From: elsoazemelet Date: Thu, 1 Feb 2024 18:36:26 +0100 Subject: [PATCH] Initial solution --- src/routes/EditorLayout.svelte | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/routes/EditorLayout.svelte b/src/routes/EditorLayout.svelte index aa58db7..7dd8cb5 100644 --- a/src/routes/EditorLayout.svelte +++ b/src/routes/EditorLayout.svelte @@ -45,7 +45,20 @@ let isSearchSortingShows = true; + function updateFontSize(size: string) { + const main = document.querySelector("#main") as HTMLElement; + if (!main) { + console.error("Element with id 'main' not found."); + return; + } + + main.style.fontSize = size; + } + async function editorMessageListener(event: MessageEvent) { + if (event.data.messageType == "updateFontSize") { + updateFontSize(event.data.fontSize); + } if (event.data.messageType == "localConfigs") { const localConfigs = (event.data.configs as any[]).map((config) => LocalConfigSchema.parse(config) @@ -243,7 +256,7 @@ }); -
+