|
import SwiftUI |
|
|
|
struct DepthButton: View { |
|
var body: some View { |
|
GeometryReader { geometry in |
|
let size = min(geometry.size.width, geometry.size.height) |
|
|
|
VStack { |
|
ZStack { |
|
// Outer circle |
|
Circle() |
|
.fill( |
|
LinearGradient( |
|
gradient: Gradient(stops: [ |
|
.init(color: .black, location: 0.1), |
|
.init(color: .black.opacity(0.8), location: 0.5), |
|
.init(color: .white, location: 1) |
|
]), |
|
startPoint: .top, |
|
endPoint: .bottom |
|
) |
|
) |
|
.frame(width: size, height: size) |
|
|
|
// Middle circle |
|
Circle() |
|
.fill( |
|
LinearGradient( |
|
gradient: Gradient(stops: [ |
|
.init(color: .white, location: 0.02), |
|
.init(color: .black.opacity(0), location: 0.5), |
|
.init(color: .white, location: 0.9) |
|
]), |
|
startPoint: .top, |
|
endPoint: .bottom |
|
) |
|
) |
|
.frame(width: size * 0.965, height: size * 0.965) |
|
|
|
// Inner circle |
|
Circle() |
|
.fill( |
|
LinearGradient( |
|
gradient: Gradient(colors: [ |
|
Color(hex: "#c1c1c1"), Color(hex: "#818181") |
|
]), |
|
startPoint: .top, |
|
endPoint: .bottom |
|
) |
|
) |
|
.frame(width: size * 0.88, height: size * 0.88) |
|
|
|
// Shadow arrow |
|
Image(systemName: "arrow.up") |
|
.font(.system(size: size * 0.5, weight: .bold)) |
|
.foregroundColor(.black.opacity(0.5)) |
|
.offset(y: -size * 0.01) // Relative offset |
|
|
|
// Front arrow |
|
Image(systemName: "arrow.up") |
|
.font(.system(size: size * 0.5, weight: .bold)) |
|
.foregroundColor(Color(hex: "#efefef")) |
|
} |
|
.shadow(color: .black.opacity(0.2), radius: size * 0.09, x: 0, y: size * 0.05) |
|
.frame(maxWidth: .infinity, maxHeight: .infinity) |
|
.aspectRatio(1, contentMode: .fit) |
|
} |
|
} |
|
} |
|
} |
|
|
|
#Preview { |
|
DepthButton() |
|
} |