Unify full-screen glass background and increase card depth

This commit is contained in:
Rafal Kolarz 2026-10-23 01:44:56 +01:00
parent 6b19d78f53
commit 02336c04b8
8 changed files with 79 additions and 18 deletions

View File

@ -292,7 +292,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = Kasztelan/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.food-and-drink";
@ -316,7 +316,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = Kasztelan/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.food-and-drink";

View File

@ -92,11 +92,12 @@ struct CardView: View {
GlassDepthDeck {
loyaltyCardFace(compact: compact)
}
.scaleEffect(1.01)
.rotation3DEffect(
.degrees(-2.8),
axis: (x: 1, y: 0, z: 0),
.degrees(-6),
axis: (x: 1, y: -0.10, z: 0),
anchor: .center,
perspective: 0.62
perspective: 0.72
)
}
@ -198,7 +199,14 @@ struct CardView: View {
.clipShape(RoundedRectangle(cornerRadius: 26, style: .continuous))
.overlay {
RoundedRectangle(cornerRadius: 26, style: .continuous)
.stroke(.white.opacity(0.32), lineWidth: 1)
.stroke(
LinearGradient(
colors: [.white.opacity(0.72), .white.opacity(0.18), KTheme.pink.opacity(0.38)],
startPoint: .topLeading,
endPoint: .bottomTrailing
),
lineWidth: 1.5
)
}
.shadow(color: KTheme.pink.opacity(0.28), radius: 28, y: 16)
}

View File

@ -1,4 +1,5 @@
import SwiftUI
import UIKit
import UserNotifications
import BackgroundTasks
import CoreSpotlight
@ -119,6 +120,21 @@ struct KasztelanApp: App {
@StateObject private var model = AppModel()
@Environment(\.scenePhase) private var scenePhase
init() {
let navigationAppearance = UINavigationBarAppearance()
navigationAppearance.configureWithTransparentBackground()
navigationAppearance.backgroundColor = .clear
navigationAppearance.backgroundEffect = nil
navigationAppearance.shadowColor = .clear
let navigationBar = UINavigationBar.appearance()
navigationBar.standardAppearance = navigationAppearance
navigationBar.scrollEdgeAppearance = navigationAppearance
navigationBar.compactAppearance = navigationAppearance
navigationBar.isTranslucent = true
navigationBar.backgroundColor = .clear
}
var body: some Scene {
WindowGroup {
RootView()

View File

@ -8,16 +8,31 @@ struct MainTabView: View {
AmbientBackground()
TabView(selection: $model.selectedTab) {
NavigationStack { WalletView() }
NavigationStack {
ZStack {
AmbientBackground()
WalletView()
}
}
.toolbarBackground(.hidden, for: .navigationBar)
.tabItem { Label(model.text("Karta", "Card"), systemImage: "creditcard.fill") }
.tag(0)
NavigationStack { MessagesView() }
NavigationStack {
ZStack {
AmbientBackground()
MessagesView()
}
}
.toolbarBackground(.hidden, for: .navigationBar)
.tabItem { Label(model.text("Wiadomości", "Messages"), systemImage: "envelope.fill") }
.badge(model.messages.count)
.tag(1)
NavigationStack { ProfileView() }
NavigationStack {
ZStack {
AmbientBackground()
ProfileView()
}
}
.toolbarBackground(.hidden, for: .navigationBar)
.tabItem { Label(model.text("Profil", "Profile"), systemImage: "person.crop.circle.fill") }
.tag(2)

View File

@ -27,7 +27,7 @@ struct MessagesView: View {
}
.padding(20)
}
.background(AmbientBackground())
.background(.clear)
.toolbar { AppToolbar() }
.toolbarBackground(.hidden, for: .navigationBar)
.refreshable { await model.refresh() }

View File

@ -51,7 +51,7 @@ struct ProfileView: View {
}
.padding(20)
}
.background(AmbientBackground())
.background(.clear)
.toolbar { AppToolbar() }
.toolbarBackground(.hidden, for: .navigationBar)
.fullScreenCover(isPresented: $editingProfile) { EditProfileView() }

View File

@ -70,6 +70,17 @@ struct GlassDepthDeck<Content: View>: View {
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
.fill(.ultraThinMaterial)
.overlay {
RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
.stroke(KTheme.cyan.opacity(0.22), lineWidth: 1)
}
.scaleEffect(x: 0.80, y: 0.91)
.offset(y: 38)
.blur(radius: 2)
.opacity(0.42)
RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
.fill(.ultraThinMaterial)
.overlay {
@ -77,7 +88,7 @@ struct GlassDepthDeck<Content: View>: View {
.stroke(KTheme.purple.opacity(0.34), lineWidth: 1)
}
.scaleEffect(x: 0.88, y: 0.95)
.offset(y: 24)
.offset(y: 27)
.blur(radius: 1.2)
.opacity(0.62)
@ -88,14 +99,25 @@ struct GlassDepthDeck<Content: View>: View {
.stroke(KTheme.pink.opacity(0.32), lineWidth: 1)
}
.scaleEffect(x: 0.95, y: 0.98)
.offset(y: 13)
.offset(y: 15)
.opacity(0.80)
content
.shadow(color: .black.opacity(0.48), radius: 34, y: 22)
.shadow(color: KTheme.pink.opacity(0.26), radius: 22, y: 8)
.shadow(color: .black.opacity(0.58), radius: 38, y: 26)
.shadow(color: KTheme.pink.opacity(0.34), radius: 26, y: 10)
RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
.stroke(
LinearGradient(
colors: [.white.opacity(0.62), .clear, KTheme.purple.opacity(0.42)],
startPoint: .topLeading,
endPoint: .bottomTrailing
),
lineWidth: 1.3
)
.allowsHitTesting(false)
}
.padding(.bottom, 24)
.padding(.bottom, 38)
}
}

View File

@ -33,7 +33,6 @@ struct WalletView: View {
private var walletCarousel: some View {
GeometryReader { geometry in
ZStack {
AmbientBackground()
WalletMotionBubbles(progress: carouselProgress(width: geometry.size.width))
AnyView(currentPage)
@ -327,7 +326,8 @@ private struct DiscountCardView: View {
.stroke(.white.opacity(0.28), lineWidth: 1)
}
}
.rotation3DEffect(.degrees(-2.8), axis: (x: 1, y: 0, z: 0), perspective: 0.62)
.scaleEffect(1.01)
.rotation3DEffect(.degrees(-6), axis: (x: 1, y: -0.10, z: 0), perspective: 0.72)
Text(model.text("Dostępna offline • zaszyfrowana synchronizacja", "Available offline • encrypted sync"))
.font(.footnote)