Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
feat(header-item): 新增颜色主题切换按钮
Timothy Yind2fb850a6c4b
diff --git a/app/components/masonry/HeaderItem.vue b/app/components/masonry/HeaderItem.vueindex 2cbf0078..6c2d5a77 100644--- a/app/components/masonry/HeaderItem.vue+++ b/app/components/masonry/HeaderItem.vue@@ -12,6 +12,17 @@ defineProps<{dateRangeText?: string}>()+const colorMode = useColorMode()++const isDark = computed({+ get() {+ return colorMode.value === 'dark'+ },+ set(_isDark) {+ colorMode.preference = _isDark ? 'dark' : 'light'+ },+})+const handleOpenLogin = () => {window.location.href = '/api/auth/github'console.log('Login button clicked')@@ -168,6 +179,16 @@ const totalSelectedFilters = computed(() => {</UCard></template></UPopover>+ <UTooltip text="颜色主题">+ <UButton+ variant="soft"+ color="neutral"+ class="bg-transparent rounded-full cursor-pointer"+ :icon="isDark ? 'tabler:sun' : 'tabler:moon'"+ size="sm"+ @click="isDark = !isDark"+ />+ </UTooltip><UTooltipv-if="loggedIn"text="仪表盘"diff --git a/app/components/photo/GalleryThumbnail.vue b/app/components/photo/GalleryThumbnail.vueindex 9704b0a0..6aca902a 100644--- a/app/components/photo/GalleryThumbnail.vue+++ b/app/components/photo/GalleryThumbnail.vue@@ -17,7 +17,7 @@ const galleryScrollContainer = ref<HTMLDivElement>()const containerClientWidth = ref(0)// 响应式断点-const isSmallScreen = useMediaQuery('(max-width: 768px)')+const isMobile = useMediaQuery('(max-width: 768px)')// 缩略图配置const THUMBNAIL_CONFIG = {@@ -28,15 +28,15 @@ const THUMBNAIL_CONFIG = {// 计算当前设备的样式配置const currentThumbnailSize = computed(() =>- isSmallScreen.value ? THUMBNAIL_CONFIG.size.sm : THUMBNAIL_CONFIG.size.lg,+ isMobile.value ? THUMBNAIL_CONFIG.size.sm : THUMBNAIL_CONFIG.size.lg,)const currentGapSize = computed(() =>- isSmallScreen.value ? THUMBNAIL_CONFIG.gap.sm : THUMBNAIL_CONFIG.gap.lg,+ isMobile.value ? THUMBNAIL_CONFIG.gap.sm : THUMBNAIL_CONFIG.gap.lg,)const currentPaddingSize = computed(() =>- isSmallScreen.value+ isMobile.value? THUMBNAIL_CONFIG.padding.sm: THUMBNAIL_CONFIG.padding.lg,)@@ -137,7 +137,7 @@ watch({ immediate: true },)-watch(isSmallScreen, scrollToActiveThumbnail)+watch(isMobile, scrollToActiveThumbnail)</script><template>