From 4588c7c1eb74fcb7db534c2b76f9625bb92118ae Mon Sep 17 00:00:00 2001 From: empty Date: Sat, 7 Feb 2026 21:13:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E5=85=A5=E5=9C=BA?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=20+=20=E5=A2=9E=E5=A4=A7=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=8D=A1=E7=89=87=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 入场动画: - heroSection 添加 opacity + offset 交错入场动画 - recentWorksSection/emptyStateHint 延迟 0.2s 后动画进入 - 使用 DesignTokens.Animation.standard 保持一致性 卡片尺寸: - RecentWorkCard 从 110x150 增大到 130x178 - 保持相近比例,提升视觉冲击力和触控目标 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../to-live-photo/Views/HomeView.swift | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/to-live-photo/to-live-photo/Views/HomeView.swift b/to-live-photo/to-live-photo/Views/HomeView.swift index 8de7882..544773e 100644 --- a/to-live-photo/to-live-photo/Views/HomeView.swift +++ b/to-live-photo/to-live-photo/Views/HomeView.swift @@ -16,18 +16,26 @@ struct HomeView: View { @State private var selectedItem: PhotosPickerItem? @State private var isLoading = false @State private var errorMessage: String? + @State private var showHero = false + @State private var showRecentWorks = false var body: some View { ScrollView(showsIndicators: false) { VStack(spacing: DesignTokens.Spacing.xxl) { // 顶部导入区域 heroSection + .opacity(showHero ? 1 : 0) + .offset(y: showHero ? 0 : 20) // 最近作品或提示 if !recentWorks.recentWorks.isEmpty { recentWorksSection + .opacity(showRecentWorks ? 1 : 0) + .offset(y: showRecentWorks ? 0 : 20) } else { emptyStateHint + .opacity(showRecentWorks ? 1 : 0) + .offset(y: showRecentWorks ? 0 : 20) } } .padding(.horizontal, DesignTokens.Spacing.xl) @@ -50,6 +58,12 @@ struct HomeView: View { } .onAppear { recentWorks.cleanupDeletedAssets() + withAnimation(DesignTokens.Animation.standard) { + showHero = true + } + withAnimation(DesignTokens.Animation.standard.delay(0.2)) { + showRecentWorks = true + } } } @@ -304,13 +318,13 @@ struct RecentWorkCard: View { Image(uiImage: thumbnail) .resizable() .aspectRatio(contentMode: .fill) - .frame(width: 110, height: 150) + .frame(width: 130, height: 178) .clipShape(RoundedRectangle(cornerRadius: DesignTokens.Radius.md)) .transition(.opacity.combined(with: .scale(scale: 0.95))) } else { RoundedRectangle(cornerRadius: DesignTokens.Radius.md) .fill(Color.softPressed) - .frame(width: 110, height: 150) + .frame(width: 130, height: 178) .overlay { Image(systemName: "livephoto") .font(.system(size: 24)) @@ -329,7 +343,7 @@ struct RecentWorkCard: View { } .padding(DesignTokens.Spacing.sm) } - .frame(width: 110, height: 150) + .frame(width: 130, height: 178) // 信息 VStack(alignment: .leading, spacing: 2) {