Skip to content

Instantly share code, notes, and snippets.

@shanecowherd
Created March 22, 2023 04:37
Show Gist options
  • Save shanecowherd/cdf5baa2f8e57b6b5887af6d33a7fcf3 to your computer and use it in GitHub Desktop.
Save shanecowherd/cdf5baa2f8e57b6b5887af6d33a7fcf3 to your computer and use it in GitHub Desktop.
JerryButton.swift
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Button")
.font(.system(size: 20, weight: .semibold, design: .rounded))
.frame(width: 200, height: 60)
.background(
ZStack {
Color(#colorLiteral(red: 0.7608050108, green: 0.8164883852, blue: 0.9259157777, alpha: 1))
RoundedRectangle(cornerRadius: 16, style: .continuous)
.foregroundColor(.white)
.blur(radius: 4)
.offset(x: -8, y: -8)
RoundedRectangle(cornerRadius: 16, style: .continuous)
.fill(
LinearGradient(gradient: Gradient(colors: [Color(#colorLiteral(red: 0.9019607843, green: 0.9294117647, blue: 0.9882352941, alpha: 1)), Color.white]), startPoint: .topLeading, endPoint: .bottomTrailing)
)
.padding(2)
.blur(radius: 2)
}
)
.clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous))
.shadow(color: Color(#colorLiteral(red: 0.7608050108, green: 0.8164883852, blue: 0.9259157777, alpha: 1)), radius: 20, x: 20, y: 20)
.shadow(color: Color(#colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)), radius: 20, x: -20, y: -20)
}
.padding()
}
}
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