Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Created July 12, 2020 13:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anupamchugh/8c7c09848a2964016df11011eeb55da0 to your computer and use it in GitHub Desktop.
Save anupamchugh/8c7c09848a2964016df11011eeb55da0 to your computer and use it in GitHub Desktop.
struct ContentView: View {
@State var text : String = ""
@State var password : String = ""
var body: some View {
ZStack{
Color(red: 240/255, green: 240/255, blue: 243/255)
GroupBox(label: Label("Enter Your Details", systemImage: "sun.min")
.font(.subheadline), content: {
VStack{
TextField("Username", text: $text)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding(.all, 5)
SecureField("Password", text: $password)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding(.all, 5)
Button(action: {}) {
Image(systemName: "chevron.right")
.renderingMode(.template)
.foregroundColor(.black)
.frame(width: 30, height: 30)
.padding(10)
.background(Color(red: 240/255, green: 240/255, blue: 243/255))
.cornerRadius(10)
}
.shadow(color: Color.white, radius: 10, x: -10, y: -10)
.shadow(color: Color(red: 174/255, green: 174/255, blue: 192/255).opacity(0.4), radius: 10, x: 10, y: 10)
}
})
.cornerRadius(10)
.shadow(color: Color.white, radius: 10, x: -10, y: -10)
.shadow(color: Color(red: 174/255, green: 174/255, blue: 192/255).opacity(0.4), radius: 10, x: 10, y: 10)
.padding()
}
.edgesIgnoringSafeArea(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity,maxHeight: .infinity)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment