Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created December 9, 2025 01:51
Show Gist options
  • Select an option

  • Save amosgyamfi/5f8554f2d477702788157eb2e5cd38bb to your computer and use it in GitHub Desktop.

Select an option

Save amosgyamfi/5f8554f2d477702788157eb2e5cd38bb to your computer and use it in GitHub Desktop.
//
// 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