From 32a4a86476a3c7f6540f07833b8f63c6853033dd Mon Sep 17 00:00:00 2001 From: LemonNeko Date: Sun, 9 Mar 2025 21:42:44 +0800 Subject: [PATCH] chore(stage-web): make the live2d shadow also follow theme color (#63) --- apps/stage-web/package.json | 2 + apps/stage-web/src/App.vue | 8 +-- .../src/components/Backgrounds/Cross.vue | 7 ++- .../components/Layouts/InteractiveArea.vue | 20 +++---- apps/stage-web/src/pages/index.vue | 2 +- .../src/pages/settings/themes/index.vue | 57 +++++++++++++++---- apps/stage-web/src/styles/themes.css | 12 ++++ apps/stage-web/uno.config.ts | 28 ++++----- .../stage-ui/src/components/Live2D/Model.vue | 13 ++++- pnpm-lock.yaml | 17 ++++++ 10 files changed, 117 insertions(+), 49 deletions(-) diff --git a/apps/stage-web/package.json b/apps/stage-web/package.json index 3af60e1b6..897318d2a 100644 --- a/apps/stage-web/package.json +++ b/apps/stage-web/package.json @@ -55,6 +55,7 @@ "@xsai/shared-chat": "catalog:", "@xsai/stream-text": "catalog:", "@xsai/utils-chat": "catalog:", + "culori": "^4.0.1", "defu": "^6.1.4", "drizzle-kit": "^0.30.5", "drizzle-orm": "^0.40.0", @@ -103,6 +104,7 @@ "@proj-airi/unplugin-download": "workspace:^", "@proj-airi/unplugin-live2d-sdk": "workspace:^", "@shikijs/markdown-it": "^3.1.0", + "@types/culori": "^2.1.1", "@types/markdown-it-link-attributes": "^3.0.5", "@types/nprogress": "^0.2.3", "@types/three": "^0.174.0", diff --git a/apps/stage-web/src/App.vue b/apps/stage-web/src/App.vue index 67778f18d..68b2ff65b 100644 --- a/apps/stage-web/src/App.vue +++ b/apps/stage-web/src/App.vue @@ -3,7 +3,7 @@ import { useSettings } from '@proj-airi/stage-ui/stores/settings' import { StageTransitionGroup } from '@proj-airi/ui-transitions' import { useDark } from '@vueuse/core' import { storeToRefs } from 'pinia' -import { onMounted, watch } from 'vue' +import { watch } from 'vue' import { useI18n } from 'vue-i18n' import { RouterView } from 'vue-router' @@ -17,11 +17,7 @@ watch(settings.language, () => { watch(settings.themeColorsHue, () => { document.documentElement.style.setProperty('--theme-colors-hue', settings.themeColorsHue.value.toString()) -}) - -onMounted(() => { - document.documentElement.style.setProperty('--theme-colors-hue', settings.themeColorsHue.value.toString()) -}) +}, { immediate: true })