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