diff --git a/vue/components.d.ts b/vue/components.d.ts
index 259cff8..e24891c 100644
--- a/vue/components.d.ts
+++ b/vue/components.d.ts
@@ -28,6 +28,8 @@ declare module '@vue/runtime-core' {
AMenuDivider: typeof import('ant-design-vue/es')['MenuDivider']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal']
+ ARadioButton: typeof import('ant-design-vue/es')['RadioButton']
+ ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
ASelect: typeof import('ant-design-vue/es')['Select']
ASkeleton: typeof import('ant-design-vue/es')['Skeleton']
ASlider: typeof import('ant-design-vue/es')['Slider']
diff --git a/vue/src/App.vue b/vue/src/App.vue
index 309e170..4753aab 100644
--- a/vue/src/App.vue
+++ b/vue/src/App.vue
@@ -1,5 +1,5 @@
-
+
@@ -68,9 +70,6 @@ watch(
.diff {
transform: scale(1);
opacity: 1;
- background-color: rgba(255, 255, 255, 0.5) !important;
-
- color: #f8f8f8;
backdrop-filter: blur(5px);
transition: top 0.2s ease-in-out;
}
diff --git a/vue/src/page/SplitViewTab/emptyStartup.vue b/vue/src/page/SplitViewTab/emptyStartup.vue
index a21ed6e..288c71e 100644
--- a/vue/src/page/SplitViewTab/emptyStartup.vue
+++ b/vue/src/page/SplitViewTab/emptyStartup.vue
@@ -103,6 +103,7 @@ const restoreRecord = () => {
+
Github
{{ $t('privacyAndSecurity') }}
@@ -110,6 +111,11 @@ const restoreRecord = () => {
class="last-record">{{ $t('changlog') }}
{{ $t('faq') }}
+
+ light
+ auto
+ dark
+
@@ -244,7 +250,7 @@ const restoreRecord = () => {
}
.last-record {
- margin-left: 16px;
+ margin-right: 16px;
font-size: 14px;
color: var(--zp-secondary);
flex-shrink: 0;
diff --git a/vue/src/page/fileTransfer/fullScreenContextMenu.vue b/vue/src/page/fileTransfer/fullScreenContextMenu.vue
index e3adc6d..cbd2173 100644
--- a/vue/src/page/fileTransfer/fullScreenContextMenu.vue
+++ b/vue/src/page/fileTransfer/fullScreenContextMenu.vue
@@ -324,8 +324,8 @@ const copyPositivePrompt = () => {
line-height: 1.78em;
:deep(span) {
- background: rgba(0, 0, 0, 0.06);
- color: black;
+ background: var(--zp-secondary-variant-background);
+ color: var(--zp-primary);
padding: 2px 4px;
border-radius: 4px;
margin-right: 4px;
diff --git a/vue/src/store/useGlobalStore.ts b/vue/src/store/useGlobalStore.ts
index 43c05ad..a9099bd 100644
--- a/vue/src/store/useGlobalStore.ts
+++ b/vue/src/store/useGlobalStore.ts
@@ -6,6 +6,7 @@ import { getPreferredLang } from '@/i18n'
import { SortMethod } from '@/page/fileTransfer/fileSort'
import type { getQuickMovePaths } from '@/page/taskRecord/autoComplete'
import { type Dict, type ReturnTypeAsync } from '@/util'
+import { usePreferredDark } from '@vueuse/core'
import { cloneDeep, uniqueId } from 'lodash-es'
import { defineStore } from 'pinia'
import { VNode, computed, onMounted, reactive, toRaw, watch } from 'vue'
@@ -98,6 +99,7 @@ export const useGlobalStore = defineStore(
const gridThumbnailResolution = ref(512)
const defaultSortingMethod = ref(SortMethod.CREATED_TIME_DESC)
const defaultGridCellWidth = ref(256)
+ const darkModeControl = ref<'light' | 'dark' | 'auto'>('auto')
const createEmptyPane = (): TabPane => ({
type: 'empty',
@@ -176,7 +178,22 @@ export const useGlobalStore = defineStore(
const ignoredConfirmActions = reactive>({ deleteOneOnly: false })
+ const dark = usePreferredDark()
+
+ const computedTheme = computed(() => {
+ const getParDark = () => {
+ try {
+ return parent.location.search.includes('theme=dark') // sd-webui的
+ } catch (error) {
+ return false
+ }
+ }
+ const isDark = darkModeControl.value === 'auto' ? (dark.value || getParDark()) : (darkModeControl.value === 'dark')
+ return isDark ? 'dark' : 'light'
+ })
return {
+ computedTheme,
+ darkModeControl,
defaultSortingMethod,
defaultGridCellWidth,
pathAliasMap,
@@ -205,6 +222,7 @@ export const useGlobalStore = defineStore(
persist: {
// debug: true,
paths: [
+ 'darkModeControl',
'dontShowAgainNewImgOpts',
'defaultSortingMethod',
'defaultGridCellWidth',