import SwiftUI struct EntryBrand: View { var body: some View { HStack(spacing: 9) { Image("BrandMark") .resizable() .frame(width: 32, height: 32) .clipShape(.rect(cornerRadius: 8)) .accessibilityHidden(true) Text("见物").font(.headline) } } } extension Color { static func entryBackground(for scheme: ColorScheme) -> Color { scheme == .dark ? Color(uiColor: .systemBackground) : Color(red: 0.976, green: 0.969, blue: 0.951) } } struct WelcomeView: View { let account: AtlasAccount @Environment(\.colorScheme) private var colorScheme @Environment(\.dynamicTypeSize) private var dynamicType @ScaledMetric(relativeTo: .largeTitle) private var headlineSize = 41.0 var body: some View { ScrollView { VStack(alignment: .leading, spacing: 19) { EntryBrand() if dynamicType.isAccessibilitySize { headline } scene Text("说一句「数据线放在书房抽屉」,见物帮你记下。") .font(.body) .foregroundStyle(.primary.opacity(0.77)) .lineSpacing(4) } .frame(maxWidth: 460, alignment: .leading) .padding(.horizontal, 23) .padding(.vertical, 12) .frame(maxWidth: .infinity) } .safeAreaInset(edge: .bottom, spacing: 0) { NavigationLink { SignInView(account: account) } label: { HStack(spacing: 9) { Text("进入我的空间") Image(systemName: "arrow.right").accessibilityHidden(true) } .font(.body.weight(.semibold)) .frame(maxWidth: .infinity, minHeight: 29) } .buttonStyle(.borderedProminent) .buttonBorderShape(.roundedRectangle(radius: 15)) .controlSize(.large) .frame(maxWidth: 460) .padding(.horizontal, 23) .padding(.vertical, 12) .frame(maxWidth: .infinity) .foregroundStyle(.white) .background(Color.entryBackground(for: colorScheme)) } .background(Color.entryBackground(for: colorScheme).ignoresSafeArea()) .toolbar(.hidden, for: .navigationBar) } private var headline: some View { Text("家里有的,\n心里有数。") .font(.system(size: headlineSize, weight: .semibold)) .accessibilityAddTraits(.isHeader) } private var scene: some View { Color.atlasNavy .aspectRatio(0.94, contentMode: .fit) .overlay { GeometryReader { proxy in Image("WelcomeTray") .resizable() .scaledToFill() .frame(width: proxy.size.width, height: proxy.size.height) .accessibilityHidden(true) } } .overlay(alignment: .topLeading) { if !dynamicType.isAccessibilitySize { LinearGradient(colors: [.black.opacity(0.42), .clear], startPoint: .top, endPoint: .center) .accessibilityHidden(true) headline .foregroundStyle(.white) .padding(.horizontal, 23) .padding(.top, 23) } } .clipShape(.rect(cornerRadius: 25)) } }