From b26f5e387a6e7b63b9cee38e4c1cae7fdd38801f Mon Sep 17 00:00:00 2001 From: Juan David Hurtado Date: Sat, 11 Jun 2022 10:23:15 -0500 Subject: [PATCH 1/4] refactor: update image skeleton --- Sources/Purace/Styles/PuraceStyle.swift | 11 +++++++++++ .../Purace/Views/Basic/Image/PuraceImageView.swift | 14 +++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Sources/Purace/Styles/PuraceStyle.swift b/Sources/Purace/Styles/PuraceStyle.swift index 3622f2d..d545ffa 100644 --- a/Sources/Purace/Styles/PuraceStyle.swift +++ b/Sources/Purace/Styles/PuraceStyle.swift @@ -31,6 +31,17 @@ public struct PuraceStyle { public static let G6 = SwiftUI.Color(hex: "C4CCD3") ?? .gray public static let G7 = SwiftUI.Color(hex: "D7DCE1") ?? .gray public static let G8 = SwiftUI.Color(hex: "DFE4E8") ?? .gray + + public static let S1 = SwiftUI.Color(hex: "CECEC9") ?? .orange + public static let S2 = SwiftUI.Color(hex: "CFCCC8") ?? .orange + public static let S3 = SwiftUI.Color(hex: "E5DBCB") ?? .orange + public static let S4 = SwiftUI.Color(hex: "DACAB5") ?? .orange + public static let S5 = SwiftUI.Color(hex: "F1F2F4") ?? .orange + public static let S6 = SwiftUI.Color(hex: "D0CEC6") ?? .orange + public static let S7 = SwiftUI.Color(hex: "D4CAC6") ?? .orange + public static let S8 = SwiftUI.Color(hex: "C8D0CA") ?? .orange + + public static let allSkeletons: [SwiftUI.Color] = [Color.S1, Color.S2, Color.S3, Color.S4, Color.S5, Color.S6, Color.S7, Color.S8] } public struct Font { diff --git a/Sources/Purace/Views/Basic/Image/PuraceImageView.swift b/Sources/Purace/Views/Basic/Image/PuraceImageView.swift index db551b3..c139e0a 100644 --- a/Sources/Purace/Views/Basic/Image/PuraceImageView.swift +++ b/Sources/Purace/Views/Basic/Image/PuraceImageView.swift @@ -10,25 +10,21 @@ import SwiftUI import Kingfisher public struct PuraceImageView: View { + let skeletonColor: Color let url: URL? public init(url: URL?) { + self.skeletonColor = PuraceStyle.Color.allSkeletons.randomElement()! self.url = url } public var body: some View { KFImage.url(url) .resizable() - .fade(duration: 0.2) + .appendProcessor(DownsamplingImageProcessor(size: UIScreen.main.bounds.size)) + .scaleFactor(UIScreen.main.scale) .placeholder { _ in - GeometryReader { reader in - ZStack { - PuraceCircularLoaderView() - .foregroundColor(PuraceStyle.Color.G3) - .frame(width: reader.size.width * 0.1, height: reader.size.width * 0.1) - .position(x: reader.size.width / 2, y: reader.size.height / 2) - } - } + skeletonColor } } } From 9fc6252eec4790d9a003e8f56e050b3d0323fdd6 Mon Sep 17 00:00:00 2001 From: Juan David Hurtado Date: Sat, 11 Jun 2022 11:08:29 -0500 Subject: [PATCH 2/4] refactor: change tab color --- .../Purace/Views/Complex/Tab/PuraceTabItem.swift | 14 -------------- .../Purace/Views/Complex/Tab/PuraceTabView.swift | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 Sources/Purace/Views/Complex/Tab/PuraceTabItem.swift diff --git a/Sources/Purace/Views/Complex/Tab/PuraceTabItem.swift b/Sources/Purace/Views/Complex/Tab/PuraceTabItem.swift deleted file mode 100644 index 04beeb1..0000000 --- a/Sources/Purace/Views/Complex/Tab/PuraceTabItem.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// PuraceTabItem.swift -// -// -// Created by Juan Hurtado on 1/06/22. -// - -import Foundation -import SwiftUI - -struct PuraceTabItem { - let title: String - let content: () -> T -} diff --git a/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift b/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift index e859f1b..7491e7c 100644 --- a/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift +++ b/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift @@ -38,7 +38,7 @@ public struct PuraceTabView: View { .frame(height: 1) .opacity(0.1) HStack { - PuraceStyle.Color.B2 + PuraceStyle.Color.G2 .frame(width: size.width / CGFloat(titles.count), height: 3) Spacer(minLength: 0) }.offset(x: indicatorOffset, y: 0) From 1ebff147a46f472608f7a4b2529db9cd217e0f97 Mon Sep 17 00:00:00 2001 From: Juan David Hurtado Date: Sat, 11 Jun 2022 11:08:46 -0500 Subject: [PATCH 3/4] fix: tab tap gesture fixed --- Sources/Purace/Views/Complex/Tab/PuraceTabView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift b/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift index 7491e7c..2ec1ec7 100644 --- a/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift +++ b/Sources/Purace/Views/Complex/Tab/PuraceTabView.swift @@ -24,6 +24,7 @@ public struct PuraceTabView: View { ForEach(0.. Date: Sat, 11 Jun 2022 11:11:25 -0500 Subject: [PATCH 4/4] refactor: update button colors --- .../Purace/Views/Basic/Button/PuraceButtonView.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift b/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift index d84d144..cde4b02 100644 --- a/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift +++ b/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift @@ -29,7 +29,7 @@ public struct PuraceButtonView: View { case .loud: return .white case .quiet: - return PuraceStyle.Color.B1 + return PuraceStyle.Color.G1 case .custom(_, _, let textColor): return textColor } @@ -38,9 +38,9 @@ public struct PuraceButtonView: View { private func getBackgroundColor() -> Color { switch type { case .loud: - return PuraceStyle.Color.B2 + return PuraceStyle.Color.G2 case .quiet: - return PuraceStyle.Color.B5 + return PuraceStyle.Color.G6 case .custom(let backgroundColor, _, _): return backgroundColor } @@ -49,9 +49,9 @@ public struct PuraceButtonView: View { private func getOnPressedBackgroundColor() -> Color { switch type { case .loud: - return PuraceStyle.Color.B1 + return PuraceStyle.Color.G1 case .quiet: - return PuraceStyle.Color.B4 + return PuraceStyle.Color.G5 case .custom(_, let onPressedColor, _): return onPressedColor }