From f1a0ed3ab10476a01d3f423096416b67e57d092d Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 8 Jul 2024 14:59:52 +0200 Subject: [PATCH] chg: [front:theme] Better support of theme choice --- src/App.vue | 5 +- src/components/TheLiveLogsActivityGraph.vue | 73 +++++++++++---------- src/components/TheThemeButton.vue | 10 +-- src/settings.js | 4 ++ 4 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 src/settings.js diff --git a/src/App.vue b/src/App.vue index c4c5e51..250f925 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,10 +5,13 @@ import TheAdminPanel from './components/TheAdminPanel.vue' import TheSocketConnectionState from './components/TheSocketConnectionState.vue' import TheDahboard from './TheDahboard.vue' import { socketConnected } from "@/socket"; +import { darkModeEnabled } from "@/settings.js" onMounted(() => { - document.getElementsByTagName('body')[0].classList.add('dark') + if (darkModeEnabled.value) { + document.getElementsByTagName('body')[0].classList.add('dark') + } }) diff --git a/src/components/TheLiveLogsActivityGraph.vue b/src/components/TheLiveLogsActivityGraph.vue index 4b78a49..64c0d6b 100644 --- a/src/components/TheLiveLogsActivityGraph.vue +++ b/src/components/TheLiveLogsActivityGraph.vue @@ -1,6 +1,7 @@