everything changed

This commit is contained in:
Trey t
2022-02-20 14:33:58 -06:00
parent 1cf38cb854
commit 0035f61204
50 changed files with 2155 additions and 875 deletions

View File

@@ -8,14 +8,16 @@
import SwiftUI
struct BGViewItem: View {
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
let mood: Mood
let size: CGSize
var color: Color
let animate: Bool
let yRowPosition: Float
init(mood: Mood, size: CGSize, animate: Bool, yRowPosition: Float) {
color = mood.color
init(mood: Mood, size: CGSize, animate: Bool, yRowPosition: Float, color: Color) {
self.color = color
self.mood = mood
self.size = size
self.yRowPosition = yRowPosition
@@ -23,16 +25,18 @@ struct BGViewItem: View {
}
var body: some View {
Mood.allValues.randomElement()?.icon
FontAwesomeMoodImages.icon(forMood: mood)
.resizable()
.frame(width: size.width, height: size.height)
.foregroundColor(color)
// .blur(radius: 3)
.foregroundColor(DefaultMoodTint.color(forMood: mood))
// .blur(radius: 3)
.opacity(0.1)
}
}
struct BGView: View, Equatable {
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
var numAcross: Int
var numDown: Int
let iconSize = 35
@@ -45,15 +49,22 @@ struct BGView: View, Equatable {
numDown = Int(screenHeight)/iconSize
}
var randomMood: Mood? {
return Mood.allValues.randomElement()
}
var body: some View {
VStack {
ForEach(0...numDown, id: \.self) { row in
HStack {
ForEach(0...numAcross, id: \.self) { _ in
BGViewItem(mood: Mood.allValues.randomElement()!,
size: .init(width: iconSize,height: iconSize),
animate: false,
yRowPosition: Float(row)/Float(numDown))
if let randomMood = randomMood {
BGViewItem(mood: randomMood,
size: .init(width: iconSize,height: iconSize),
animate: false,
yRowPosition: Float(row)/Float(numDown),
color: moodTint.color(forMood:randomMood))
}
}.frame(minWidth: 0, maxWidth: .infinity)
.padding([.trailing, .leading], 13.5)
}