增加主题及企微

This commit is contained in:
super committed 2026-03-29 00:55:01 +08:00
1 parent 42e29fd747
commit 20271ada61
35 files changed
+2424 -523

No files matched your search

@@ -0,0 +1,32 @@
<script setup lang="ts">
import { computed } from 'vue';
import { Sun, Moon } from 'lucide-vue-next';
import { useTheme } from '../composables/useTheme';
import { useI18n } from 'vue-i18n';
const props = withDefaults(defineProps<{ floating?: boolean }>(), {
floating: false,
});
const { t } = useI18n();
const { appliedTheme, toggleLightDark } = useTheme();
const isDarkTheme = computed(() => appliedTheme.value === 'dark');
const buttonClass = computed(() =>
props.floating
? 'fixed bottom-5 right-5 z-[70] h-11 w-11 rounded-full bg-white/90 dark:bg-slate-900/90 backdrop-blur-md shadow-lg border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:shadow-xl flex items-center justify-center transition-all'
: 'h-9 w-9 rounded-full bg-white/80 dark:bg-slate-900/80 backdrop-blur-md shadow-sm border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:shadow-md flex items-center justify-center transition-all'
);
</script>
<template>
<button
@click="toggleLightDark"
:class="buttonClass"
:title="isDarkTheme ? (t('theme.switchToLight') || 'Switch to light mode') : (t('theme.switchToDark') || 'Switch to dark mode')"
:aria-label="isDarkTheme ? (t('theme.switchToLight') || 'Switch to light mode') : (t('theme.switchToDark') || 'Switch to dark mode')"
>
<Sun v-if="isDarkTheme" class="w-5 h-5" />
<Moon v-else class="w-5 h-5" />
</button>
</template>