Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
c93d80e591
commit
69793e85c5
3
PRD.md
3
PRD.md
@ -563,7 +563,8 @@ The following changes **automatically require** PRD updates:
|
||||
4. **Auto-stop**: Automatically stops current sound when selecting new one
|
||||
5. **Play/Stop Controls**: Simple button with visual feedback
|
||||
6. **Continuous playback**: Sounds loop until stopped
|
||||
7. **Responsive layout**: Optimized for portrait and landscape orientations
|
||||
7. **Empty state guidance**: Prompt shown when no sound is selected
|
||||
8. **Responsive layout**: Optimized for portrait and landscape orientations
|
||||
|
||||
## Technical Requirements
|
||||
|
||||
|
||||
@ -58,6 +58,11 @@ struct ContentView: View {
|
||||
}
|
||||
.tag(Tab.settings)
|
||||
}
|
||||
.onChange(of: selectedTab) { oldValue, newValue in
|
||||
if oldValue == .clock && newValue != .clock {
|
||||
clockViewModel.setDisplayMode(false)
|
||||
}
|
||||
}
|
||||
.accentColor(AppAccent.primary)
|
||||
.background(Color.Branding.primary.ignoresSafeArea())
|
||||
}
|
||||
|
||||
@ -68,6 +68,14 @@ class ClockViewModel {
|
||||
// Manage wake lock based on display mode and keep awake setting
|
||||
updateWakeLockState()
|
||||
}
|
||||
|
||||
func setDisplayMode(_ enabled: Bool) {
|
||||
guard isDisplayMode != enabled else { return }
|
||||
withAnimation(Design.Animation.spring(bounce: Design.Animation.springBounce)) {
|
||||
isDisplayMode = enabled
|
||||
}
|
||||
updateWakeLockState()
|
||||
}
|
||||
|
||||
func updateStyle(_ newStyle: ClockStyle) {
|
||||
|
||||
|
||||
@ -74,15 +74,23 @@ struct NoiseView: View {
|
||||
VStack(spacing: 0) {
|
||||
// Fixed header
|
||||
VStack(alignment: .leading, spacing: Design.Spacing.medium) {
|
||||
if !isPad {
|
||||
Text("Ambient Sounds")
|
||||
.sectionTitleStyle()
|
||||
}
|
||||
|
||||
// Playback controls - always visible when sound is selected
|
||||
if selectedSound != nil {
|
||||
soundControlView
|
||||
.centered()
|
||||
} else {
|
||||
// Placeholder when no sound selected
|
||||
VStack(spacing: Design.Spacing.small) {
|
||||
Image(systemName: "music.note")
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
Text("Select a sound to begin")
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, Design.Spacing.large)
|
||||
}
|
||||
}
|
||||
.contentPadding(horizontal: Design.Spacing.large)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user