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 @@ }); -
+