Update Neon colors and show color circles in theme picker
- Update NeonMoodTint to use synthwave colors matching Neon voting style (cyan, lime, yellow, orange, magenta) - Replace text label with 5 color circles in theme preview Colors row - Remove unused textColor customization code and picker views - Add .id(moodTint) to Month/Year views for color refresh - Clean up various unused color-related code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,18 +65,8 @@ struct CustomizeContentView: View {
|
||||
|
||||
// APPEARANCE
|
||||
SettingsSection(title: "Appearance") {
|
||||
VStack(spacing: 16) {
|
||||
// Theme
|
||||
SettingsRow(title: "Theme") {
|
||||
ThemePickerCompact()
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
// Text Color
|
||||
SettingsRow(title: "Text Color") {
|
||||
TextColorPickerCompact()
|
||||
}
|
||||
SettingsRow(title: "Theme") {
|
||||
ThemePickerCompact()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,13 +80,6 @@ struct CustomizeContentView: View {
|
||||
|
||||
Divider()
|
||||
|
||||
// Mood Colors
|
||||
SettingsRow(title: "Colors") {
|
||||
TintPickerCompact()
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
// Day View Style
|
||||
SettingsRow(title: "Entry Style") {
|
||||
DayViewStylePickerCompact()
|
||||
@@ -143,7 +126,6 @@ struct CustomizeView: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
@@ -157,18 +139,8 @@ struct CustomizeView: View {
|
||||
|
||||
// APPEARANCE
|
||||
SettingsSection(title: "Appearance") {
|
||||
VStack(spacing: 16) {
|
||||
// Theme
|
||||
SettingsRow(title: "Theme") {
|
||||
ThemePickerCompact()
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
// Text Color
|
||||
SettingsRow(title: "Text Color") {
|
||||
TextColorPickerCompact()
|
||||
}
|
||||
SettingsRow(title: "Theme") {
|
||||
ThemePickerCompact()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,13 +154,6 @@ struct CustomizeView: View {
|
||||
|
||||
Divider()
|
||||
|
||||
// Mood Colors
|
||||
SettingsRow(title: "Colors") {
|
||||
TintPickerCompact()
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
// Day View Style
|
||||
SettingsRow(title: "Entry Style") {
|
||||
DayViewStylePickerCompact()
|
||||
@@ -237,7 +202,7 @@ struct CustomizeView: View {
|
||||
HStack {
|
||||
Text("Customize")
|
||||
.font(.title.weight(.bold))
|
||||
.foregroundColor(textColor)
|
||||
.foregroundColor(theme.currentTheme.labelColor)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
@@ -251,13 +216,13 @@ struct SettingsSection<Content: View>: View {
|
||||
@ViewBuilder let content: Content
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
Text(title.uppercased())
|
||||
.font(.caption.weight(.semibold))
|
||||
.foregroundColor(textColor.opacity(0.4))
|
||||
.foregroundColor(theme.currentTheme.labelColor.opacity(0.4))
|
||||
.tracking(0.5)
|
||||
|
||||
VStack(spacing: 0) {
|
||||
@@ -277,13 +242,13 @@ struct SettingsRow<Content: View>: View {
|
||||
let title: String
|
||||
@ViewBuilder let content: Content
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
Text(title)
|
||||
.font(.subheadline.weight(.medium))
|
||||
.foregroundColor(textColor.opacity(0.7))
|
||||
.foregroundColor(theme.currentTheme.labelColor.opacity(0.7))
|
||||
|
||||
content
|
||||
}
|
||||
@@ -294,14 +259,12 @@ struct SettingsRow<Content: View>: View {
|
||||
struct ThemePickerCompact: View {
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 20) {
|
||||
ForEach(Theme.allCases, id: \.rawValue) { aTheme in
|
||||
Button(action: {
|
||||
theme = aTheme
|
||||
changeTextColor(forTheme: aTheme)
|
||||
EventLogger.log(event: "change_theme_id", withData: ["id": aTheme.rawValue])
|
||||
}) {
|
||||
VStack(spacing: 8) {
|
||||
@@ -323,7 +286,7 @@ struct ThemePickerCompact: View {
|
||||
|
||||
Text(aTheme.title)
|
||||
.font(.caption.weight(.medium))
|
||||
.foregroundColor(theme == aTheme ? .accentColor : textColor.opacity(0.6))
|
||||
.foregroundColor(theme == aTheme ? .accentColor : theme.currentTheme.labelColor.opacity(0.6))
|
||||
}
|
||||
}
|
||||
.buttonStyle(BorderlessButtonStyle())
|
||||
@@ -331,33 +294,6 @@ struct ThemePickerCompact: View {
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
|
||||
private func changeTextColor(forTheme theme: Theme) {
|
||||
if [Theme.iFeel, Theme.system].contains(theme) {
|
||||
let currentSystemScheme = UITraitCollection.current.userInterfaceStyle
|
||||
textColor = currentSystemScheme == .dark ? .white : .black
|
||||
}
|
||||
if theme == Theme.dark { textColor = .white }
|
||||
if theme == Theme.light { textColor = .black }
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Text Color Picker
|
||||
struct TextColorPickerCompact: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 16) {
|
||||
ColorPicker("", selection: $textColor)
|
||||
.labelsHidden()
|
||||
|
||||
Text("Sample Text")
|
||||
.font(.body.weight(.medium))
|
||||
.foregroundColor(textColor)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Image Pack Picker
|
||||
@@ -412,111 +348,10 @@ struct ImagePackPickerCompact: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Tint Picker
|
||||
struct TintPickerCompact: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
|
||||
@AppStorage(UserDefaultsStore.Keys.customMoodTintUpdateNumber.rawValue, store: GroupUserDefaults.groupDefaults) private var customMoodTintUpdateNumber: Int = 0
|
||||
@StateObject private var customMoodTint = UserDefaultsStore.getCustomMoodTint()
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 8) {
|
||||
ForEach(MoodTints.defaultOptions, id: \.rawValue) { tint in
|
||||
Button(action: {
|
||||
let impactMed = UIImpactFeedbackGenerator(style: .medium)
|
||||
impactMed.impactOccurred()
|
||||
moodTint = tint
|
||||
EventLogger.log(event: "change_mood_tint_id", withData: ["id": tint.rawValue])
|
||||
}) {
|
||||
HStack {
|
||||
HStack(spacing: 12) {
|
||||
ForEach(Mood.allValues, id: \.self) { mood in
|
||||
Circle()
|
||||
.fill(tint.color(forMood: mood))
|
||||
.frame(width: 28, height: 28)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
if moodTint == tint {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.font(.title2)
|
||||
.foregroundColor(.accentColor)
|
||||
}
|
||||
}
|
||||
.padding(14)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
.fill(moodTint == tint
|
||||
? Color.accentColor.opacity(0.08)
|
||||
: (colorScheme == .dark ? Color(.systemGray5) : Color(.systemGray6)))
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
// Custom colors
|
||||
Button(action: {
|
||||
moodTint = .Custom
|
||||
}) {
|
||||
HStack {
|
||||
HStack(spacing: 12) {
|
||||
ForEach(0..<5, id: \.self) { index in
|
||||
ColorPicker("", selection: colorBinding(for: index))
|
||||
.labelsHidden()
|
||||
.onChange(of: colorBinding(for: index).wrappedValue) {
|
||||
saveCustomMoodTint()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
if moodTint == .Custom {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.font(.title2)
|
||||
.foregroundColor(.accentColor)
|
||||
} else {
|
||||
Text("Custom")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
.padding(14)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
.fill(moodTint == .Custom
|
||||
? Color.accentColor.opacity(0.08)
|
||||
: (colorScheme == .dark ? Color(.systemGray5) : Color(.systemGray6)))
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
|
||||
private func colorBinding(for index: Int) -> Binding<Color> {
|
||||
switch index {
|
||||
case 0: return $customMoodTint.colorOne
|
||||
case 1: return $customMoodTint.colorTwo
|
||||
case 2: return $customMoodTint.colorThree
|
||||
case 3: return $customMoodTint.colorFour
|
||||
default: return $customMoodTint.colorFive
|
||||
}
|
||||
}
|
||||
|
||||
private func saveCustomMoodTint() {
|
||||
UserDefaultsStore.saveCustomMoodTint(customTint: customMoodTint)
|
||||
moodTint = .Custom
|
||||
EventLogger.log(event: "change_mood_tint_id", withData: ["id": MoodTints.Custom.rawValue])
|
||||
customMoodTintUpdateNumber += 1
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Voting Layout Picker
|
||||
struct VotingLayoutPickerCompact: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.votingLayoutStyle.rawValue, store: GroupUserDefaults.groupDefaults) private var votingLayoutStyle: Int = 0
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
private var currentLayout: VotingLayoutStyle {
|
||||
@@ -540,11 +375,11 @@ struct VotingLayoutPickerCompact: View {
|
||||
VStack(spacing: 6) {
|
||||
layoutIcon(for: layout)
|
||||
.frame(width: 44, height: 44)
|
||||
.foregroundColor(currentLayout == layout ? .accentColor : textColor.opacity(0.4))
|
||||
.foregroundColor(currentLayout == layout ? .accentColor : theme.currentTheme.labelColor.opacity(0.4))
|
||||
|
||||
Text(layout.displayName)
|
||||
.font(.caption2.weight(.medium))
|
||||
.foregroundColor(currentLayout == layout ? .accentColor : textColor.opacity(0.5))
|
||||
.foregroundColor(currentLayout == layout ? .accentColor : theme.currentTheme.labelColor.opacity(0.5))
|
||||
}
|
||||
.frame(width: 70)
|
||||
.padding(.vertical, 12)
|
||||
@@ -669,7 +504,6 @@ struct VotingLayoutPickerCompact: View {
|
||||
// MARK: - Custom Widget Section
|
||||
struct CustomWidgetSection: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@StateObject private var selectedWidget = CustomWidgetStateViewModel()
|
||||
|
||||
var body: some View {
|
||||
@@ -728,7 +562,7 @@ struct CustomWidgetSection: View {
|
||||
struct PersonalityPackPickerCompact: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.personalityPack.rawValue, store: GroupUserDefaults.groupDefaults) private var personalityPack: PersonalityPack = .Default
|
||||
@AppStorage(UserDefaultsStore.Keys.showNSFW.rawValue, store: GroupUserDefaults.groupDefaults) private var showNSFW: Bool = false
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@State private var showOver18Alert = false
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
@@ -751,12 +585,12 @@ struct PersonalityPackPickerCompact: View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(String(aPack.title()))
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundColor(textColor)
|
||||
.foregroundColor(theme.currentTheme.labelColor)
|
||||
|
||||
let strings = aPack.randomPushNotificationStrings()
|
||||
Text(strings.body)
|
||||
.font(.caption)
|
||||
.foregroundColor(textColor.opacity(0.5))
|
||||
.foregroundColor(theme.currentTheme.labelColor.opacity(0.5))
|
||||
.lineLimit(2)
|
||||
}
|
||||
|
||||
@@ -798,7 +632,7 @@ struct PersonalityPackPickerCompact: View {
|
||||
// MARK: - Day Filter Picker
|
||||
struct DayFilterPickerCompact: View {
|
||||
@StateObject private var filteredDays = DaysFilterClass.shared
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
let weekdays = [(Calendar.current.shortWeekdaySymbols[0], 1),
|
||||
@@ -828,7 +662,7 @@ struct DayFilterPickerCompact: View {
|
||||
}) {
|
||||
Text(day.prefix(2).uppercased())
|
||||
.font(.caption.weight(.semibold))
|
||||
.foregroundColor(isActive ? .white : textColor.opacity(0.5))
|
||||
.foregroundColor(isActive ? .white : theme.currentTheme.labelColor.opacity(0.5))
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 40)
|
||||
.background(
|
||||
@@ -842,7 +676,7 @@ struct DayFilterPickerCompact: View {
|
||||
|
||||
Text(String(localized: "day_picker_view_text"))
|
||||
.font(.caption)
|
||||
.foregroundColor(textColor.opacity(0.5))
|
||||
.foregroundColor(theme.currentTheme.labelColor.opacity(0.5))
|
||||
.multilineTextAlignment(.center)
|
||||
}
|
||||
}
|
||||
@@ -953,7 +787,7 @@ struct SubscriptionBannerView: View {
|
||||
// MARK: - Day View Style Picker
|
||||
struct DayViewStylePickerCompact: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.dayViewStyle.rawValue, store: GroupUserDefaults.groupDefaults) private var dayViewStyle: DayViewStyle = .classic
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
var body: some View {
|
||||
@@ -975,11 +809,11 @@ struct DayViewStylePickerCompact: View {
|
||||
VStack(spacing: 6) {
|
||||
styleIcon(for: style)
|
||||
.frame(width: 44, height: 44)
|
||||
.foregroundColor(dayViewStyle == style ? .accentColor : textColor.opacity(0.4))
|
||||
.foregroundColor(dayViewStyle == style ? .accentColor : theme.currentTheme.labelColor.opacity(0.4))
|
||||
|
||||
Text(style.displayName)
|
||||
.font(.caption2.weight(.medium))
|
||||
.foregroundColor(dayViewStyle == style ? .accentColor : textColor.opacity(0.5))
|
||||
.foregroundColor(dayViewStyle == style ? .accentColor : theme.currentTheme.labelColor.opacity(0.5))
|
||||
}
|
||||
.frame(width: 70)
|
||||
.padding(.vertical, 12)
|
||||
|
||||
Reference in New Issue
Block a user