diff --git a/client/src/App.vue b/client/src/App.vue index 4e005d3..fb2c437 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -24,13 +24,7 @@ diff --git a/client/src/components/layout/ContainerLayout.vue b/client/src/components/layout/ContainerLayout.vue index 81c13e3..0cb7127 100644 --- a/client/src/components/layout/ContainerLayout.vue +++ b/client/src/components/layout/ContainerLayout.vue @@ -1,12 +1,11 @@ - - {{ $t("navigation.title") }} + {{ $t("navigation.title") }} @@ -110,6 +109,13 @@ + + + + + + + @@ -138,6 +144,7 @@ import { useAppBarStore, useAuthStore, useUserAccountStore } from "@/store/app"; import * as userAccountViewService from "@/services/component-services/userAccountViewService"; import { useRoute } from "vue-router"; + import { useTheme } from "vuetify"; import { useI18n } from "vue-i18n"; //navigation @@ -152,6 +159,11 @@ const authStore = useAuthStore(); const userAccountStore = useUserAccountStore(); + //theme + const theme = useTheme(); + const localstorageTheme: string | null = localStorage.getItem("theme"); + theme.global.name.value = localstorageTheme ?? theme.global.name.value ?? "light"; + const themeToggle = ref(theme.global.name.value === "dark" ? 1 : 0); //gallery view const gridSizes: GridSize[] = [ @@ -165,16 +177,20 @@ //i18n const { locale } = useI18n(); const localStorageLocale: string | null = localStorage.getItem("locale"); - locale.value = localStorageLocale ?? "en"; - const languageToggle = ref(locale.value === "en" ? 0 : 1); + //watchers watch(languageToggle, () => { locale.value = languageToggle.value === 0 ? "en" : "de"; localStorage.setItem("locale", locale.value); }); + watch(themeToggle, () => { + theme.global.name.value = themeToggle.value === 0 ? "light" : "dark"; + localStorage.setItem("theme", theme.global.name.value); + }); + //methods function changeGridSize(gridSize: GridSize){ @@ -184,7 +200,6 @@ async function userMenuOpened(){ await userAccountViewService.setPersonalUserAccount(); } - \ No newline at end of file diff --git a/client/src/plugins/vuetify.ts b/client/src/plugins/vuetify.ts index 2c7a01a..a38aa0a 100644 --- a/client/src/plugins/vuetify.ts +++ b/client/src/plugins/vuetify.ts @@ -9,14 +9,18 @@ export default createVuetify({ colors: { primary: "#215CAF", secondary: "#5CBBF6", - blue: "#2196F3" + blue: "#2196F3", + title: "#000000", + subtitle: "#000000", // background: "#eef5f9", // surface: "#4D7DBF" }, }, dark: { colors: { - primary: "#ffff00", + primary: "#2196F3", + title: "#ffffff", + subtitle: "#ffffff", } }, tableTheme: {