From 33b51aaa3d008c1d599d8ab2dc41df3237fb5817 Mon Sep 17 00:00:00 2001 From: ZProLegend007 Date: Sat, 6 Jan 2024 00:00:44 +0800 Subject: [PATCH 1/5] Add gradient template with purple colour to text "Mythic" on onboarding message. --- Mythic/Views/Sheets/Onboarding/Onboarding.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Mythic/Views/Sheets/Onboarding/Onboarding.swift b/Mythic/Views/Sheets/Onboarding/Onboarding.swift index 21feecff..5610cbcc 100644 --- a/Mythic/Views/Sheets/Onboarding/Onboarding.swift +++ b/Mythic/Views/Sheets/Onboarding/Onboarding.swift @@ -31,9 +31,13 @@ struct OnboardingView: View { // MARK: - Body var body: some View { VStack { - Text("Welcome to Mythic!") + Text("Welcome to ") .font(.title) + Text("Mythic!") + .font(.title) + .overlay(gradientOverlay) + Divider() Text( @@ -78,6 +82,16 @@ struct OnboardingView: View { AuthView(isPresented: $isAuthViewPresented, authSuccessful: $authSuccessful) } } + + // MARK: - Gradient Overlay + var gradientOverlay: some View { + LinearGradient( + gradient: Gradient(colors: [Color.purple, Color.purple]), + startPoint: .leading, + endPoint: .trailing + ) + .mask(Text("Mythic!").font(.title)) + } } // MARK: - Preview From ebd96161cbca67b9b9d7950db786ff8a168c34a3 Mon Sep 17 00:00:00 2001 From: ZProLegend007 Date: Sat, 6 Jan 2024 13:42:24 +0800 Subject: [PATCH 2/5] Add hex support for gradient overlay for "Mythic" text on onboarding message. Use Mythic gradient for "Mythic" text. Alter Mythic gradient to look acceptable in light and dark mode. Make next button on onboarding less prominent to encourage sign in. --- .../Views/Sheets/Onboarding/Onboarding.swift | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Mythic/Views/Sheets/Onboarding/Onboarding.swift b/Mythic/Views/Sheets/Onboarding/Onboarding.swift index 5610cbcc..fc6f2417 100644 --- a/Mythic/Views/Sheets/Onboarding/Onboarding.swift +++ b/Mythic/Views/Sheets/Onboarding/Onboarding.swift @@ -17,6 +17,24 @@ import SwiftUI import Combine +// Add hex support for gradient overlay for "Mythic" text. +extension NSColor { + convenience init?(hex: String) { + var hexSanitized = hex.trimmingCharacters(in: .whitespacesAndNewlines) + hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "") + + var rgb: UInt64 = 0 + + guard Scanner(string: hexSanitized).scanHexInt64(&rgb) else { return nil } + + let red = CGFloat((rgb & 0xFF0000) >> 16) / 255.0 + let green = CGFloat((rgb & 0x00FF00) >> 8) / 255.0 + let blue = CGFloat(rgb & 0x0000FF) / 255.0 + + self.init(srgbRed: red, green: green, blue: blue, alpha: 1.0) + } +} + // MARK: - OnboardingView Struct /// A view providing onboarding experience for first-time users. struct OnboardingView: View { @@ -27,7 +45,6 @@ struct OnboardingView: View { // MARK: - State Variables @State private var isAuthViewPresented = false @State private var authSuccessful: Bool? - // MARK: - Body var body: some View { VStack { @@ -71,7 +88,7 @@ struct OnboardingView: View { isPresented = false isInstallViewPresented = true } - .buttonStyle(.borderedProminent) + .buttonStyle(.bordered) } } .padding() @@ -82,11 +99,14 @@ struct OnboardingView: View { AuthView(isPresented: $isAuthViewPresented, authSuccessful: $authSuccessful) } } - + // MARK: - Gradient Overlay var gradientOverlay: some View { LinearGradient( - gradient: Gradient(colors: [Color.purple, Color.purple]), + gradient: Gradient(colors: [ + Color(NSColor(hex: "#7e0cef")!), + Color(NSColor(hex: "#8b01dda")!) + ]), startPoint: .leading, endPoint: .trailing ) @@ -95,7 +115,7 @@ struct OnboardingView: View { } // MARK: - Preview -#Preview { + #Preview { OnboardingView( isPresented: .constant(true), isInstallViewPresented: .constant(false) From 66f3650448be65ef30009029648a27ae20ba9dbd Mon Sep 17 00:00:00 2001 From: ZProLegend007 Date: Sat, 6 Jan 2024 14:41:13 +0800 Subject: [PATCH 3/5] Change app category to Games. Change corner radius for sections in Home screen to 10 from 20 for consistency with Apple format. --- Mythic.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mythic.xcodeproj/project.pbxproj b/Mythic.xcodeproj/project.pbxproj index d0977656..7856045c 100644 --- a/Mythic.xcodeproj/project.pbxproj +++ b/Mythic.xcodeproj/project.pbxproj @@ -722,7 +722,7 @@ INFOPLIST_FILE = Mythic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Mythic; "INFOPLIST_KEY_CFBundleDisplayName[sdk=*]" = Mythic; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", From dcfbbfdb9fa6b68ef41f64c68cf78a5575bc0726 Mon Sep 17 00:00:00 2001 From: ZProLegend007 Date: Sat, 6 Jan 2024 14:41:13 +0800 Subject: [PATCH 4/5] Change app category to Games. Change corner radius for sections in Home screen to 10 from 20 for consistency with Apple format. --- Mythic.xcodeproj/project.pbxproj | 4 ++-- Mythic/Views/Navigation/Home.swift | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Mythic.xcodeproj/project.pbxproj b/Mythic.xcodeproj/project.pbxproj index d0977656..3637299e 100644 --- a/Mythic.xcodeproj/project.pbxproj +++ b/Mythic.xcodeproj/project.pbxproj @@ -722,7 +722,7 @@ INFOPLIST_FILE = Mythic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Mythic; "INFOPLIST_KEY_CFBundleDisplayName[sdk=*]" = Mythic; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -761,7 +761,7 @@ INFOPLIST_FILE = Mythic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Mythic; "INFOPLIST_KEY_CFBundleDisplayName[sdk=*]" = Mythic; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/Mythic/Views/Navigation/Home.swift b/Mythic/Views/Navigation/Home.swift index 7a216418..0760cb25 100644 --- a/Mythic/Views/Navigation/Home.swift +++ b/Mythic/Views/Navigation/Home.swift @@ -123,7 +123,7 @@ struct HomeView: View { ) } } - .cornerRadius(20) + .cornerRadius(10) .overlay( ZStack(alignment: .bottom) { VStack { @@ -185,7 +185,7 @@ struct HomeView: View { } } .background(.background) - .cornerRadius(20) + .cornerRadius(10) // MARK: - Side Views VStack { @@ -207,7 +207,7 @@ struct HomeView: View { } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.background) - .cornerRadius(20) + .cornerRadius(10) // MARK: View 2 (Bottom) VStack { @@ -215,7 +215,7 @@ struct HomeView: View { } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.background) - .cornerRadius(20) + .cornerRadius(10) } } .padding() From 430abef06bfcf302b8ab76cfa8065af9e0ccbd60 Mon Sep 17 00:00:00 2001 From: Zac <97338659+ZProLegend007@users.noreply.github.com> Date: Wed, 10 Jan 2024 00:38:59 +0800 Subject: [PATCH 5/5] Update project.pbxproj Signed-off-by: Zac <97338659+ZProLegend007@users.noreply.github.com> --- Mythic.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mythic.xcodeproj/project.pbxproj b/Mythic.xcodeproj/project.pbxproj index 3637299e..d0977656 100644 --- a/Mythic.xcodeproj/project.pbxproj +++ b/Mythic.xcodeproj/project.pbxproj @@ -722,7 +722,7 @@ INFOPLIST_FILE = Mythic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Mythic; "INFOPLIST_KEY_CFBundleDisplayName[sdk=*]" = Mythic; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -761,7 +761,7 @@ INFOPLIST_FILE = Mythic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Mythic; "INFOPLIST_KEY_CFBundleDisplayName[sdk=*]" = Mythic; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)",