diff --git a/app/components/TopNav.vue b/app/components/TopNav.vue
index de83c9b..d74fb98 100644
--- a/app/components/TopNav.vue
+++ b/app/components/TopNav.vue
@@ -8,10 +8,8 @@ const router = useRouter()
const { loggedIn, user, clear, initialized } = useAuthSession()
-const links = [
- { label: '摄影', to: '/photo' },
- { label: '作品集', to: '/portfolio' },
- { label: '关于', to: '/about' },
+const links: any = [
+
]
const searchQuery = ref((route.query.q as string) ?? '')
@@ -104,7 +102,7 @@ watch(() => route.query.q, (val) => {
{{ card.description }}
@@ -283,7 +296,49 @@ function formatDate(d?: string) { margin-left: auto; } +.detail-title-row { + display: flex; + align-items: flex-start; + gap: 12px; +} + +.detail-fav-btn { + flex-shrink: 0; + width: 28px; + height: 28px; + display: flex; + align-items: center; + justify-content: center; + border: none; + border-radius: 6px; + background: transparent; + color: var(--color-muted-soft); + cursor: pointer; + transition: all 0.15s ease; + margin-top: 2px; +} + +.detail-fav-btn :deep(svg) { + width: 18px; + height: 18px; +} + +.detail-fav-btn:hover { + color: var(--color-accent-amber); + background: rgba(232, 165, 90, 0.1); +} + +.detail-fav-btn.favorited { + color: var(--color-accent-amber); +} + +.detail-fav-btn.loading { + opacity: 0.5; + pointer-events: none; +} + .detail-title { + flex: 1; font-family: var(--font-display); font-size: 26px; font-weight: 400; diff --git a/app/components/index/LeftSidebar.vue b/app/components/index/LeftSidebar.vue index 7af44d8..439f1e5 100644 --- a/app/components/index/LeftSidebar.vue +++ b/app/components/index/LeftSidebar.vue @@ -25,6 +25,7 @@ const props = withDefaults(defineProps<{ side: 'left', tools: () => [ { key: 'home', label: '主页', icon: 'lucide:home' }, + { key: 'collect', label: '收藏', icon: 'lucide:star' }, // { key: 'search', label: '搜索', icon: 'lucide:search' }, // { key: 'tags', label: '标签', icon: 'lucide:tag' }, // { key: 'highlights', label: '高亮', icon: 'lucide:highlighter' }, diff --git a/app/composables/useFavorite.ts b/app/composables/useFavorite.ts new file mode 100644 index 0000000..4c80dd0 --- /dev/null +++ b/app/composables/useFavorite.ts @@ -0,0 +1,95 @@ +import { useAuthSession } from "./useAuthSession"; + +/** + * Favorite management composable. + * Provides a reactive set of favorited card IDs and toggle function. + */ +export function useFavorite() { + const { loggedIn } = useAuthSession() + const { $toast } = useNuxtApp() + + const favoritedCardIds = ref{{ confirmMsg }}
+{{ confirmMsg }}
+灵感与美学的无声对话
-