summaryrefslogtreecommitdiff
path: root/makima/ios/Sources/Makima/App/RootView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'makima/ios/Sources/Makima/App/RootView.swift')
-rw-r--r--makima/ios/Sources/Makima/App/RootView.swift125
1 files changed, 125 insertions, 0 deletions
diff --git a/makima/ios/Sources/Makima/App/RootView.swift b/makima/ios/Sources/Makima/App/RootView.swift
new file mode 100644
index 0000000..bb724fc
--- /dev/null
+++ b/makima/ios/Sources/Makima/App/RootView.swift
@@ -0,0 +1,125 @@
+import SwiftUI
+
+/// Root view for M1. Shows the masthead + a placeholder "system online" card
+/// so we can judge the aesthetic port against makima.jp side-by-side.
+struct RootView: View {
+ var body: some View {
+ ZStack {
+ Palette.background.ignoresSafeArea()
+ GridOverlay()
+
+ VStack(spacing: 0) {
+ MastheadBar(
+ serverLabel: "makima.jp",
+ wsStatus: .idle,
+ version: Bundle.main.shortVersion
+ )
+ NavStripPlaceholder()
+
+ ScrollView {
+ VStack(spacing: 24) {
+ Spacer(minLength: 32)
+
+ Logo(size: 140)
+
+ VStack(spacing: 6) {
+ Badge(text: "支配する", subtitle: "CONTROL SYSTEM")
+ Text("Mesh Orchestration Platform")
+ .font(Typography.titleChrome)
+ .foregroundStyle(Palette.foreground)
+ .tracking(1)
+ Text("Makima is listening.")
+ .font(Typography.body)
+ .foregroundStyle(Palette.foregroundMuted)
+ }
+
+ statusCard
+ .padding(.horizontal, 16)
+
+ languageDemoCard
+ .padding(.horizontal, 16)
+
+ Spacer(minLength: 40)
+ }
+ .padding(.top, 12)
+ }
+ }
+ }
+ }
+
+ private var statusCard: some View {
+ VStack(alignment: .leading, spacing: 10) {
+ HStack {
+ Text("SYSTEM//")
+ .font(Typography.navLabel)
+ .foregroundStyle(Palette.foregroundMuted)
+ Spacer()
+ Text("M0 + M1")
+ .font(Typography.navLabel)
+ .foregroundStyle(Palette.accent)
+ }
+ Divider().overlay(Palette.borderMuted)
+ ForEach(StatusRow.samples) { row in
+ HStack {
+ Circle()
+ .fill(row.ok ? Palette.ok : Palette.warn)
+ .frame(width: 6, height: 6)
+ Text(row.label)
+ .font(Typography.body)
+ .foregroundStyle(Palette.foreground)
+ Spacer()
+ Text(row.value)
+ .font(Typography.mono)
+ .foregroundStyle(Palette.foregroundMuted)
+ }
+ }
+ }
+ .padding(14)
+ .dashedBorder()
+ }
+
+ private var languageDemoCard: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ Text("GLOSSARY//")
+ .font(Typography.navLabel)
+ .foregroundStyle(Palette.foregroundMuted)
+ Divider().overlay(Palette.borderMuted)
+ VStack(alignment: .leading, spacing: 8) {
+ JapaneseLongPressText(japanese: "命令", english: "Directives")
+ JapaneseLongPressText(japanese: "契約", english: "Contracts")
+ JapaneseLongPressText(japanese: "聴取", english: "Listen")
+ JapaneseLongPressText(japanese: "史料", english: "History")
+ }
+ Text("Long-press any term to reveal the English gloss.")
+ .font(Typography.caption)
+ .foregroundStyle(Palette.foregroundMuted)
+ .padding(.top, 4)
+ }
+ .padding(14)
+ .dashedBorder()
+ }
+}
+
+private struct StatusRow: Identifiable {
+ let id = UUID()
+ let label: String
+ let value: String
+ let ok: Bool
+
+ static let samples: [StatusRow] = [
+ StatusRow(label: "Scaffold", value: "READY", ok: true),
+ StatusRow(label: "Design Sys", value: "M1", ok: true),
+ StatusRow(label: "Network", value: "NOT WIRED", ok: false),
+ StatusRow(label: "WebSocket", value: "NOT WIRED", ok: false)
+ ]
+}
+
+private extension Bundle {
+ var shortVersion: String {
+ (infoDictionary?["CFBundleShortVersionString"] as? String) ?? "0.0.0"
+ }
+}
+
+#Preview {
+ RootView()
+}