chore: 完成部分svg资源替换

This commit is contained in:
Junhui Chen 2025-09-10 18:57:41 +08:00
parent b036f3d18e
commit 17dc5bbe5e
8 changed files with 124 additions and 53 deletions

File diff suppressed because one or more lines are too long

View File

@ -315,8 +315,9 @@ struct BlindBoxView: View {
HStack {
//
Button(action: showUserProfile) {
SVGImage(svgName: "User")
.frame(width: 24, height: 24)
Image(systemName: "line.3.horizontal")
.font(.system(size: 20, weight: .regular))
.foregroundColor(.primary)
.padding(13) // Increases tap area while keeping visual size
.contentShape(Rectangle()) // Makes the padded area tappable
}
@ -392,15 +393,7 @@ struct BlindBoxView: View {
.animation(.easeOut(duration: 1.5), value: showScalingOverlay)
}
if mediaType == .all && !showScalingOverlay {
ZStack {
SVGImage(svgName: "BlindCount")
.frame(width: 100, height: 60)
Text("\(viewModel.blindCount?.availableQuantity ?? 0) Boxes")
.font(Typography.font(for: .body, family: .quicksandBold))
.foregroundColor(.white)
.offset(x: 6, y: -18)
}
BlindCountBadge(text: "\(viewModel.blindCount?.availableQuantity ?? 0) Boxes")
.position(x: UIScreen.main.bounds.width * 0.7,
y: UIScreen.main.bounds.height * 0.18)
.opacity(showScalingOverlay ? 0 : 1)
@ -655,6 +648,24 @@ struct BlindBoxView: View {
}
}
// MARK: - SwiftUI
private struct BlindCountBadge: View {
let text: String
var body: some View {
Text(text)
.font(Typography.font(for: .body, family: .quicksandBold))
.foregroundColor(.white)
.padding(.horizontal, 12)
.padding(.vertical, 8)
.background(
Capsule()
.fill(Color.black)
.shadow(color: Color.black.opacity(0.15), radius: 4, x: 0, y: 2)
)
}
}
///
private func hideSettings() {
withAnimation(.spring(response: 0.6, dampingFraction: 0.8)) {

View File

@ -93,8 +93,9 @@ struct AvatarUploader: View {
Color.gray.opacity(0.1)
.frame(width: size, height: size)
.overlay(
SVGImage(svgName: "Avatar")
.frame(width: size * 0.8, height: size * 0.8)
Image(systemName: "person.crop.circle")
.font(.system(size: size * 0.5))
.foregroundColor(.gray)
)
.clipShape(RoundedRectangle(cornerRadius: size * 0.1))
.overlay(

View File

@ -157,9 +157,9 @@ struct UserProfileModal: View {
Router.shared.navigate(to: .mediaUpload)
}) {
HStack(spacing: 16) {
SVGImage(svgName: "Upload")
Image(systemName: "tray.and.arrow.up")
.font(.system(size: 20, weight: .regular))
.foregroundColor(.orange)
.frame(width: 20, height: 20)
Text("Upload Resources")
.font(Typography.font(for: .body))
@ -179,9 +179,9 @@ struct UserProfileModal: View {
Router.shared.navigate(to: .memories)
}) {
HStack(spacing: 16) {
SVGImage(svgName: "Memory")
Image(systemName: "photo.on.rectangle")
.font(.system(size: 20, weight: .regular))
.foregroundColor(.orange)
.frame(width: 20, height: 20)
Text("My Memories")
.font(Typography.font(for: .body))
@ -225,9 +225,9 @@ struct UserProfileModal: View {
}
}) {
HStack(spacing: 16) {
SVGImage(svgName: "Set")
Image(systemName: "gearshape")
.font(.system(size: 20, weight: .regular))
.foregroundColor(.orange)
.frame(width: 20, height: 20)
Text("Setting")
.font(Typography.font(for: .body))

View File

@ -125,8 +125,9 @@ struct MediaUploadView: View {
///
private var uploadHintView: some View {
HStack (spacing: 6) {
SVGImage(svgName: "Tips")
.frame(width: 16, height: 16)
Image(systemName: "lightbulb")
.font(.system(size: 16, weight: .regular))
.foregroundColor(.themeTextMessageMain)
.padding(.leading,6)
Text("The upload process will take approximately 2 minutes. Thank you for your patience.")
.font(.caption)
@ -601,9 +602,11 @@ struct UploadPromptView: View {
var body: some View {
Button(action: { showMediaPicker = true }) {
//
SVGImageHtml(svgName: "IP")
ZStack {
RoundedRectangle(cornerRadius: 20)
.fill(Color.white)
.frame(width: 225, height: 225)
}
.contentShape(Rectangle())
.overlay(
ZStack {

View File

@ -85,8 +85,9 @@ struct UserInfo: View {
.zIndex(1) //
// Dynamic text that changes based on keyboard state
HStack(spacing: 6) {
SVGImage(svgName: "Tips")
.frame(width: 16, height: 16)
Image(systemName: "lightbulb")
.font(.system(size: 16, weight: .regular))
.foregroundColor(.themeTextMessageMain)
.padding(.leading,6)
Text("Choose a photo as your avatar, and we'll generate a video mystery box for you.")
.font(Typography.font(for: .caption))

View File

@ -109,7 +109,9 @@ struct SettingsView: View {
Button(action: action) {
HStack {
//
SVGImage(svgName: icon)
Image(systemName: systemSymbol(for: icon))
.font(.system(size: 18, weight: .regular))
.foregroundColor(.primary)
.frame(width: 22, height: 22)
//
@ -130,9 +132,26 @@ struct SettingsView: View {
.listRowBackground(Color.white)
.listRowSeparator(.hidden)
}
// SVG
private func systemSymbol(for icon: String) -> String {
switch icon {
case "Account":
return "person.circle"
case "Permission":
return "lock.rectangle"
case "Suport":
return "headphones"
case "AboutUs":
return "info.circle"
default:
return "questionmark.circle"
}
}
}
// MARK: -
#Preview {
SettingsView(isPresented: .constant(true))
}

View File

@ -63,8 +63,8 @@ struct SubscriptionStatusBar: View {
var body: some View {
ZStack(alignment: .leading) {
// Background SVG - First layer
SVGImage(svgName: status.backgroundImageName)
// SwiftUI
SubscriptionBackground(status: status)
.frame(maxWidth: .infinity, minHeight: 120)
.clipped()
@ -107,6 +107,42 @@ struct SubscriptionStatusBar: View {
}
}
// MARK: -
private struct SubscriptionBackground: View {
let status: SubscriptionStatus
var body: some View {
ZStack(alignment: .topTrailing) {
RoundedRectangle(cornerRadius: 20)
.fill(background)
.shadow(color: Color.black.opacity(0.06), radius: 10, x: 0, y: 6)
//
if case .pioneer = status {
Circle()
.fill(Color.black.opacity(0.08))
.frame(width: 90, height: 90)
.offset(x: 12, y: -12)
} else {
Circle()
.fill(Color.black.opacity(0.04))
.frame(width: 70, height: 70)
.offset(x: 12, y: -12)
}
}
.clipShape(RoundedRectangle(cornerRadius: 20))
}
private var background: some ShapeStyle {
switch status {
case .free:
return LinearGradient(colors: [Color.white, Color.white.opacity(0.96)], startPoint: .topLeading, endPoint: .bottomTrailing)
case .pioneer:
return LinearGradient(colors: [Color.themePrimary.opacity(0.85), Color.orange.opacity(0.6)], startPoint: .topLeading, endPoint: .bottomTrailing)
}
}
}
// MARK: -
#Preview {
VStack(spacing: 20) {