Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 2 KB

Examples.md

File metadata and controls

78 lines (65 loc) · 2 KB

Examples

Layered Liquid

struct ContentView: View {
    var body: some View {
        ZStack {
            Liquid()
                .frame(width: 240, height: 240)
                .foregroundColor(.blue)
                .opacity(0.3)


            Liquid()
                .frame(width: 220, height: 220)
                .foregroundColor(.blue)
                .opacity(0.6)

            Liquid(samples: 5)
                .frame(width: 200, height: 200)
                .foregroundColor(.blue)
            
            Text("Liquid").font(.largeTitle).foregroundColor(.white)
        }
    }
}

Profile Icon

struct ContentView: View {
    var body: some View {
        ZStack {
            Liquid()
                .frame(width: 220, height: 220)
                .foregroundColor(.yellow)
            Image("profile")
                .resizable()
                .scaledToFill()
                .frame(width: 200, height: 200)
                .mask(Liquid())
        }
    }
}

Text On Art

struct ContentView: View {
    var body: some View {
        ZStack {
            Liquid(samples: 3, period: 10.0)
                .frame(width: 400, height: 200)
                .foregroundColor(.yellow)
                .opacity(0.2)
                .blur(radius: 10)
            Image("pattern")
                .resizable()
                .scaledToFill()
                .frame(width: 280, height: 120)
                .mask(Liquid(samples: 3, period: 6.0))
                .shadow(radius: 40)
            Text("Hello, World!")
                .font(.largeTitle)
                .fontWeight(.bold)
        }
    }
}