Skip to content

Commit

Permalink
feat: light mode support (#75)
Browse files Browse the repository at this point in the history
* Added support for light mode

* Update search textbox

* Removed unused background color

* update launch screen
  • Loading branch information
joeldavidw authored Nov 10, 2024
1 parent 891306c commit f3ead92
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 65 deletions.
13 changes: 5 additions & 8 deletions Chronos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,8 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
INFOPLIST_KEY_UIStatusBarStyle = "";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Dark;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -917,7 +916,7 @@
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Chronos/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Chronos Dev Release";
INFOPLIST_KEY_CFBundleDisplayName = "Chronos Dev Debug";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
INFOPLIST_KEY_NSCameraUsageDescription = "Access to camera is need to scan QR codes";
INFOPLIST_KEY_NSFaceIDUsageDescription = "To unlock the app";
Expand All @@ -926,9 +925,8 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
INFOPLIST_KEY_UIStatusBarStyle = "";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Dark;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -1243,7 +1241,7 @@
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Chronos/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Chronos;
INFOPLIST_KEY_CFBundleDisplayName = "Chronos Dev Debug";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
INFOPLIST_KEY_NSCameraUsageDescription = "Access to camera is need to scan QR codes";
INFOPLIST_KEY_NSFaceIDUsageDescription = "To unlock the app";
Expand All @@ -1252,9 +1250,8 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard";
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
INFOPLIST_KEY_UIStatusBarStyle = "";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Dark;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
1 change: 0 additions & 1 deletion Chronos/App/ChronosApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ struct ChronosApp: SwiftUI.App {
WindowGroup {
ContentView()
.environmentObject(LoginStatus())
.background(Color(red: 0.04, green: 0, blue: 0.11))
}
}
}
3 changes: 0 additions & 3 deletions Chronos/App/Login/PasswordLoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ struct PasswordLoginView: View {
if !loginPressed {
Text("Login")
.bold()
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
.disabled(loginPressed)
} else {
ProgressView()
.tint(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
}
Expand All @@ -85,7 +83,6 @@ struct PasswordLoginView: View {
}
.padding(16)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.background(Color(red: 0.04, green: 0, blue: 0.11).ignoresSafeArea())
.navigationTitle("Welcome Back")
.onAppear {
focusedField = .password
Expand Down
3 changes: 0 additions & 3 deletions Chronos/App/Misc/PasswordReminder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ struct PasswordReminderView: View {
if !verifyPressed {
Text("Verify")
.bold()
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
.disabled(verifyPressed)
} else {
ProgressView()
.tint(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
}
Expand All @@ -92,7 +90,6 @@ struct PasswordReminderView: View {
}
.padding(16)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.background(Color(red: 0.04, green: 0, blue: 0.11).ignoresSafeArea())
.navigationTitle("Password Reminder")
.navigationBarTitleDisplayMode(.inline)
.onAppear {
Expand Down
3 changes: 1 addition & 2 deletions Chronos/App/Onboarding/BiometricsSetupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ struct BiometricsSetupView: View {
stateOnboardingCompleted = true
} label: {
Text("Enable Biometrics")
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.bold()
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
Expand All @@ -56,7 +55,7 @@ struct BiometricsSetupView: View {
.padding(.vertical, 32)
.padding(.horizontal, 24)
.navigationTitle("Biometrics")
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationBarTitleDisplayMode(.inline)
.navigationBarBackButtonHidden()
}

Expand Down
3 changes: 0 additions & 3 deletions Chronos/App/Onboarding/PasswordSetupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ struct PasswordSetupView: View {
} label: {
if !isEncrypting {
Text("Next")
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.bold()
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
} else {
ProgressView()
.tint(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
}
Expand All @@ -104,7 +102,6 @@ struct PasswordSetupView: View {
.padding(.vertical, 32)
.padding(.horizontal, 24)
}
.background(Color(red: 0.04, green: 0, blue: 0.11).ignoresSafeArea())
.navigationTitle("Setup")
.navigationBarTitleDisplayMode(.inline)
.navigationDestination(isPresented: $nextBtnPressed) {
Expand Down
3 changes: 0 additions & 3 deletions Chronos/App/Onboarding/Restore/RestoreBackupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ struct RestoreBackupView: View {
} label: {
if !restoreBtnPressed {
Text("Next")
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.bold()
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
} else {
ProgressView()
.tint(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
}
Expand All @@ -88,7 +86,6 @@ struct RestoreBackupView: View {
.navigationDestination(isPresented: $passwordVerified) {
BiometricsSetupView()
}
.background(Color(red: 0.04, green: 0, blue: 0.11).ignoresSafeArea())
.onAppear {
focusedField = .password
}
Expand Down
4 changes: 0 additions & 4 deletions Chronos/App/Onboarding/StorageSetupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ struct StorageSetupView: View {
if iCloudSyncLastAttempt == 0 {
Button {} label: {
ProgressView()
.tint(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
}
Expand All @@ -49,7 +48,6 @@ struct StorageSetupView: View {
showICloudUnavailableDialog = true
}) {
Text("iCloud Unavailable")
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.bold()
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
Expand All @@ -70,7 +68,6 @@ struct StorageSetupView: View {
}
} label: {
Text("Enable iCloud")
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.bold()
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
Expand Down Expand Up @@ -135,7 +132,6 @@ struct StorageSetupView: View {
}
.padding(.vertical, 32)
.padding([.horizontal], 24)
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationTitle("Storage")
.navigationBarTitleDisplayMode(.inline)
.navigationDestination(isPresented: $nextBtnPressed) {
Expand Down
3 changes: 0 additions & 3 deletions Chronos/App/Onboarding/VaultSetupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ struct VaultSetupView: View {
} label: {
if !isCreatingVault {
Text("Next")
.foregroundStyle(Color(red: 0.04, green: 0, blue: 0.11))
.bold()
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
} else {
ProgressView()
.tint(Color(red: 0.04, green: 0, blue: 0.11))
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 32)
}
Expand All @@ -60,7 +58,6 @@ struct VaultSetupView: View {
}
.padding(.vertical, 32)
.padding(.horizontal, 24)
.background(Color(red: 0.04, green: 0, blue: 0.11).ignoresSafeArea())
.navigationTitle("Online Vault")
.navigationBarTitleDisplayMode(.inline)
.navigationDestination(isPresented: $nextBtnPressed) {
Expand Down
1 change: 0 additions & 1 deletion Chronos/App/Onboarding/WelcomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ struct WelcomeView: View {
}
.padding([.horizontal], 24)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationBarTitleDisplayMode(.inline)
.navigationDestination(isPresented: $getStartedPressed) {
StorageSetupView()
Expand Down
1 change: 0 additions & 1 deletion Chronos/App/Privacy/PrivacyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct PrivacyView: View {
Spacer()
}
.edgesIgnoringSafeArea(.all)
.background(Color(red: 0.04, green: 0, blue: 0.11))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct EncryptedExportConfirmPasswordView: View {
}
.padding([.horizontal], 24)
.navigationTitle("Encrypted Export")
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationBarTitleDisplayMode(.inline)
.navigationBarItems(trailing:
Button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ struct EncryptedExportPasswordView: View {
}
.padding([.horizontal], 24)
.navigationTitle("Encrypted Export")
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationBarTitleDisplayMode(.inline)
.scrollIndicators(.never)
.navigationBarItems(trailing: Button("Next", action: {
Expand Down
1 change: 0 additions & 1 deletion Chronos/App/Tabs/Settings/Export/ExportSelectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ struct ExportSelectionView: View {
.navigationTitle("Export Selection")
.padding([.horizontal], 24)
.padding([.bottom], 32)
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationBarTitleDisplayMode(.inline)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ struct ImportSourceListView: View {
ImportSourceDetailView(importSource: importSource)
} label: {
Text(importSource.name)
.fontWeight(.semibold)
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions Chronos/App/Tabs/Settings/SettingsTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ struct SettingsTab: View {
}
.listSectionSpacing(8)
}
.scrollContentBackground(.hidden)
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationTitle("Settings")
.navigationBarTitleDisplayMode(.inline)
.confirmationDialog("Log Out", isPresented: $showLogoutConfirmation, titleVisibility: .visible) {
Expand Down
1 change: 0 additions & 1 deletion Chronos/App/Tabs/Tokens/Row/TokenRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ struct TokenRowView: View {
}
.contentShape(Rectangle())
.padding(CGFloat(4))
.listRowBackground(Color(red: 0.04, green: 0, blue: 0.11))
.onTapGesture {
if !stateTapToRevealEnabled {
if token.isValid {
Expand Down
5 changes: 2 additions & 3 deletions Chronos/App/Tabs/Tokens/TokensTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ struct TokensTab: View {
}
}
.listStyle(.plain)
.background(Color(red: 0.04, green: 0, blue: 0.11))
.navigationTitle("Tokens")
.navigationBarTitleDisplayMode(.inline)
.searchable(text: $searchQuery, prompt: Text("Search tokens"))
.searchable(text: $searchQuery, placement: .navigationBarDrawer(displayMode: .always), prompt: Text("Search tokens"))
.toolbar {
ToolbarContent()
// ToolbarContent()
}
.overlay(
EmptyStateView()
Expand Down
20 changes: 0 additions & 20 deletions Chronos/Assets.xcassets/AccentColor.colorset/Contents.json

This file was deleted.

38 changes: 38 additions & 0 deletions Chronos/Assets.xcassets/Colors/AccentColor.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "153",
"green" : "196",
"red" : "85"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.741",
"green" : "0.949",
"red" : "0.455"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions Chronos/Assets.xcassets/Colors/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
10 changes: 7 additions & 3 deletions Chronos/Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -24,7 +25,7 @@
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" red="0.047058823529411764" green="0.0039215686274509803" blue="0.12549019607843137" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="TWl-Jm-eUa" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="ZrU-eJ-DKE"/>
<constraint firstItem="TWl-Jm-eUa" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="t9e-3T-vX6"/>
Expand All @@ -38,5 +39,8 @@
</scenes>
<resources>
<image name="Logo" width="512" height="512"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

0 comments on commit f3ead92

Please sign in to comment.