Complete native rewrite of the web-based SoliCards game as a SwiftUI multiplatform app targeting iOS 17+, iPadOS 17+, and macOS 14+. Three solitaire variants (Klondike, Spider, FreeCell) with full game rules, drag & drop, smart zoom layout, 6 themes, 4 difficulty levels, SwiftData persistence, VoiceOver accessibility, and 57 unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
1.1 KiB
Swift
41 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
struct VictoryOverlayView: View {
|
|
let onNewGame: () -> Void
|
|
|
|
@State private var showContent = false
|
|
@Environment(\.accessibilityReduceMotion) private var reduceMotion
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
Color.black.opacity(0.6)
|
|
.ignoresSafeArea()
|
|
|
|
VStack(spacing: 24) {
|
|
Text("You Win!")
|
|
.font(.largeTitle.bold())
|
|
.foregroundStyle(.white)
|
|
|
|
Button("New Game") {
|
|
onNewGame()
|
|
}
|
|
.buttonStyle(.borderedProminent)
|
|
.controlSize(.large)
|
|
}
|
|
.scaleEffect(showContent ? 1.0 : 0.5)
|
|
.opacity(showContent ? 1.0 : 0)
|
|
}
|
|
.onAppear {
|
|
if reduceMotion {
|
|
showContent = true
|
|
} else {
|
|
withAnimation(.spring(response: 0.5, dampingFraction: 0.7)) {
|
|
showContent = true
|
|
}
|
|
}
|
|
}
|
|
.accessibilityAddTraits(.isModal)
|
|
.accessibilityLabel(Text("You win! Double tap New Game to start a new game."))
|
|
}
|
|
}
|