Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct MindView: View {
- @EnvironmentObject var art: ArtHandlers
- var body: some View {
- VStack(alignment: .leading) {
- ScrollView {
- let gap: CGFloat = 12
- HStack(alignment: .top, spacing: gap) {
- ForEach(0..<art.mind.count, id: \.self) { index in
- LazyVGrid(columns: [GridItem(.flexible())], spacing: gap) {
- ForEach(art.mind[index], id: \.id) { a in
- ArtCard(a: a)
- }
- }
- }
- }
- .padding(.top, 80)
- .padding(12)
- }
- .ignoresSafeArea()
- }
- .ignoresSafeArea()
- .padding(.top, 30.0)
- .preferredColorScheme(.light)
- .onAppear {
- art.refresh(ini: true, col: 3)
- }
- .font(.custom(mainFont, size: 12))
- .background(Color("BG").ignoresSafeArea())
- }
- }
- struct ArtCard: View {
- let a: Art
- var body: some View {
- VStack(alignment: .leading, spacing: gap) {
- Image(nsImage: NSImage(data: a.thumb!) ?? NSImage())
- .resizable()
- .aspectRatio(contentMode: .fit)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement