Add 4 new mood icon styles and improve widget layouts

New mood icon styles:
- Weather (☀️⛈️)
- Garden (🌸🥀)
- Hearts (💖💔)
- Cosmic (🕳️)

Widget improvements:
- Small vote widget: 3-over-2 grid layout
- Medium vote widget: single horizontal row
- Redesigned voted stats view with checkmark badge
- Fixed text truncation on non-subscriber view
- Added comprehensive previews for all widget types

Bug fix:
- Voting header now updates when mood image style changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-21 19:06:05 -06:00
parent e1f7525d47
commit 2a703a8969
6 changed files with 1435 additions and 87 deletions

View File

@@ -15,19 +15,30 @@ enum MoodImages: Int, CaseIterable {
case FontAwesome
case Emoji
case HandEmjoi
case Weather
case Garden
case Hearts
case Cosmic
func icon(forMood mood: Mood) -> Image {
switch self {
case .FontAwesome:
return FontAwesomeMoodImages.icon(forMood: mood)
case .Emoji:
return EmojiMoodImages.icon(forMood: mood)
case .HandEmjoi:
return HandEmojiMoodImages.icon(forMood: mood)
case .Weather:
return WeatherMoodImages.icon(forMood: mood)
case .Garden:
return GardenMoodImages.icon(forMood: mood)
case .Hearts:
return HeartsMoodImages.icon(forMood: mood)
case .Cosmic:
return CosmicMoodImages.icon(forMood: mood)
}
}
var moodImages: MoodImagable.Type {
switch self {
case .FontAwesome:
@@ -36,6 +47,14 @@ enum MoodImages: Int, CaseIterable {
return EmojiMoodImages.self
case .HandEmjoi:
return HandEmojiMoodImages.self
case .Weather:
return WeatherMoodImages.self
case .Garden:
return GardenMoodImages.self
case .Hearts:
return HeartsMoodImages.self
case .Cosmic:
return CosmicMoodImages.self
}
}
}
@@ -102,3 +121,87 @@ final class HandEmojiMoodImages: MoodImagable {
}
}
}
final class WeatherMoodImages: MoodImagable {
static func icon(forMood mood: Mood) -> Image {
switch mood {
case .horrible:
return Image(uiImage: "⛈️".textToImage()!)
case .bad:
return Image(uiImage: "🌧️".textToImage()!)
case .average:
return Image(uiImage: "☁️".textToImage()!)
case .good:
return Image(uiImage: "".textToImage()!)
case .great:
return Image(uiImage: "☀️".textToImage()!)
case .missing:
return Image(uiImage: "🌫️".textToImage()!)
case .placeholder:
return Image("xmark-solid", bundle: .main)
}
}
}
final class GardenMoodImages: MoodImagable {
static func icon(forMood mood: Mood) -> Image {
switch mood {
case .horrible:
return Image(uiImage: "🥀".textToImage()!)
case .bad:
return Image(uiImage: "🍂".textToImage()!)
case .average:
return Image(uiImage: "🌱".textToImage()!)
case .good:
return Image(uiImage: "🌿".textToImage()!)
case .great:
return Image(uiImage: "🌸".textToImage()!)
case .missing:
return Image(uiImage: "🕳️".textToImage()!)
case .placeholder:
return Image("xmark-solid", bundle: .main)
}
}
}
final class HeartsMoodImages: MoodImagable {
static func icon(forMood mood: Mood) -> Image {
switch mood {
case .horrible:
return Image(uiImage: "💔".textToImage()!)
case .bad:
return Image(uiImage: "🩶".textToImage()!)
case .average:
return Image(uiImage: "🤍".textToImage()!)
case .good:
return Image(uiImage: "🩷".textToImage()!)
case .great:
return Image(uiImage: "💖".textToImage()!)
case .missing:
return Image(uiImage: "🖤".textToImage()!)
case .placeholder:
return Image("xmark-solid", bundle: .main)
}
}
}
final class CosmicMoodImages: MoodImagable {
static func icon(forMood mood: Mood) -> Image {
switch mood {
case .horrible:
return Image(uiImage: "🕳️".textToImage()!)
case .bad:
return Image(uiImage: "🌑".textToImage()!)
case .average:
return Image(uiImage: "🌓".textToImage()!)
case .good:
return Image(uiImage: "🌕".textToImage()!)
case .great:
return Image(uiImage: "".textToImage()!)
case .missing:
return Image(uiImage: "".textToImage()!)
case .placeholder:
return Image("xmark-solid", bundle: .main)
}
}
}

View File

@@ -11,6 +11,7 @@ import SwiftData
struct AddMoodHeaderView: View {
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@AppStorage(UserDefaultsStore.Keys.moodImages.rawValue, store: GroupUserDefaults.groupDefaults) private var imagePack: MoodImages = .FontAwesome
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
@AppStorage(UserDefaultsStore.Keys.votingLayoutStyle.rawValue, store: GroupUserDefaults.groupDefaults) private var votingLayoutStyle: Int = 0
@@ -29,6 +30,10 @@ struct AddMoodHeaderView: View {
var body: some View {
ZStack {
// Force re-render when image pack changes
Text(String(imagePack.rawValue))
.hidden()
theme.currentTheme.secondaryBGColor
VStack(spacing: 16) {