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
struct AnimatedBarsGraph: View { | |
@State var arrayOfVal = [0.0,0.0,0.0,0.0,0.0,0.0,0.0] | |
@State var arrayOfRealVal = [100,250,170,100,130,120,130] | |
var body: some View { | |
HStack (alignment: .bottom){ | |
ForEach (0..<arrayOfVal.count, id: \.self) { index in | |
RoundedRectangle(cornerRadius: 25) | |
.fill(.blue.opacity(0.4)) | |
.frame(width: 36, height: arrayOfVal[index]) |
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
struct animatedView: View { | |
@State var opacity : CGFloat = 0.0 | |
@State var yPosition : CGFloat = 80.0 | |
var body: some View { | |
ZStack { | |
Text("HELLO WORLD!") | |
.font(.largeTitle).bold() | |
.foregroundColor(Color.teal) | |
.opacity(opacity) |
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
struct AnimationModifier : ViewModifier{ | |
let positionOffset : Double | |
let height = UIScreen.main.bounds.height | |
func body(content: Content) -> some View { | |
GeometryReader { geometry in | |
let position = geometry.frame(in: CoordinateSpace.global).midY | |
ZStack { | |
Color.clear | |
if height >= (position + positionOffset) { |
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
struct ContentView: View { | |
var body: some View { | |
ZStack { | |
Circle() | |
.fill(Color.blue) | |
.frame(width: 12, height: 12) | |
.modifier(ParticlesModifier()) | |
.offset(x: -100, y : -50) | |
Circle() |
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
struct ParticlesModifier: ViewModifier { | |
@State var time = 0.0 | |
@State var scale = 0.1 | |
let duration = 5.0 | |
func body(content: Content) -> some View { | |
ZStack { | |
ForEach(0..<80, id: \.self) { index in | |
content | |
.hueRotation(Angle(degrees: time * 80)) |
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
struct FireworkParticlesGeometryEffect : GeometryEffect { | |
var time : Double | |
var speed = Double.random(in: 20 ... 200) | |
var direction = Double.random(in: -Double.pi ... Double.pi) | |
var animatableData: Double { | |
get { time } | |
set { time = newValue } | |
} | |
func effectValue(size: CGSize) -> ProjectionTransform { |
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
struct FinalSignUpView: View { | |
@State var email = "" | |
@State var password = "" | |
@State var passwordAgain = "" | |
var body: some View { | |
if #available(iOS 15.0, *) { | |
VStack{ | |
Text("Sign up") | |
.font(.largeTitle) |
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
struct ConcaveGlassView: ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.overlay( | |
RoundedRectangle(cornerRadius: 14) | |
.stroke(.linearGradient(colors:[.black,.white.opacity(0.75)], startPoint: .top, endPoint: .bottom), lineWidth: 2) |
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
struct ConcaveGlassViewWithOverlay: ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.overlay( | |
LinearGradient(colors: [.black.opacity(0.2), .clear], startPoint: .top, endPoint: .bottom)) | |
.cornerRadius(14) |
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
struct ConvexGlassView: ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.cornerRadius(14) | |
.shadow(color: .white.opacity(0.65), radius: 1, x: -1, y: -2) | |
.shadow(color: .black.opacity(0.65), radius: 2, x: 2, y: 2) |