From 18d880e2ea5e7ed70ec01f68c8a9a240908716be Mon Sep 17 00:00:00 2001 From: Lukas Korba Date: Wed, 23 Feb 2022 20:29:29 +0100 Subject: [PATCH] requested changes All comments have been resolved --- .../Contents.json | 2 +- .../ActiveButtonText.colorset/Contents.json | 2 +- .../Onboarding/OnboardingContentView.swift | 32 +++++++++++++------ .../Buttons/NeumorphicDesignModifier.swift | 4 +-- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/secant/Colors.xcassets/Buttons/OnboardingNavigation.colorset/Contents.json b/secant/Colors.xcassets/Buttons/OnboardingNavigation.colorset/Contents.json index dc1be31..e6b0b43 100644 --- a/secant/Colors.xcassets/Buttons/OnboardingNavigation.colorset/Contents.json +++ b/secant/Colors.xcassets/Buttons/OnboardingNavigation.colorset/Contents.json @@ -2,7 +2,7 @@ "colors" : [ { "color" : { - "color-space" : "display-p3", + "color-space" : "srgb", "components" : { "alpha" : "1.000", "blue" : "0xFD", diff --git a/secant/Colors.xcassets/Text/ActiveButtonText.colorset/Contents.json b/secant/Colors.xcassets/Text/ActiveButtonText.colorset/Contents.json index 8813445..f1d8177 100644 --- a/secant/Colors.xcassets/Text/ActiveButtonText.colorset/Contents.json +++ b/secant/Colors.xcassets/Text/ActiveButtonText.colorset/Contents.json @@ -20,7 +20,7 @@ } ], "color" : { - "color-space" : "display-p3", + "color-space" : "srgb", "components" : { "alpha" : "1.000", "blue" : "0x52", diff --git a/secant/Screens/Onboarding/OnboardingContentView.swift b/secant/Screens/Onboarding/OnboardingContentView.swift index ea10070..63d2c2f 100644 --- a/secant/Screens/Onboarding/OnboardingContentView.swift +++ b/secant/Screens/Onboarding/OnboardingContentView.swift @@ -89,24 +89,38 @@ struct OnboardingContentView: View { /// while iPhone X, 11, etc are different family devices, capable to use more of the space. extension OnboardingContentView { var circularFrameUniformSize: CGFloat { - let aspect = height / width - let deviceMultiplier = 1.0 + (((aspect / 1.725) - 1.0) * 2.0) + var deviceMultiplier = 1.0 - return width * (0.6 * deviceMultiplier) + if width > 0.0 { + let aspect = height / width + deviceMultiplier = 1.0 + (((aspect / 1.725) - 1.0) * 2.0) + } + + return width * 0.6 * deviceMultiplier } var circularFrameOffsetCoeffcient: CGFloat { - let aspect = height / width - let deviceMultiplier = aspect / 1.725 + var deviceMultiplier = 1.0 + + if width > 0.0 { + let aspect = height / width + deviceMultiplier = aspect / 1.725 + } return 4.4 * deviceMultiplier } var descriptionOffsetCoefficient: Double { - let aspect = height / width - let deviceMultiplier = 1.0 + (((aspect / 1.725) - 1.0) * 2.5) - - return 8.0 / deviceMultiplier + if width > 0.0 { + let aspect = height / width + let deviceMultiplier = 1.0 + (((aspect / 1.725) - 1.0) * 2.5) + + if abs(deviceMultiplier) > 0.0 { + return 8.0 / deviceMultiplier + } + } + + return 8.0 } } diff --git a/secant/UIComponents/Buttons/NeumorphicDesignModifier.swift b/secant/UIComponents/Buttons/NeumorphicDesignModifier.swift index d0e3fc8..c0e948b 100644 --- a/secant/UIComponents/Buttons/NeumorphicDesignModifier.swift +++ b/secant/UIComponents/Buttons/NeumorphicDesignModifier.swift @@ -29,13 +29,13 @@ fileprivate struct Neumorphic: ViewModifier { color: Asset.Colors.Onboarding.neumorphicDarkSide.color, radius: 15, x: colorScheme == .light && !isPressed ? 10 : -10, - y: colorScheme == .light && !isPressed ? 10 : 10 + y: 10 ) .shadow( color: Asset.Colors.Onboarding.neumorphicLightSide.color, radius: 10, x: colorScheme == .light && !isPressed ? -12 : 12, - y: colorScheme == .light && !isPressed ? -12 : -12 + y: -12 ) } }