Apply Emil Kowalski design across all screens

Near-monochrome palette (ink tokens), black primary buttons, spring
animations, 0.5pt hairline dividers, shadow cards, squircle corners.
Replaces all blue/coloured accents. Adds ButtonStyles component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Robin Kutesa
2026-05-16 00:43:31 +03:00
parent 848c1da820
commit 04e7a77c1a
14 changed files with 889 additions and 625 deletions

View File

@@ -8,101 +8,85 @@ struct SettingsView: View {
Color.white.ignoresSafeArea()
ScrollView {
VStack(spacing: AppTheme.sectionSpacing) {
// LAN trigger hero section
VStack(spacing: AppTheme.sectionGap) {
LANTriggerSection()
// What to back up
mediaSection
// Quiet hours
quietHoursSection
// Notification section
notificationSection
Spacer(minLength: 40)
}
.padding(.horizontal, 20)
.padding(.horizontal, AppTheme.hPad)
.padding(.top, 20)
.padding(.bottom, 48)
}
}
.navigationTitle("Settings")
.navigationBarTitleDisplayMode(.inline)
}
// MARK: Media section
// MARK: Media
private var mediaSection: some View {
VStack(alignment: .leading, spacing: 8) {
Text("WHAT TO BACK UP")
.font(AppTheme.smallFont)
.foregroundColor(AppTheme.textSecondary)
.padding(.leading, 4)
sectionLabel("WHAT TO BACK UP")
VStack(spacing: 0) {
ToggleRow(icon: "photo", title: "Photos",
isOn: $store.backupFilter.includePhotos)
Divider().padding(.leading, 44)
hairline
ToggleRow(icon: "video", title: "Videos",
isOn: $store.backupFilter.includeVideos)
Divider().padding(.leading, 44)
hairline
ToggleRow(icon: "camera.viewfinder", title: "Screenshots",
isOn: $store.backupFilter.includeScreenshots)
Divider().padding(.leading, 44)
hairline
ToggleRow(icon: "rays", title: "RAW",
isOn: $store.backupFilter.includeRAW)
Divider().padding(.leading, 44)
hairline
ToggleRow(icon: "doc.badge.clock", title: "New files only",
subtitle: "Skip files already on NAS",
isOn: $store.backupFilter.newFilesOnly)
}
.padding(.horizontal, 16)
.background(Color.white)
.clipShape(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius))
.overlay(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius).stroke(AppTheme.cardBorder))
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
}
}
// MARK: Quiet hours
// MARK: Quiet hours
private var quietHoursSection: some View {
VStack(alignment: .leading, spacing: 8) {
Text("QUIET HOURS")
.font(AppTheme.smallFont)
.foregroundColor(AppTheme.textSecondary)
.padding(.leading, 4)
sectionLabel("QUIET HOURS")
VStack(spacing: 0) {
ToggleRow(icon: "moon.fill", title: "Quiet hours",
ToggleRow(icon: "moon", title: "Quiet hours",
subtitle: "No auto-backup during this window",
isOn: $store.quietHoursEnabled)
if store.quietHoursEnabled {
Divider().padding(.leading, 44)
hairline
timePickerRow(label: "Start", hour: $store.quietHoursStart)
Divider().padding(.leading, 44)
hairline
timePickerRow(label: "End", hour: $store.quietHoursEnd)
}
Divider().padding(.leading, 44)
ToggleRow(icon: "bolt.fill", title: "Only while charging",
hairline
ToggleRow(icon: "bolt", title: "Only while charging",
subtitle: "Preserve battery on large libraries",
isOn: $store.chargingOnlyMode)
}
.padding(.horizontal, 16)
.background(Color.white)
.clipShape(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius))
.overlay(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius).stroke(AppTheme.cardBorder))
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: store.quietHoursEnabled)
}
}
private func timePickerRow(label: String, hour: Binding<Int>) -> some View {
HStack {
Text(label)
.font(AppTheme.bodyFont)
.foregroundColor(AppTheme.textPrimary)
.frame(width: 80, alignment: .leading)
.font(AppTheme.body())
.foregroundStyle(AppTheme.ink)
Spacer()
Picker(label, selection: hour) {
ForEach(0..<24, id: \.self) { h in
@@ -110,47 +94,53 @@ struct SettingsView: View {
}
}
.pickerStyle(.menu)
.tint(AppTheme.blue)
.tint(AppTheme.inkSecondary)
}
.padding(.vertical, 8)
.padding(.horizontal, AppTheme.cardPad)
.padding(.vertical, 12)
}
// MARK: Notifications
// MARK: Notifications
private var notificationSection: some View {
VStack(alignment: .leading, spacing: 8) {
Text("NOTIFICATIONS")
.font(AppTheme.smallFont)
.foregroundColor(AppTheme.textSecondary)
.padding(.leading, 4)
sectionLabel("NOTIFICATIONS")
VStack(spacing: 0) {
staticRow(icon: "bell.fill", title: "On start", value: "Off")
Divider().padding(.leading, 44)
staticRow(icon: "checkmark.circle.fill", title: "On complete", value: "On")
Divider().padding(.leading, 44)
staticRow(icon: "exclamationmark.triangle.fill", title: "On errors", value: "On")
notifRow(icon: "bell", title: "On start", value: "Off")
hairline
notifRow(icon: "checkmark.circle", title: "On complete", value: "On")
hairline
notifRow(icon: "exclamationmark.triangle", title: "On errors", value: "On")
}
.padding(.horizontal, 16)
.background(Color.white)
.clipShape(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius))
.overlay(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius).stroke(AppTheme.cardBorder))
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
}
}
private func staticRow(icon: String, title: String, value: String) -> some View {
HStack {
private func notifRow(icon: String, title: String, value: String) -> some View {
HStack(spacing: 12) {
Image(systemName: icon)
.foregroundColor(AppTheme.blue)
.frame(width: 28)
.font(.system(size: 14, weight: .regular))
.foregroundStyle(AppTheme.inkSecondary)
.frame(width: 20)
Text(title)
.font(AppTheme.bodyFont)
.foregroundColor(AppTheme.textPrimary)
.font(AppTheme.body())
.foregroundStyle(AppTheme.ink)
Spacer()
Text(value)
.font(AppTheme.bodyFont)
.foregroundColor(AppTheme.textSecondary)
.font(AppTheme.caption())
.foregroundStyle(AppTheme.inkTertiary)
}
.padding(.vertical, 12)
.padding(.horizontal, AppTheme.cardPad)
.padding(.vertical, 14)
}
private var hairline: some View {
Rectangle()
.fill(AppTheme.separator)
.frame(height: 0.5)
.padding(.leading, AppTheme.cardPad)
}
}