feature/host-inspect-cli
swift 98 lines 3.47 KB
Raw
1 import SwiftUI
2
3 @main
4 struct ControlKitRunnerApp: App {
5 var body: some Scene {
6 WindowGroup {
7 ControlKitShowcaseView()
8 }
9 }
10 }
11
12 private struct ControlKitShowcaseView: View {
13 var body: some View {
14 ZStack {
15 LinearGradient(
16 colors: [Color.controlKitGreen, Color(red: 0.04, green: 0.12, blue: 0.09)],
17 startPoint: .topLeading,
18 endPoint: .bottomTrailing
19 )
20 .ignoresSafeArea()
21
22 VStack(alignment: .leading, spacing: 30) {
23 HStack(spacing: 22) {
24 logo
25 VStack(alignment: .leading, spacing: 6) {
26 Text("ControlKit")
27 .font(.system(size: 48, weight: .bold, design: .rounded))
28 Text("Apple platform automation")
29 .font(.title2)
30 .foregroundStyle(Color.controlKitCream.opacity(0.78))
31 }
32 }
33
34 Text("A clean-room runner for reliable black-box testing across Apple platforms.")
35 .font(.title2.weight(.medium))
36 .frame(maxWidth: 800, alignment: .leading)
37
38 HStack(alignment: .top, spacing: 22) {
39 statusCard
40 informationCard
41 }
42 }
43 .foregroundStyle(Color.controlKitCream)
44 .padding(64)
45 .frame(maxWidth: 1200, alignment: .leading)
46 }
47 }
48
49 private var logo: some View {
50 Text("XC\nRS")
51 .font(.system(size: 38, weight: .black, design: .rounded))
52 .multilineTextAlignment(.center)
53 .lineSpacing(-10)
54 .foregroundStyle(Color.controlKitGreen)
55 .frame(width: 124, height: 124)
56 .background(Color.controlKitCream, in: RoundedRectangle(cornerRadius: 30))
57 }
58
59 private var statusCard: some View {
60 VStack(alignment: .leading, spacing: 14) {
61 Label("Runner online", systemImage: "checkmark.circle.fill")
62 .font(.headline)
63 .foregroundStyle(.green)
64 Text("The XCTest host is ready to receive ControlKit automation requests.")
65 .foregroundStyle(Color.controlKitCream.opacity(0.78))
66 }
67 .padding(26)
68 .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
69 .background(.white.opacity(0.1), in: RoundedRectangle(cornerRadius: 24))
70 }
71
72 private var informationCard: some View {
73 VStack(alignment: .leading, spacing: 16) {
74 infoRow(title: "Project", value: "XCRSControlKit")
75 infoRow(title: "Creator", value: "smbCloud")
76 infoRow(title: "Platform", value: "tvOS")
77 infoRow(title: "Purpose", value: "Native UI automation runner")
78 }
79 .padding(26)
80 .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
81 .background(.white.opacity(0.08), in: RoundedRectangle(cornerRadius: 24))
82 }
83
84 private func infoRow(title: String, value: String) -> some View {
85 HStack {
86 Text(title)
87 .foregroundStyle(Color.controlKitCream.opacity(0.62))
88 Spacer()
89 Text(value)
90 .fontWeight(.semibold)
91 }
92 }
93 }
94
95 private extension Color {
96 static let controlKitGreen = Color(red: 0.106, green: 0.263, blue: 0.196)
97 static let controlKitCream = Color(red: 0.961, green: 0.953, blue: 0.925)
98 }