Created
December 9, 2025 01:51
-
-
Save amosgyamfi/5f8554f2d477702788157eb2e5cd38bb to your computer and use it in GitHub Desktop.
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
| // | |
| // LiquidGlassEffectContainer.swift | |
| // | |
| import SwiftUI | |
| struct LiquidGlassEffectContainer: View { | |
| var body: some View { | |
| ZStack { | |
| Image("bgImg") | |
| .resizable() | |
| .scaledToFill() | |
| .ignoresSafeArea() | |
| GlassEffectContainer(spacing: 80) { | |
| PhaseAnimator([false, true]) { morph in | |
| HStack(spacing: morph ? 50.0 : -15.0) { | |
| Button { | |
| // | |
| } label: { | |
| Image(systemName: "scribble.variable") | |
| } | |
| .padding() | |
| .glassEffect(.clear) | |
| Button { | |
| // | |
| } label: { | |
| Image(systemName: "eraser.fill") | |
| } | |
| .padding() | |
| .glassEffect(.clear) | |
| } | |
| .tint(.green) | |
| .font(.system(size: 64.0)) | |
| } animation: { morph in | |
| //.bouncy(duration: 2, extraBounce: 0.5) | |
| //.easeOut(duration: 2) | |
| .easeInOut(duration: 2) | |
| //.timingCurve(0.68, -0.6, 0.32, 1.6, duration: 2) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| #Preview { | |
| LiquidGlassEffectContainer() | |
| .preferredColorScheme(.dark) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment