Skip to content

Commit

Permalink
components and visual-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed Jul 7, 2021
1 parent 61b173c commit 662ea1d
Showing 1 changed file with 105 additions and 31 deletions.
136 changes: 105 additions & 31 deletions DesignCode/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,34 @@ import SwiftUI
struct ContentView: View {
var body: some View {
ZStack {
TitleView()
.blur(radius: 20)

VStack {
Spacer()
}
.frame(width: 300, height: 220, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
.background(Color.blue)
.cornerRadius(20)
.shadow(radius: 20)
.offset(x: 0, y: -20)
BackCardView()
.background(Color("card4"))
.cornerRadius(20)
.shadow(radius: 20)
.offset(x: 0, y: -40)
.scaleEffect(0.9)
.rotationEffect(Angle(degrees: 10))
.rotation3DEffect(Angle(degrees: 10), axis: (x: 10.0, y: 0, z: 0))
.blendMode(.hardLight)

BackCardView()
.background(Color("card3"))
.cornerRadius(20)
.shadow(radius: 20)
.offset(x: 0, y: -20)
.scaleEffect(0.95)
.rotationEffect(Angle(degrees: 5))
.rotation3DEffect(Angle(degrees: 5), axis: (x: 10.0, y: 0, z: 0))
.blendMode(.hardLight)
CardView()
.blendMode(.hardLight)

BottomCardView()
.blur(radius: 20)

VStack {
HStack {
VStack(alignment: .leading) {
Text("UI Design")
.font(.title)
.fontWeight(.semibold)
.foregroundColor(.white)
Text("cert")
.foregroundColor(Color("accent"))
}
Spacer()
Image("Logo1")
}
.padding(.horizontal, 20)
.padding(.top, 20)
Spacer()
Image("Card1").resizable().aspectRatio(contentMode: .fill)
.frame(width: 300, height: 110, alignment: .top)
}
.frame(width: 340.0, height: 220.0)
.background(Color.black)
.cornerRadius(20)
.shadow(radius: 20)
}
}
}
Expand All @@ -55,3 +50,82 @@ struct ContentView_Previews: PreviewProvider {
}
}
}

struct CardView: View {
var body: some View {
VStack {
HStack {
VStack(alignment: .leading) {
Text("UI Design")
.font(.title)
.fontWeight(.semibold)
.foregroundColor(.white)
Text("Certification")
.foregroundColor(Color("accent"))
}
Spacer()
Image("Logo1")
}
.padding(.horizontal, 20)
.padding(.top, 20)
Spacer()
Image("Card1").resizable().aspectRatio(contentMode: .fill)
.frame(width: 300, height: 110, alignment: .top)
}
.frame(width: 340.0, height: 220.0)
.background(Color.black)
.cornerRadius(20)
.shadow(radius: 20)
}
}

struct BackCardView: View {
var body: some View {
VStack {
Spacer()
}
.frame(width: 340, height: 220, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)


}
}

struct TitleView: View {
var body: some View {
VStack {
HStack {
Text("Certifications")
.font(.largeTitle)
.fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
Spacer()
}
.padding()
Image("Background1")
Spacer()
}
}
}

struct BottomCardView: View {
var body: some View {
VStack(spacing: 20) {
Rectangle()
.frame(width: 40, height: 5, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
.cornerRadius(/*@START_MENU_TOKEN@*/3.0/*@END_MENU_TOKEN@*/)
.opacity(0.1)
Text("Bacon ipsum dolor amet shankle biltong chislic ball tip beef kielbasa, cupim buffalo beef ribs ham rump. Bresaola picanha sausage, pork fatback beef ribs shankle.")
.multilineTextAlignment(.center)
.font(.subheadline)
.lineSpacing(4)

Spacer()
}
.padding(.top, 8)
.padding(.horizontal, 20)
.frame(maxWidth: .infinity)
.background(Color.white)
.cornerRadius(30)
.shadow(radius: 20)
.offset(x: 0, y: 500)
}
}

0 comments on commit 662ea1d

Please sign in to comment.