diff --git a/PuraceDemo/PuraceDemo/Examples/Basic/ButtonExample.swift b/PuraceDemo/PuraceDemo/Examples/Basic/ButtonExample.swift index ed72257..9a9e24b 100644 --- a/PuraceDemo/PuraceDemo/Examples/Basic/ButtonExample.swift +++ b/PuraceDemo/PuraceDemo/Examples/Basic/ButtonExample.swift @@ -11,16 +11,30 @@ import Purace struct ButtonExample: View { var body: some View { - Text("`PuraceButtonView('title', type: .loud)`") - PuraceButtonView("Font size: 12", fontSize: 12) - PuraceButtonView("Font size: 14", fontSize: 14) - PuraceButtonView("Font size: 16", fontSize: 16) - .padding(.bottom) - - Text("`PuraceButtonView('title', type: .quiet)`") - PuraceButtonView("Font size: 12", fontSize: 12, type: .quiet) - PuraceButtonView("Font size: 14", fontSize: 14, type: .quiet) - PuraceButtonView("Font size: 16", fontSize: 16, type: .quiet) - Spacer() + VStack(spacing: 0) { + VStack { + Text("`PuraceButtonView('title', type: .loud)`") + PuraceButtonView("Font size: 12", fontSize: 12) + PuraceButtonView("Font size: 14", fontSize: 14) + PuraceButtonView("Font size: 16", fontSize: 16) + .padding(.bottom) + } + + VStack { + Text("`PuraceButtonView('title', type: .quiet)`") + PuraceButtonView("Font size: 12", fontSize: 12, type: .quiet) + PuraceButtonView("Font size: 14", fontSize: 14, type: .quiet) + PuraceButtonView("Font size: 16", fontSize: 16, type: .quiet) + .padding(.bottom) + } + + VStack { + Text("`PuraceButtonView('title', type: .transparent)`") + PuraceButtonView("Font size: 12", fontSize: 12, type: .transparent) + PuraceButtonView("Font size: 14", fontSize: 14, type: .transparent) + PuraceButtonView("Font size: 16", fontSize: 16, type: .transparent) + Spacer() + } + } } } diff --git a/Sources/Purace/Views/Basic/Button/PuraceButtonType.swift b/Sources/Purace/Views/Basic/Button/PuraceButtonType.swift index 251f563..5c4f3ed 100644 --- a/Sources/Purace/Views/Basic/Button/PuraceButtonType.swift +++ b/Sources/Purace/Views/Basic/Button/PuraceButtonType.swift @@ -9,5 +9,6 @@ import Foundation import SwiftUI public enum PuraceButtonType { - case loud, quiet, custom(Color, Color, Color) // 0: background, 1: on pressed, 2: text color + case loud, quiet, transparent + case custom(Color, Color, Color) // 0: background, 1: on pressed, 2: text color } diff --git a/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift b/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift index 30ca237..251aa8d 100644 --- a/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift +++ b/Sources/Purace/Views/Basic/Button/PuraceButtonView.swift @@ -9,9 +9,6 @@ import Foundation import SwiftUI public struct PuraceButtonView: View { - @State var backgroundColor: Color = .blue - @State var isBeingPressed = false - let title: String let fontSize: Int let type: PuraceButtonType @@ -39,9 +36,11 @@ struct PuraceButtonStyle: ButtonStyle { private func getBackgroundColor() -> Color { switch type { case .loud: - return PuraceStyle.Color.G2 + return PuraceStyle.Color.B2 case .quiet: - return .black.opacity(0.05) + return PuraceStyle.Color.B5 + case .transparent: + return .white.opacity(0.01) case .custom(let backgroundColor, _, _): return backgroundColor } @@ -52,7 +51,9 @@ struct PuraceButtonStyle: ButtonStyle { case .loud: return .white case .quiet: - return PuraceStyle.Color.G1 + return PuraceStyle.Color.B1 + case .transparent: + return PuraceStyle.Color.B1 case .custom(_, _, let textColor): return textColor } @@ -61,9 +62,11 @@ struct PuraceButtonStyle: ButtonStyle { private func getOnPressedBackgroundColor() -> Color { switch type { case .loud: - return PuraceStyle.Color.G1 + return PuraceStyle.Color.B1 case .quiet: - return .black.opacity(0.15) + return PuraceStyle.Color.B4 + case .transparent: + return PuraceStyle.Color.B5 case .custom(_, let onPressedColor, _): return onPressedColor } diff --git a/Sources/Purace/Views/Complex/Image Viewer/PuraceImageViewer.swift b/Sources/Purace/Views/Complex/Image Viewer/PuraceImageViewer.swift index 65de36b..7e06af2 100644 --- a/Sources/Purace/Views/Complex/Image Viewer/PuraceImageViewer.swift +++ b/Sources/Purace/Views/Complex/Image Viewer/PuraceImageViewer.swift @@ -70,7 +70,7 @@ public struct PuraceImageViewer: View { topBar TabView(selection: $currentIndex) { - ForEach(0..: View { func headers(in size: CGSize) -> some View { HStack(spacing: 0) { - ForEach(0..: View { headers(in: reader.size) indicator(in: reader.size) ZStack { - ForEach(0..