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) {