general: improve consistency
This commit is contained in:
@@ -99,7 +99,7 @@ class TimerEngine: ObservableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func triggerReminder(for type: TimerType) {
|
func triggerReminder(for type: TimerType) {
|
||||||
switch type {
|
switch type {
|
||||||
case .lookAway:
|
case .lookAway:
|
||||||
pause()
|
pause()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ struct AnimatedFaceView: View {
|
|||||||
ZStack {
|
ZStack {
|
||||||
// Face circle
|
// Face circle
|
||||||
Circle()
|
Circle()
|
||||||
.fill(Color.yellow)
|
.stroke(Color.accentColor, lineWidth: size * 0.04)
|
||||||
.frame(width: size, height: size)
|
.frame(width: size, height: size)
|
||||||
|
|
||||||
// Eyes
|
// Eyes
|
||||||
@@ -28,7 +28,7 @@ struct AnimatedFaceView: View {
|
|||||||
|
|
||||||
// Smile
|
// Smile
|
||||||
Arc(startAngle: .degrees(20), endAngle: .degrees(160), clockwise: false)
|
Arc(startAngle: .degrees(20), endAngle: .degrees(160), clockwise: false)
|
||||||
.stroke(Color.black, lineWidth: size * 0.05)
|
.stroke(Color.accentColor, lineWidth: size * 0.04)
|
||||||
.frame(width: size * 0.5, height: size * 0.3)
|
.frame(width: size * 0.5, height: size * 0.3)
|
||||||
.offset(y: size * 0.15)
|
.offset(y: size * 0.15)
|
||||||
}
|
}
|
||||||
@@ -75,12 +75,12 @@ struct Eye: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Circle()
|
Circle()
|
||||||
.fill(Color.white)
|
.stroke(Color.accentColor, lineWidth: size * 0.15)
|
||||||
.frame(width: size, height: size)
|
.frame(width: size, height: size)
|
||||||
|
|
||||||
Circle()
|
Circle()
|
||||||
.fill(Color.black)
|
.fill(Color.accentColor)
|
||||||
.frame(width: size * 0.5, height: size * 0.5)
|
.frame(width: size * 0.3, height: size * 0.3)
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ struct InfoBox: View {
|
|||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
.glassEffect(.regular.tint(.blue), in: .rect(cornerRadius: 8))
|
.glassEffect(.regular.tint(.accentColor), in: .rect(cornerRadius: 8))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ struct MenuBarButtonStyle: ButtonStyle {
|
|||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 6)
|
RoundedRectangle(cornerRadius: 6)
|
||||||
.fill(
|
.fill(
|
||||||
configuration.isPressed ? Color.blue.opacity(0.2) : Color.gray.opacity(0.1)
|
configuration.isPressed ? Color.accentColor.opacity(0.2) : Color.gray.opacity(0.1)
|
||||||
)
|
)
|
||||||
.opacity(configuration.isPressed ? 1 : 0)
|
.opacity(configuration.isPressed ? 1 : 0)
|
||||||
)
|
)
|
||||||
@@ -30,7 +30,7 @@ struct MenuBarHoverButtonStyle: ButtonStyle {
|
|||||||
configuration.label
|
configuration.label
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 6)
|
RoundedRectangle(cornerRadius: 6)
|
||||||
.fill(isHovered ? Color.blue.opacity(0.35) : Color.clear)
|
.fill(isHovered ? Color.accentColor.opacity(0.35) : Color.clear)
|
||||||
)
|
)
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
.onHover { hovering in
|
.onHover { hovering in
|
||||||
@@ -54,7 +54,7 @@ struct MenuBarContentView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Image(systemName: "eye.fill")
|
Image(systemName: "eye.fill")
|
||||||
.font(.title2)
|
.font(.title2)
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
Text("Gaze")
|
Text("Gaze")
|
||||||
.font(.title2)
|
.font(.title2)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
@@ -79,6 +79,9 @@ struct MenuBarContentView: View {
|
|||||||
state: state,
|
state: state,
|
||||||
onSkip: {
|
onSkip: {
|
||||||
timerEngine.skipNext(type: timerType)
|
timerEngine.skipNext(type: timerType)
|
||||||
|
},
|
||||||
|
onDevTrigger: {
|
||||||
|
timerEngine.triggerReminder(for: timerType)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -153,7 +156,9 @@ struct TimerStatusRow: View {
|
|||||||
let type: TimerType
|
let type: TimerType
|
||||||
let state: TimerState
|
let state: TimerState
|
||||||
var onSkip: () -> Void
|
var onSkip: () -> Void
|
||||||
|
var onDevTrigger: (() -> Void)? = nil
|
||||||
@State private var isHoveredSkip = false
|
@State private var isHoveredSkip = false
|
||||||
|
@State private var isHoveredDevTrigger = false
|
||||||
@State private var isHoveredBody = false
|
@State private var isHoveredBody = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -174,14 +179,34 @@ struct TimerStatusRow: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button(action: onSkip) {
|
#if DEBUG
|
||||||
Image(systemName: "forward.fill")
|
if let onDevTrigger = onDevTrigger {
|
||||||
|
Button(action: onDevTrigger) {
|
||||||
|
Image(systemName: "bolt.fill")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.yellow)
|
||||||
.padding(6)
|
.padding(6)
|
||||||
.background(
|
.background(
|
||||||
Circle()
|
Circle()
|
||||||
.fill(isHoveredSkip ? Color.blue.opacity(0.35) : Color.clear)
|
.fill(isHoveredDevTrigger ? Color.yellow.opacity(0.35) : Color.clear)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.buttonStyle(.plain)
|
||||||
|
.help("Trigger \(type.displayName) reminder now (dev)")
|
||||||
|
.onHover { hovering in
|
||||||
|
isHoveredDevTrigger = hovering
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Button(action: onSkip) {
|
||||||
|
Image(systemName: "forward.fill")
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
.padding(6)
|
||||||
|
.background(
|
||||||
|
Circle()
|
||||||
|
.fill(isHoveredSkip ? Color.accentColor.opacity(0.35) : Color.clear)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
@@ -194,7 +219,7 @@ struct TimerStatusRow: View {
|
|||||||
isHoveredBody = hovering
|
isHoveredBody = hovering
|
||||||
}.background(
|
}.background(
|
||||||
RoundedRectangle(cornerRadius: 6).fill(
|
RoundedRectangle(cornerRadius: 6).fill(
|
||||||
isHoveredBody ? Color.blue.opacity(0.35) : Color.clear)
|
isHoveredBody ? Color.accentColor.opacity(0.35) : Color.clear)
|
||||||
)
|
)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
@@ -202,7 +227,7 @@ struct TimerStatusRow: View {
|
|||||||
|
|
||||||
private var iconColor: Color {
|
private var iconColor: Color {
|
||||||
switch type {
|
switch type {
|
||||||
case .lookAway: return .blue
|
case .lookAway: return .accentColor
|
||||||
case .blink: return .green
|
case .blink: return .green
|
||||||
case .posture: return .orange
|
case .posture: return .orange
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ struct BlinkSetupView: View {
|
|||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
.glassEffect(.regular.tint(.blue), in: .rect(cornerRadius: 8))
|
.glassEffect(.regular.tint(.accentColor), in: .rect(cornerRadius: 8))
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
Toggle("Enable Blink Reminders", isOn: $enabled)
|
Toggle("Enable Blink Reminders", isOn: $enabled)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct CompletionView: View {
|
|||||||
|
|
||||||
HStack(spacing: 16) {
|
HStack(spacing: 16) {
|
||||||
Image(systemName: "menubar.rectangle")
|
Image(systemName: "menubar.rectangle")
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
.frame(width: 30)
|
.frame(width: 30)
|
||||||
Text("Gaze will appear in your menu bar")
|
Text("Gaze will appear in your menu bar")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
@@ -41,7 +41,7 @@ struct CompletionView: View {
|
|||||||
|
|
||||||
HStack(spacing: 16) {
|
HStack(spacing: 16) {
|
||||||
Image(systemName: "clock")
|
Image(systemName: "clock")
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
.frame(width: 30)
|
.frame(width: 30)
|
||||||
Text("Timers will start automatically")
|
Text("Timers will start automatically")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
@@ -50,7 +50,7 @@ struct CompletionView: View {
|
|||||||
|
|
||||||
HStack(spacing: 16) {
|
HStack(spacing: 16) {
|
||||||
Image(systemName: "gearshape")
|
Image(systemName: "gearshape")
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
.frame(width: 30)
|
.frame(width: 30)
|
||||||
Text("Adjust settings anytime from the menu bar")
|
Text("Adjust settings anytime from the menu bar")
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ struct LookAwaySetupView: View {
|
|||||||
VStack(spacing: 30) {
|
VStack(spacing: 30) {
|
||||||
Image(systemName: "eye.fill")
|
Image(systemName: "eye.fill")
|
||||||
.font(.system(size: 60))
|
.font(.system(size: 60))
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
|
|
||||||
Text("Look Away Reminder")
|
Text("Look Away Reminder")
|
||||||
.font(.system(size: 28, weight: .bold))
|
.font(.system(size: 28, weight: .bold))
|
||||||
@@ -48,7 +48,7 @@ struct LookAwaySetupView: View {
|
|||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
.glassEffect(.regular.tint(.blue), in: .rect(cornerRadius: 8))
|
.glassEffect(.regular.tint(.accentColor), in: .rect(cornerRadius: 8))
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
Toggle("Enable Look Away Reminders", isOn: $enabled)
|
Toggle("Enable Look Away Reminders", isOn: $enabled)
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ struct OnboardingContainerView: View {
|
|||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
.glassEffect(
|
.glassEffect(
|
||||||
.regular.tint(currentPage == 5 ? .green : .blue).interactive(),
|
.regular.tint(currentPage == 5 ? .green : .accentColor).interactive(),
|
||||||
in: .rect(cornerRadius: 10))
|
in: .rect(cornerRadius: 10))
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 40)
|
.padding(.horizontal, 40)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ struct PostureSetupView: View {
|
|||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
.glassEffect(.regular.tint(.blue), in: .rect(cornerRadius: 8))
|
.glassEffect(.regular.tint(.accentColor), in: .rect(cornerRadius: 8))
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
Toggle("Enable Posture Reminders", isOn: $enabled)
|
Toggle("Enable Posture Reminders", isOn: $enabled)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ struct SettingsOnboardingView: View {
|
|||||||
|
|
||||||
Image(systemName: "gearshape.fill")
|
Image(systemName: "gearshape.fill")
|
||||||
.font(.system(size: 80))
|
.font(.system(size: 80))
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
|
|
||||||
Text("Final Settings")
|
Text("Final Settings")
|
||||||
.font(.system(size: 36, weight: .bold))
|
.font(.system(size: 36, weight: .bold))
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ struct WelcomeView: View {
|
|||||||
|
|
||||||
Image(systemName: "eye.fill")
|
Image(systemName: "eye.fill")
|
||||||
.font(.system(size: 80))
|
.font(.system(size: 80))
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
|
|
||||||
Text("Welcome to Gaze")
|
Text("Welcome to Gaze")
|
||||||
.font(.system(size: 36, weight: .bold))
|
.font(.system(size: 36, weight: .bold))
|
||||||
@@ -48,7 +48,7 @@ struct FeatureRow: View {
|
|||||||
HStack(alignment: .top, spacing: 16) {
|
HStack(alignment: .top, spacing: 16) {
|
||||||
Image(systemName: icon)
|
Image(systemName: icon)
|
||||||
.font(.title2)
|
.font(.title2)
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.accentColor)
|
||||||
.frame(width: 30)
|
.frame(width: 30)
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ struct LookAwayReminderView: View {
|
|||||||
|
|
||||||
Circle()
|
Circle()
|
||||||
.trim(from: 0, to: progress)
|
.trim(from: 0, to: progress)
|
||||||
.stroke(Color.blue, lineWidth: 8)
|
.stroke(Color.accentColor, lineWidth: 8)
|
||||||
.frame(width: 120, height: 120)
|
.frame(width: 120, height: 120)
|
||||||
.rotationEffect(.degrees(-90))
|
.rotationEffect(.degrees(-90))
|
||||||
.animation(.linear(duration: 1), value: progress)
|
.animation(.linear(duration: 1), value: progress)
|
||||||
|
|||||||
Reference in New Issue
Block a user