-
-
Notifications
You must be signed in to change notification settings - Fork 199
392-odometer-liquid-glass #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mikaelacaron
merged 10 commits into
mikaelacaron:dev
from
aprameyak:392-odometer-liquidglass
Feb 12, 2026
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0e5566a
392-odometer-liquid-glass
aprameyak e085e9e
Make button into an icon
mikaelacaron 6069775
Add back icons
mikaelacaron 20efc2e
Add back comments
mikaelacaron 816eedd
Update EditOdometerReadingView
mikaelacaron dbc7a10
Fix previews
mikaelacaron 196932f
Update OdometerRowView
mikaelacaron bee811b
Update OdometerView
mikaelacaron 66f86da
Update Localizable.xcstrings
mikaelacaron 9f3a337
Remove Glass modifiers
mikaelacaron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
Basic-Car-Maintenance/Shared/Design/LiquidGlassModifiers.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import SwiftUI | ||
|
|
||
| struct LiquidGlassCardModifier: ViewModifier { | ||
| @Environment(\.colorScheme) var colorScheme | ||
| @Environment(\.accessibilityReduceTransparency) var reduceTransparency | ||
| @Environment(\.colorSchemeContrast) var colorSchemeContrast | ||
|
|
||
| func body(content: Content) -> some View { | ||
| content | ||
| .background( | ||
| reduceTransparency ? | ||
| Color(UIColor.secondarySystemGroupedBackground) : Color.clear | ||
| ) | ||
| .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16)) | ||
| .shadow(color: .black.opacity(colorScheme == .dark ? 0.3 : 0.1), radius: 6, y: 3) | ||
| .overlay( | ||
| RoundedRectangle(cornerRadius: 16) | ||
| .stroke( | ||
| colorSchemeContrast == .increased ? | ||
| Color.primary.opacity(0.8) : .primary.opacity(0.15), | ||
| lineWidth: colorSchemeContrast == .increased ? 2.0 : 0.5 | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| struct LiquidGlassSectionModifier: ViewModifier { | ||
| @Environment(\.colorScheme) var colorScheme | ||
| @Environment(\.accessibilityReduceTransparency) var reduceTransparency | ||
| @Environment(\.colorSchemeContrast) var colorSchemeContrast | ||
|
|
||
| func body(content: Content) -> some View { | ||
| content | ||
| .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 16)) | ||
| .shadow(color: .black.opacity(colorScheme == .dark ? 0.2 : 0.08), radius: 4, y: 2) | ||
| .overlay( | ||
| RoundedRectangle(cornerRadius: 16) | ||
| .stroke( | ||
| colorSchemeContrast == .increased ? | ||
| Color.primary.opacity(0.5) : .primary.opacity(0.12), | ||
| lineWidth: colorSchemeContrast == .increased ? 1.0 : 0.5 | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| struct LiquidGlassChartModifier: ViewModifier { | ||
| @Environment(\.colorScheme) var colorScheme | ||
| @Environment(\.accessibilityReduceTransparency) var reduceTransparency | ||
| @Environment(\.colorSchemeContrast) var colorSchemeContrast | ||
|
|
||
| func body(content: Content) -> some View { | ||
| content | ||
| .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16)) | ||
| .shadow(color: .black.opacity(colorScheme == .dark ? 0.25 : 0.1), radius: 8, y: 4) | ||
| .overlay( | ||
| RoundedRectangle(cornerRadius: 16) | ||
| .stroke( | ||
| colorSchemeContrast == .increased ? | ||
| Color.primary.opacity(0.6) : .primary.opacity(0.2), | ||
| lineWidth: colorSchemeContrast == .increased ? 1.0 : 0.5 | ||
| ) | ||
| ) | ||
| .padding(.horizontal) | ||
| } | ||
| } | ||
|
|
||
| extension View { | ||
| func liquidGlassCard() -> some View { | ||
| modifier(LiquidGlassCardModifier()) | ||
| } | ||
|
|
||
| func liquidGlassSection() -> some View { | ||
| modifier(LiquidGlassSectionModifier()) | ||
| } | ||
|
|
||
| func liquidGlassChart() -> some View { | ||
| modifier(LiquidGlassChartModifier()) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call!