diff options
Diffstat (limited to 'AnimalsView.swift')
| -rw-r--r-- | AnimalsView.swift | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/AnimalsView.swift b/AnimalsView.swift new file mode 100644 index 0000000..d3c5a2d --- /dev/null +++ b/AnimalsView.swift @@ -0,0 +1,30 @@ +// +// AnimalsView.swift +// DayByDay +// + +import SwiftUI + +/// Displays 12 animals as large, tappable cards in a scrollable grid. +/// Adapts between 1 and 2 columns depending on available width. +struct AnimalsView: View { + private let columns = [ + GridItem(.adaptive(minimum: 300, maximum: 500), spacing: 24) + ] + + var body: some View { + ScrollView { + LazyVGrid(columns: columns, spacing: 24) { + ForEach(LearnAnimal.allCases) { animal in + AnimalCard(animal: animal) + .frame(height: 200) + } + } + .padding(32) + } + } +} + +#Preview { + AnimalsView() +} |
