Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
833841dcdd
commit
b08acb9012
@ -4443,10 +4443,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TAP" : {
|
|
||||||
"comment" : "Text displayed as an overlay on the card during the interactive reveal state, instructing the user to tap.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Tap Deal to start the round" : {
|
"Tap Deal to start the round" : {
|
||||||
"comment" : "Instructional text for new players.",
|
"comment" : "Instructional text for new players.",
|
||||||
"extractionState" : "stale",
|
"extractionState" : "stale",
|
||||||
|
|||||||
@ -312,6 +312,7 @@ struct GameTableView: View, SherpaDelegate {
|
|||||||
bettedOnPlayer: state.bettedOnPlayer,
|
bettedOnPlayer: state.bettedOnPlayer,
|
||||||
isDealing: isDealing,
|
isDealing: isDealing,
|
||||||
screenSize: screenSize,
|
screenSize: screenSize,
|
||||||
|
totalBetAmount: state.totalBetAmount,
|
||||||
onReveal: { state.revealCurrentCard() },
|
onReveal: { state.revealCurrentCard() },
|
||||||
onUpdateProgress: { state.updateRevealProgress($0) }
|
onUpdateProgress: { state.updateRevealProgress($0) }
|
||||||
)
|
)
|
||||||
@ -321,16 +322,15 @@ struct GameTableView: View, SherpaDelegate {
|
|||||||
|
|
||||||
Spacer(minLength: 0)
|
Spacer(minLength: 0)
|
||||||
|
|
||||||
// Betting table
|
// Betting table - completely hidden during dealing
|
||||||
|
if !isDealing {
|
||||||
BettingTableView(
|
BettingTableView(
|
||||||
gameState: state,
|
gameState: state,
|
||||||
selectedChip: selectedChip
|
selectedChip: selectedChip
|
||||||
)
|
)
|
||||||
.frame(maxWidth: maxContentWidth)
|
.frame(maxWidth: maxContentWidth)
|
||||||
.padding(.horizontal, Design.Spacing.medium)
|
.padding(.horizontal, Design.Spacing.medium)
|
||||||
.opacity(isDealing ? (state.isWaitingForReveal ? 0.1 : 0.3) : 1.0)
|
.transition(.opacity)
|
||||||
.blur(radius: isDealing ? (state.isWaitingForReveal ? 3 : 1.5) : 0)
|
|
||||||
.scaleEffect(isDealing && state.isWaitingForReveal ? 0.95 : 1.0)
|
|
||||||
.debugBorder(showDebugBorders, color: .blue, label: "BetTable")
|
.debugBorder(showDebugBorders, color: .blue, label: "BetTable")
|
||||||
|
|
||||||
// Betting hint (static, below table, above chips)
|
// Betting hint (static, below table, above chips)
|
||||||
@ -344,6 +344,7 @@ struct GameTableView: View, SherpaDelegate {
|
|||||||
.padding(.vertical, Design.Spacing.small)
|
.padding(.vertical, Design.Spacing.small)
|
||||||
.debugBorder(showDebugBorders, color: .purple, label: "Hint")
|
.debugBorder(showDebugBorders, color: .purple, label: "Hint")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Spacer(minLength: Design.Spacing.xSmall)
|
Spacer(minLength: Design.Spacing.xSmall)
|
||||||
|
|
||||||
@ -424,6 +425,7 @@ struct GameTableView: View, SherpaDelegate {
|
|||||||
bettedOnPlayer: state.bettedOnPlayer,
|
bettedOnPlayer: state.bettedOnPlayer,
|
||||||
isDealing: isDealing,
|
isDealing: isDealing,
|
||||||
screenSize: screenSize,
|
screenSize: screenSize,
|
||||||
|
totalBetAmount: state.totalBetAmount,
|
||||||
onReveal: { state.revealCurrentCard() },
|
onReveal: { state.revealCurrentCard() },
|
||||||
onUpdateProgress: { state.updateRevealProgress($0) }
|
onUpdateProgress: { state.updateRevealProgress($0) }
|
||||||
)
|
)
|
||||||
@ -446,16 +448,15 @@ struct GameTableView: View, SherpaDelegate {
|
|||||||
.debugBorder(showDebugBorders, color: .yellow, label: "Spacer3")
|
.debugBorder(showDebugBorders, color: .yellow, label: "Spacer3")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Betting table
|
// Betting table - completely hidden during dealing
|
||||||
|
if !isDealing {
|
||||||
BettingTableView(
|
BettingTableView(
|
||||||
gameState: state,
|
gameState: state,
|
||||||
selectedChip: selectedChip
|
selectedChip: selectedChip
|
||||||
)
|
)
|
||||||
.frame(maxWidth: isLargeScreen ? maxContentWidth : .infinity)
|
.frame(maxWidth: isLargeScreen ? maxContentWidth : .infinity)
|
||||||
.padding(.horizontal, Design.Spacing.medium)
|
.padding(.horizontal, Design.Spacing.medium)
|
||||||
.opacity(isDealing ? (state.isWaitingForReveal ? 0.1 : 0.3) : 1.0)
|
.transition(.opacity)
|
||||||
.blur(radius: isDealing ? (state.isWaitingForReveal ? 3 : 1.5) : 0)
|
|
||||||
.scaleEffect(isDealing && state.isWaitingForReveal ? 0.95 : 1.0)
|
|
||||||
.debugBorder(showDebugBorders, color: .blue, label: "BetTable")
|
.debugBorder(showDebugBorders, color: .blue, label: "BetTable")
|
||||||
|
|
||||||
// Betting hint (static, below table, above chips)
|
// Betting hint (static, below table, above chips)
|
||||||
@ -469,6 +470,7 @@ struct GameTableView: View, SherpaDelegate {
|
|||||||
.padding(.vertical, Design.Spacing.small)
|
.padding(.vertical, Design.Spacing.small)
|
||||||
.debugBorder(showDebugBorders, color: .purple, label: "Hint")
|
.debugBorder(showDebugBorders, color: .purple, label: "Hint")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Chip selector - only shown during betting phase
|
// Chip selector - only shown during betting phase
|
||||||
if state.currentPhase == .betting && !state.showResultBanner {
|
if state.currentPhase == .betting && !state.showResultBanner {
|
||||||
|
|||||||
@ -34,6 +34,8 @@ struct CardsDisplayArea: View {
|
|||||||
let isDealing: Bool
|
let isDealing: Bool
|
||||||
/// Full screen size for calculating card width in dealing mode.
|
/// Full screen size for calculating card width in dealing mode.
|
||||||
let screenSize: CGSize
|
let screenSize: CGSize
|
||||||
|
/// Total bet amount to display below the bottom hand during dealing.
|
||||||
|
let totalBetAmount: Int
|
||||||
let onReveal: () -> Void
|
let onReveal: () -> Void
|
||||||
let onUpdateProgress: (Double) -> Void
|
let onUpdateProgress: (Double) -> Void
|
||||||
|
|
||||||
@ -164,6 +166,9 @@ struct CardsDisplayArea: View {
|
|||||||
|
|
||||||
playerHandSection(width: handSectionWidth)
|
playerHandSection(width: handSectionWidth)
|
||||||
.matchedGeometryEffect(id: "player", in: animation)
|
.matchedGeometryEffect(id: "player", in: animation)
|
||||||
|
|
||||||
|
// Bet amount below the bottom hand
|
||||||
|
betAmountDisplay
|
||||||
} else {
|
} else {
|
||||||
playerHandSection(width: handSectionWidth)
|
playerHandSection(width: handSectionWidth)
|
||||||
.matchedGeometryEffect(id: "player", in: animation)
|
.matchedGeometryEffect(id: "player", in: animation)
|
||||||
@ -173,6 +178,9 @@ struct CardsDisplayArea: View {
|
|||||||
|
|
||||||
bankerHandSection(width: handSectionWidth)
|
bankerHandSection(width: handSectionWidth)
|
||||||
.matchedGeometryEffect(id: "banker", in: animation)
|
.matchedGeometryEffect(id: "banker", in: animation)
|
||||||
|
|
||||||
|
// Bet amount below the bottom hand
|
||||||
|
betAmountDisplay
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -199,18 +207,39 @@ struct CardsDisplayArea: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
// Only show background in betting phase (horizontal layout)
|
||||||
.background(
|
.background(
|
||||||
|
Group {
|
||||||
|
if !isDealing {
|
||||||
RoundedRectangle(cornerRadius: Design.CornerRadius.xLarge)
|
RoundedRectangle(cornerRadius: Design.CornerRadius.xLarge)
|
||||||
.fill(Color.black.opacity(isWaitingForReveal ? 0.05 : Design.Opacity.quarter))
|
.fill(Color.black.opacity(Design.Opacity.quarter))
|
||||||
.accessibilityHidden(true)
|
.accessibilityHidden(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
.debugBorder(showDebugBorders, color: .mint, label: "HandsContainer")
|
.debugBorder(showDebugBorders, color: .mint, label: "HandsContainer")
|
||||||
.animation(.spring(duration: 0.6, bounce: 0.2), value: isDealing)
|
.animation(.easeOut(duration: 0.5), value: isDealing)
|
||||||
.animation(.spring(duration: 0.5, bounce: 0.15), value: playerOnBottom)
|
.animation(.easeOut(duration: 0.4), value: playerOnBottom)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Private Views
|
// MARK: - Private Views
|
||||||
|
|
||||||
|
/// Bet amount display shown below the bottom hand during dealing.
|
||||||
|
@ViewBuilder
|
||||||
|
private var betAmountDisplay: some View {
|
||||||
|
if totalBetAmount > 0 {
|
||||||
|
HStack(spacing: Design.Spacing.xSmall) {
|
||||||
|
Image(systemName: "dollarsign.circle.fill")
|
||||||
|
.font(.system(size: Design.BaseFontSize.xLarge))
|
||||||
|
.foregroundStyle(.yellow)
|
||||||
|
Text("\(totalBetAmount)")
|
||||||
|
.font(.system(size: Design.BaseFontSize.medium, weight: .bold, design: .rounded))
|
||||||
|
.foregroundStyle(.yellow)
|
||||||
|
}
|
||||||
|
.padding(.top, Design.Spacing.medium)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func playerHandSection(width: CGFloat) -> some View {
|
private func playerHandSection(width: CGFloat) -> some View {
|
||||||
// Calculate value from face-up cards
|
// Calculate value from face-up cards
|
||||||
let visibleValue: Int = {
|
let visibleValue: Int = {
|
||||||
@ -336,6 +365,7 @@ struct CardsDisplayArea: View {
|
|||||||
bettedOnPlayer: nil,
|
bettedOnPlayer: nil,
|
||||||
isDealing: false,
|
isDealing: false,
|
||||||
screenSize: CGSize(width: 400, height: 800),
|
screenSize: CGSize(width: 400, height: 800),
|
||||||
|
totalBetAmount: 0,
|
||||||
onReveal: {},
|
onReveal: {},
|
||||||
onUpdateProgress: { _ in }
|
onUpdateProgress: { _ in }
|
||||||
)
|
)
|
||||||
@ -370,6 +400,7 @@ struct CardsDisplayArea: View {
|
|||||||
bettedOnPlayer: true,
|
bettedOnPlayer: true,
|
||||||
isDealing: true,
|
isDealing: true,
|
||||||
screenSize: CGSize(width: 400, height: 800),
|
screenSize: CGSize(width: 400, height: 800),
|
||||||
|
totalBetAmount: 150,
|
||||||
onReveal: {},
|
onReveal: {},
|
||||||
onUpdateProgress: { _ in }
|
onUpdateProgress: { _ in }
|
||||||
)
|
)
|
||||||
@ -406,6 +437,7 @@ struct CardsDisplayArea: View {
|
|||||||
bettedOnPlayer: false,
|
bettedOnPlayer: false,
|
||||||
isDealing: true,
|
isDealing: true,
|
||||||
screenSize: CGSize(width: 400, height: 800),
|
screenSize: CGSize(width: 400, height: 800),
|
||||||
|
totalBetAmount: 250,
|
||||||
onReveal: {},
|
onReveal: {},
|
||||||
onUpdateProgress: { _ in }
|
onUpdateProgress: { _ in }
|
||||||
)
|
)
|
||||||
|
|||||||
@ -148,6 +148,7 @@ struct CompactHandView: View {
|
|||||||
}
|
}
|
||||||
.frame(height: cardHeight)
|
.frame(height: cardHeight)
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
|
.padding(.vertical, isWinner ? Design.Spacing.small : 0)
|
||||||
.background(winnerBorder)
|
.background(winnerBorder)
|
||||||
.overlay(alignment: .bottom) {
|
.overlay(alignment: .bottom) {
|
||||||
winBadge
|
winBadge
|
||||||
@ -184,6 +185,7 @@ struct CompactHandView: View {
|
|||||||
revealStyle: revealStyle,
|
revealStyle: revealStyle,
|
||||||
isWaiting: isWaitingForReveal && currentRevealIndex == revealIndex,
|
isWaiting: isWaitingForReveal && currentRevealIndex == revealIndex,
|
||||||
progress: currentRevealIndex == revealIndex ? revealProgress : 0.0,
|
progress: currentRevealIndex == revealIndex ? revealProgress : 0.0,
|
||||||
|
isBottomHand: isBottom,
|
||||||
onReveal: onReveal,
|
onReveal: onReveal,
|
||||||
onUpdateProgress: onUpdateProgress
|
onUpdateProgress: onUpdateProgress
|
||||||
)
|
)
|
||||||
|
|||||||
@ -15,9 +15,19 @@ struct InteractiveCardView: View {
|
|||||||
let revealStyle: RevealStyle
|
let revealStyle: RevealStyle
|
||||||
let isWaiting: Bool
|
let isWaiting: Bool
|
||||||
let progress: Double
|
let progress: Double
|
||||||
|
/// Whether this card is in the bottom (Home) hand - used for glow effect
|
||||||
|
let isBottomHand: Bool
|
||||||
let onReveal: () -> Void
|
let onReveal: () -> Void
|
||||||
let onUpdateProgress: (Double) -> Void
|
let onUpdateProgress: (Double) -> Void
|
||||||
|
|
||||||
|
/// Whether to show the glowing animation around this card
|
||||||
|
private var showGlow: Bool {
|
||||||
|
isWaiting && !isFaceUp && isBottomHand && revealStyle != .auto
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Animation state for the pulsing glow
|
||||||
|
@State private var glowPulse = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
if revealStyle == .squeeze && !isFaceUp && isWaiting {
|
if revealStyle == .squeeze && !isFaceUp && isWaiting {
|
||||||
@ -26,14 +36,11 @@ struct InteractiveCardView: View {
|
|||||||
width: cardWidth,
|
width: cardWidth,
|
||||||
onReveal: onReveal
|
onReveal: onReveal
|
||||||
)
|
)
|
||||||
|
.modifier(GlowModifier(isActive: showGlow, glowPulse: glowPulse, cardWidth: cardWidth))
|
||||||
} else {
|
} else {
|
||||||
// Standard CardView (handles its own flip animation)
|
// Standard CardView (handles its own flip animation)
|
||||||
CardView(card: card, isFaceUp: isFaceUp, cardWidth: cardWidth)
|
CardView(card: card, isFaceUp: isFaceUp, cardWidth: cardWidth)
|
||||||
.overlay {
|
.modifier(GlowModifier(isActive: showGlow, glowPulse: glowPulse, cardWidth: cardWidth))
|
||||||
if !isFaceUp && isWaiting && revealStyle == .tap {
|
|
||||||
revealInstructionOverlay(text: String(localized: "TAP"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
if !isFaceUp && isWaiting && revealStyle == .tap {
|
if !isFaceUp && isWaiting && revealStyle == .tap {
|
||||||
onReveal()
|
onReveal()
|
||||||
@ -41,25 +48,68 @@ struct InteractiveCardView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onAppear {
|
||||||
|
if showGlow {
|
||||||
|
glowPulse = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.onChange(of: showGlow) { _, newValue in
|
||||||
|
glowPulse = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func revealInstructionOverlay(text: String) -> some View {
|
// MARK: - Glow Modifier
|
||||||
Text(text)
|
|
||||||
.font(.system(size: Design.BaseFontSize.small, weight: .black, design: .rounded))
|
/// A view modifier that adds a pulsing glow effect around a card.
|
||||||
.foregroundStyle(.white)
|
private struct GlowModifier: ViewModifier {
|
||||||
.padding(.horizontal, Design.Spacing.small)
|
let isActive: Bool
|
||||||
.padding(.vertical, Design.Spacing.xxSmall)
|
let glowPulse: Bool
|
||||||
.background(
|
let cardWidth: CGFloat
|
||||||
Capsule()
|
|
||||||
.fill(Color.black.opacity(Design.Opacity.heavy))
|
/// Corner radius matching CasinoKit's CardView
|
||||||
.overlay(
|
private var cornerRadius: CGFloat {
|
||||||
Capsule()
|
cardWidth * 0.08
|
||||||
.strokeBorder(.white.opacity(Design.Opacity.medium), lineWidth: 1)
|
}
|
||||||
|
|
||||||
|
func body(content: Content) -> some View {
|
||||||
|
if isActive {
|
||||||
|
content
|
||||||
|
.overlay {
|
||||||
|
// Glow effect using multiple stroke layers
|
||||||
|
ZStack {
|
||||||
|
// Outer glow strokes (largest to smallest for layered glow)
|
||||||
|
RoundedRectangle(cornerRadius: cornerRadius)
|
||||||
|
.stroke(Color.orange.opacity(glowPulse ? 0.6 : 0.2), lineWidth: glowPulse ? 20 : 10)
|
||||||
|
.blur(radius: 10)
|
||||||
|
|
||||||
|
RoundedRectangle(cornerRadius: cornerRadius)
|
||||||
|
.stroke(Color.yellow.opacity(glowPulse ? 0.8 : 0.3), lineWidth: glowPulse ? 12 : 6)
|
||||||
|
.blur(radius: 6)
|
||||||
|
|
||||||
|
RoundedRectangle(cornerRadius: cornerRadius)
|
||||||
|
.stroke(Color.yellow.opacity(glowPulse ? 1.0 : 0.5), lineWidth: glowPulse ? 6 : 3)
|
||||||
|
.blur(radius: 3)
|
||||||
|
|
||||||
|
// Bright animated border (sharp, on top)
|
||||||
|
RoundedRectangle(cornerRadius: cornerRadius)
|
||||||
|
.strokeBorder(
|
||||||
|
LinearGradient(
|
||||||
|
colors: [.yellow, .white, .yellow],
|
||||||
|
startPoint: .topLeading,
|
||||||
|
endPoint: .bottomTrailing
|
||||||
|
),
|
||||||
|
lineWidth: glowPulse ? 4 : 3
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
.scaleEffect(isWaiting ? 1.0 : 0.8)
|
}
|
||||||
.opacity(isWaiting ? 1.0 : 0)
|
.scaleEffect(glowPulse ? 1.02 : 1.0)
|
||||||
.animation(.interactiveSpring().repeatForever(), value: isWaiting)
|
.animation(
|
||||||
.allowsHitTesting(false)
|
.easeInOut(duration: 0.7).repeatForever(autoreverses: true),
|
||||||
|
value: glowPulse
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
content
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,11 @@ A feature-rich Baccarat (Punto Banco) app for iOS built with SwiftUI. Experience
|
|||||||
- Animated card dealing with sound effects and haptics
|
- Animated card dealing with sound effects and haptics
|
||||||
- Automatic shoe reshuffling with burn card
|
- Automatic shoe reshuffling with burn card
|
||||||
|
|
||||||
|
### ⚙️ Settings & Customization
|
||||||
|
- Dealing animations toggle and adjustable dealing speed
|
||||||
|
- Card reveal style: Auto (instant flip), Tap (per-card), Squeeze (peek/drag reveal)
|
||||||
|
- Persistent preferences via iCloud sync
|
||||||
|
|
||||||
### 💰 Betting Options
|
### 💰 Betting Options
|
||||||
|
|
||||||
#### Main Bets
|
#### Main Bets
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user