blob: 9b935e55bd526e56b4bd93ff9593e31911affb75 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
//
// ColorsView.swift
// DayByDay
//
import SwiftUI
/// Displays 10 colors as large, tappable cards in a scrollable grid.
/// Adapts between 1 and 2 columns depending on available width.
struct ColorsView: View {
private let columns = [
GridItem(.adaptive(minimum: 300, maximum: 500), spacing: 24)
]
var body: some View {
ScrollView {
LazyVGrid(columns: columns, spacing: 24) {
ForEach(LearnColor.allCases) { color in
ColorCard(learnColor: color)
.frame(height: 200)
}
}
.padding(32)
}
}
}
#Preview {
ColorsView()
}
|