// // Styles.swift // XuXuCheck // // Created by henseycai on 2025/6/11. // import SwiftUI struct MyStrokeStyle: ViewModifier { var cornerRadius: CGFloat @Environment(\.colorScheme) var colorScheme func body(content: Content) -> some View { content .overlay( RoundedRectangle( cornerRadius: cornerRadius, style: .continuous ) .stroke( .linearGradient( colors: [ .white.opacity(colorScheme == .dark ? 0.3 : 0.3), .black.opacity(colorScheme == .dark ? 0.3 : 0.1) ], startPoint: .top, endPoint: .bottom ) ) .blendMode(.overlay) ) } } extension View { func strokeStyle(cornerRadius: CGFloat = 30) -> some View { modifier(MyStrokeStyle(cornerRadius: cornerRadius)) } }