krz/daybyday

iOS learning games for young children: days, months, seasons, numbers, letters, animals and more. education ios kids swift https://krz.sh/apps/daybyday/

DayByDay/Profiles/AvatarBadge.swift

main
daybyday/DayByDay/Profiles/AvatarBadge.swift history · blame · raw

25 lines · 587 bytes

1 symbol in this file
 1//
 2//  AvatarBadge.swift
 3//  DayByDay
 4//
 5
 6import SwiftUI
 7
 8/// A child's avatar animal on their color.
 9struct AvatarBadge: View {
10    let avatar: AvatarAnimal
11    let color: ProfileColor
12
13    var body: some View {
14        GeometryReader { geo in
15            ZStack {
16                Circle().fill(color.color)
17                Image(systemName: avatar.symbol)
18                    .font(.system(size: geo.size.width * 0.5))
19                    .foregroundStyle(color.symbolColor)
20            }
21        }
22        .aspectRatio(1, contentMode: .fit)
23        .accessibilityHidden(true)
24    }
25}