From 7e5b9596a4bb362afe936122930414a508c1fe40 Mon Sep 17 00:00:00 2001 From: cuptain Date: Mon, 4 Nov 2024 13:23:47 +1100 Subject: [PATCH] global theming works --- fclauncher/frontend/src/App.svelte | 21 ++++++++++++++++++++- fclauncher/frontend/src/Instancepage.svelte | 18 ++++++++++-------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/fclauncher/frontend/src/App.svelte b/fclauncher/frontend/src/App.svelte index c590c28..7290bfb 100644 --- a/fclauncher/frontend/src/App.svelte +++ b/fclauncher/frontend/src/App.svelte @@ -12,9 +12,11 @@ let width: int = 10 let navMargin = document.getElementById("body") as HTMLElement; + let r onMount(() => { CheckPrerequisites().then(() => $loading = false) + r = document.getElementById('wrapper'); }) function setMargin(){ document.documentElement.style.setProperty('--navMargin', '17rem'); @@ -23,10 +25,22 @@ document.documentElement.style.setProperty('--navMargin', '5rem'); } + function initialColor() { + r.style.setProperty('--accent-color', 'purple'); + } + function setcolor() { + console.log("changing theme"); + r.style.setProperty('--accent-color', 'green'); + } + + + window.document.onload = function() {initialColor()}; +
+
@@ -38,7 +52,7 @@
{:else if $currentPage == 1}
- +
{:else if $currentPage == 2}
@@ -46,6 +60,7 @@
{/if} +