Created
July 21, 2023 20:48
-
-
Save amosgyamfi/d932a16bf92c682fb6a48a07a7608b2a 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
// | |
// IsCallingView.swift | |
// Face2FaceUpdated | |
// | |
import SwiftUI | |
struct IsCallingView: View { | |
var body: some View { | |
ZStack { | |
// Outer circle | |
Circle() | |
.fill(.blue.gradient) | |
.frame(width: 172, height: 172) | |
.opacity(0.2) | |
.phaseAnimator([false, true]) { content, phase in | |
content | |
.scaleEffect(phase ? 0.8 : 1.2) | |
} animation: { phase in | |
.easeOut(duration: 1) | |
} | |
// Middle circle | |
Circle() | |
.fill(.blue.gradient) | |
.frame(width: 172, height: 172) | |
.opacity(0.5) | |
.phaseAnimator([false, true]) { content, phase in | |
content | |
.scaleEffect(phase ? 0.7 : 1.1) | |
} animation: { phase in | |
.easeIn(duration: 1) | |
} | |
// Inner circle | |
Circle() | |
.fill(.blue.gradient) | |
.frame(width: 172, height: 172) | |
.opacity(0.3) | |
.phaseAnimator([false, true]) { content, phase in | |
content | |
.scaleEffect(phase ? 0.5 : 1.2) | |
} animation: { phase in | |
.easeInOut(duration: 1) | |
} | |
HStack(alignment: .bottom, spacing: 0) { | |
Text("Calling") | |
Image(systemName: "ellipsis") | |
.font(.title) | |
.bold() | |
.symbolEffect( | |
.variableColor | |
.iterative.dimInactiveLayers.nonReversing | |
) | |
} | |
} | |
.blendMode(.hardLight) | |
} | |
} | |
#Preview { | |
IsCallingView() | |
.preferredColorScheme(.dark) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment