summaryrefslogtreecommitdiff
path: root/makima/ios/Sources/Makima/Design/Components/Logo.swift
diff options
context:
space:
mode:
authorsoryu-co <bot@soryu.co>2026-04-24 13:15:29 +0000
committersoryu-co <bot@soryu.co>2026-04-24 13:21:12 +0000
commitdb092c79a175e3283f479ee0b234b24bde3c736e (patch)
tree16ae5ba1f2f2f6089ad9f625953fa02d19463ab0 /makima/ios/Sources/Makima/Design/Components/Logo.swift
parent3679ceb3325033faa2f889ef3dfee5668ef7aeea (diff)
downloadsoryu-makima-ios-scaffold.tar.gz
soryu-makima-ios-scaffold.zip
Add Makima iOS app scaffold (M0 + M1 design system)makima-ios-scaffold
Pure-native SwiftUI client for makima.jp under makima/ios/. M0 (scaffold) - XcodeGen project (iOS 18+, Swift 5.10, bundle co.soryu.makima) - Makefile targets: bootstrap, xcgen, ios-sim-fast, ios-device-fast, test, lint - GitHub Actions workflow ios-ci.yml — builds + runs XCTest on macos-14 - MIT repo root license already in place M1 (design system, web-aesthetic port) - Palette: #0c1729 background, #9bc3ff accent, #3f6fb3 border (ported from Tailwind) - Typography: SF Mono for chrome, uppercase tracked nav labels - Components: DashedBorder, GridOverlay, MastheadBar + WebSocketStatus pill, NavStripPlaceholder (NAV// prefix), JapaneseLongPressText (mobile analogue of JapaneseHoverText), Logo (reuses frontend/public/logo/makima-logo.svg with Canvas concentric-ring fallback), Badge - RootView demo screen: masthead, nav strip, logo, CONTROL SYSTEM badge, SYSTEM// status card, GLOSSARY// card with 命令/契約/聴取/史料 long-press terms Auth (v1 plan, not wired here): x-makima-api-key header — verified against src/server/auth.rs. Authorization: Bearer reserved for v1.1 Supabase OAuth. v1 plan doc: makima/ios/docs/ios-v1-plan.md Not in this PR: networking, WebSocket client, stores, feature surfaces (Home/Contracts/Tasks/Directives/Daemons/Listen), notifications. Those land across M2-M8 per the plan.
Diffstat (limited to 'makima/ios/Sources/Makima/Design/Components/Logo.swift')
-rw-r--r--makima/ios/Sources/Makima/Design/Components/Logo.swift51
1 files changed, 51 insertions, 0 deletions
diff --git a/makima/ios/Sources/Makima/Design/Components/Logo.swift b/makima/ios/Sources/Makima/Design/Components/Logo.swift
new file mode 100644
index 0000000..01d263e
--- /dev/null
+++ b/makima/ios/Sources/Makima/Design/Components/Logo.swift
@@ -0,0 +1,51 @@
+import SwiftUI
+
+/// Makima concentric-ring logo.
+/// Loads from bundled `makima-logo.svg` if present; otherwise falls back to
+/// a Canvas-rendered concentric-ring approximation so the app always builds
+/// even if the SVG copy step is skipped.
+struct Logo: View {
+ var size: CGFloat = 120
+
+ var body: some View {
+ Group {
+ if let uiImage = Self.loadedSVG(named: "makima-logo") {
+ Image(uiImage: uiImage)
+ .resizable()
+ .renderingMode(.template)
+ .foregroundStyle(Palette.accent)
+ } else {
+ Canvas { ctx, canvasSize in
+ let center = CGPoint(x: canvasSize.width / 2, y: canvasSize.height / 2)
+ let maxR = min(canvasSize.width, canvasSize.height) / 2
+ let rings = 5
+ for i in 0..<rings {
+ let t = CGFloat(i + 1) / CGFloat(rings)
+ let r = maxR * t
+ let rect = CGRect(x: center.x - r, y: center.y - r,
+ width: r * 2, height: r * 2)
+ let shading = GraphicsContext.Shading.color(
+ Palette.accent.opacity(1.0 - Double(i) * 0.15)
+ )
+ ctx.stroke(Circle().path(in: rect), with: shading, lineWidth: 1.25)
+ }
+ let dotR = maxR * 0.06
+ ctx.fill(Circle().path(in: CGRect(x: center.x - dotR, y: center.y - dotR,
+ width: dotR * 2, height: dotR * 2)),
+ with: .color(Palette.accent))
+ }
+ }
+ }
+ .frame(width: size, height: size)
+ .accessibilityLabel("Makima")
+ }
+
+ /// SwiftUI 18 doesn't natively decode SVG through UIImage, so we try PDF
+ /// fallback first (Xcode auto-converts SVGs placed in asset catalogs to PDF).
+ /// If the file ships as a raw `.svg` bundle resource, we decline and fall back
+ /// to the Canvas drawing. This keeps M1 buildable without additional deps.
+ private static func loadedSVG(named name: String) -> UIImage? {
+ if let img = UIImage(named: name) { return img }
+ return nil
+ }
+}