diff options
| author | Christian Cleberg <[email protected]> | 2026-04-13 20:41:49 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-13 20:41:49 -0500 |
| commit | 8f0f2b4b4f4b747b5d5fcc5a433f2f4b5109c940 (patch) | |
| tree | 4397cb440cc891ccf8c12d7236e26402b59b3400 /DayByDay/MonthCard.swift | |
| parent | be9c3ad3146d212dffe8c24f2fdf843773e1834e (diff) | |
| download | daybyday-1.3.2.tar.gz daybyday-1.3.2.tar.bz2 daybyday-1.3.2.zip | |
fix: sonarqube quality fixesv1.3.2
Diffstat (limited to 'DayByDay/MonthCard.swift')
| -rw-r--r-- | DayByDay/MonthCard.swift | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/DayByDay/MonthCard.swift b/DayByDay/MonthCard.swift index f462fd4..4b1d6ae 100644 --- a/DayByDay/MonthCard.swift +++ b/DayByDay/MonthCard.swift @@ -12,6 +12,12 @@ struct MonthCard: View { var isHighlighted = false @State private var isTapped = false + private var cardScale: CGFloat { + if isTapped { return 1.12 } + if isHighlighted { return 1.04 } + return 1.0 + } + var body: some View { ZStack { RoundedRectangle(cornerRadius: 32, style: .continuous) @@ -36,7 +42,7 @@ struct MonthCard: View { } } .shadow(color: isHighlighted ? .white.opacity(0.8) : .clear, radius: 12) - .scaleEffect(isTapped ? 1.12 : (isHighlighted ? 1.04 : 1.0)) + .scaleEffect(cardScale) .contentShape(RoundedRectangle(cornerRadius: 32, style: .continuous)) .rotation3DEffect(.degrees(isTapped ? 6 : 0), axis: (x: 1, y: 0, z: 0)) .animation(.spring(response: 0.35, dampingFraction: 0.5), value: isTapped) |
