diff --git a/jengyoon/Starbuck/Starbuck.xcodeproj/project.pbxproj b/jengyoon/Starbuck/Starbuck.xcodeproj/project.pbxproj index 59b8dfd..403b711 100644 --- a/jengyoon/Starbuck/Starbuck.xcodeproj/project.pbxproj +++ b/jengyoon/Starbuck/Starbuck.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ C87EE176AD207D08A51D8E1C /* Pretendard-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = 6F9415C82BD901C6AA812805 /* Pretendard-Thin.otf */; }; D137A0CE8238989E873328EF /* Pretendard-ExtraBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = D2E6CFDB2FE55DB301BB7E93 /* Pretendard-ExtraBold.otf */; }; F9B59708E65FFDC479FA292D /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1C05EE3A01621AA71D5A3474 /* Pretendard-SemiBold.otf */; }; + FF01BE6B2DF17ED000ACC3A5 /* ViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF01BE6A2DF17ED000ACC3A5 /* ViewExtension.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -85,9 +86,11 @@ F8D54BB8F383F5345CEFC4FB /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = ""; }; F971E5B6815CB1BE429AAFDA /* CustomColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = CustomColor.xcassets; sourceTree = ""; }; FB5860E6E14B3D180E9A7ABF /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + FF01BE6A2DF17ED000ACC3A5 /* ViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtension.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ + FF01BE6C2DF1807200ACC3A5 /* Util */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Util; sourceTree = ""; }; FF6F74DB2D9DAC70003079EE /* Home */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Home; sourceTree = ""; }; FF6F75002D9E551F003079EE /* Home */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Home; sourceTree = ""; }; FF6F75012D9E5529003079EE /* Login */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Login; sourceTree = ""; }; @@ -159,6 +162,7 @@ 3A2543C67DA0A3DAC99340AA /* Sources */ = { isa = PBXGroup; children = ( + FF01BE6C2DF1807200ACC3A5 /* Util */, FF89C1842DA78559002BEBA9 /* Navigation */, FF96846D2D932655009914B3 /* Components */, BB0F89AD98F7C1411A6B3723 /* Extentions */, @@ -268,6 +272,7 @@ isa = PBXGroup; children = ( CB20D40FB907E27B8DCFD96D /* ColorExtension.swift */, + FF01BE6A2DF17ED000ACC3A5 /* ViewExtension.swift */, ); path = Extentions; sourceTree = ""; @@ -328,6 +333,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( + FF01BE6C2DF1807200ACC3A5 /* Util */, FF6F74DB2D9DAC70003079EE /* Home */, FF6F75002D9E551F003079EE /* Home */, FF6F75012D9E5529003079EE /* Login */, @@ -447,6 +453,7 @@ 14609285C515C9B7AC7511FF /* TuistFonts+Starbuck.swift in Sources */, 9F4761109412ED75AEFC6F93 /* ColorExtension.swift in Sources */, 7840DC737DE4A9321BFA6B04 /* FontManager.swift in Sources */, + FF01BE6B2DF17ED000ACC3A5 /* ViewExtension.swift in Sources */, B2EECE92459A9FE846F262F6 /* StarbuckApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x.png new file mode 100644 index 0000000..d8204d3 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png new file mode 100644 index 0000000..d8204d3 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@3x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@3x.png new file mode 100644 index 0000000..3b1f583 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20@3x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png new file mode 100644 index 0000000..8ad1c30 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png new file mode 100644 index 0000000..2a77f1a Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x.png new file mode 100644 index 0000000..248a9d4 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png new file mode 100644 index 0000000..248a9d4 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@3x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@3x.png new file mode 100644 index 0000000..64bf00e Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29@3x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png new file mode 100644 index 0000000..2a77f1a Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x.png new file mode 100644 index 0000000..2ff486b Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png new file mode 100644 index 0000000..2ff486b Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@3x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@3x.png new file mode 100644 index 0000000..3e9ae2f Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40@3x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png new file mode 100644 index 0000000..d8204d3 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png new file mode 100644 index 0000000..3e9ae2f Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png new file mode 100644 index 0000000..0367ed8 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png new file mode 100644 index 0000000..f3334bb Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@2x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@2x.png new file mode 100644 index 0000000..3e9ae2f Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@2x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png new file mode 100644 index 0000000..515ab25 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@3x.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@3x.png new file mode 100644 index 0000000..0367ed8 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon@3x.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png new file mode 100644 index 0000000..6dd38b7 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png new file mode 100644 index 0000000..6c3e342 Binary files /dev/null and b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png differ diff --git a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json index 9221b9b..bd04914 100644 --- a/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/jengyoon/Starbuck/Starbuck/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,134 @@ { - "images" : [ + "images": [ { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" + "filename": "AppIcon@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "60x60" }, { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" + "filename": "AppIcon@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "60x60" }, { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" + "filename": "AppIcon~ipad.png", + "idiom": "ipad", + "scale": "1x", + "size": "76x76" }, { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" + "filename": "AppIcon@2x~ipad.png", + "idiom": "ipad", + "scale": "2x", + "size": "76x76" }, { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" + "filename": "AppIcon-83.5@2x~ipad.png", + "idiom": "ipad", + "scale": "2x", + "size": "83.5x83.5" }, { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" + "filename": "AppIcon-40@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "40x40" }, { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" + "filename": "AppIcon-40@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "40x40" }, { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" + "filename": "AppIcon-40~ipad.png", + "idiom": "ipad", + "scale": "1x", + "size": "40x40" }, { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" + "filename": "AppIcon-40@2x~ipad.png", + "idiom": "ipad", + "scale": "2x", + "size": "40x40" }, { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" + "filename": "AppIcon-20@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "20x20" }, { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" + "filename": "AppIcon-20@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "20x20" }, { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" + "filename": "AppIcon-20~ipad.png", + "idiom": "ipad", + "scale": "1x", + "size": "20x20" }, { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" + "filename": "AppIcon-20@2x~ipad.png", + "idiom": "ipad", + "scale": "2x", + "size": "20x20" }, { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" + "filename": "AppIcon-29.png", + "idiom": "iphone", + "scale": "1x", + "size": "29x29" }, { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" + "filename": "AppIcon-29@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "29x29" }, { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" + "filename": "AppIcon-29@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "29x29" }, { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" + "filename": "AppIcon-29~ipad.png", + "idiom": "ipad", + "scale": "1x", + "size": "29x29" }, { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" + "filename": "AppIcon-29@2x~ipad.png", + "idiom": "ipad", + "scale": "2x", + "size": "29x29" + }, + { + "filename": "AppIcon-60@2x~car.png", + "idiom": "car", + "scale": "2x", + "size": "60x60" + }, + { + "filename": "AppIcon-60@3x~car.png", + "idiom": "car", + "scale": "3x", + "size": "60x60" + }, + { + "filename": "AppIcon~ios-marketing.png", + "idiom": "ios-marketing", + "scale": "1x", + "size": "1024x1024" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "iconkitchen", + "version": 1 } -} +} \ No newline at end of file diff --git a/jengyoon/Starbuck/Starbuck/Sources/Extentions/ViewExtension.swift b/jengyoon/Starbuck/Starbuck/Sources/Extentions/ViewExtension.swift new file mode 100644 index 0000000..7807ddf --- /dev/null +++ b/jengyoon/Starbuck/Starbuck/Sources/Extentions/ViewExtension.swift @@ -0,0 +1,18 @@ +// +// ViewExtension.swift +// Starbuck +// +// Created by 송승윤 on 6/5/25. +// + +import Foundation +import SwiftUI + +extension View { + func getScreenSize() -> CGSize { + guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { + return .zero + } + return windowScene.screen.bounds.size + } +} diff --git a/jengyoon/Starbuck/Starbuck/Sources/Util/OffsetModifer.swift b/jengyoon/Starbuck/Starbuck/Sources/Util/OffsetModifer.swift new file mode 100644 index 0000000..b21ad57 --- /dev/null +++ b/jengyoon/Starbuck/Starbuck/Sources/Util/OffsetModifer.swift @@ -0,0 +1,42 @@ +// +// OffsetModifer.swift +// Starbuck +// +// Created by 송승윤 on 6/5/25. +// + +import Foundation +import SwiftUI + +/// 헤더 실시간 위치 추적 +struct OffsetModifer: ViewModifier { + @Binding var offset: CGFloat + + var returnromStart: Bool = true + @State var startValue: CGFloat = 0 + + func body(content: Content) -> some View { + content + .overlay(content: { + GeometryReader(content: { proxy in + Color.clear + .preference(key: OffsetKey.self, value: proxy.frame(in: .named("SCROLL")).minY) + .onPreferenceChange(OffsetKey.self) { value in + if startValue == 0 { + startValue = value + } + + offset = (value - (returnromStart ? startValue : 0)) + } + }) + }) + } +} + +struct OffsetKey: PreferenceKey { + static var defaultValue: CGFloat = 0 + + static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { + value = nextValue() + } +} diff --git a/jengyoon/Starbuck/Starbuck/Sources/Views/Shop/ShopView.swift b/jengyoon/Starbuck/Starbuck/Sources/Views/Shop/ShopView.swift index 571930a..6a299f8 100644 --- a/jengyoon/Starbuck/Starbuck/Sources/Views/Shop/ShopView.swift +++ b/jengyoon/Starbuck/Starbuck/Sources/Views/Shop/ShopView.swift @@ -11,6 +11,11 @@ import SwiftUI struct ShopView: View { // MARK: - Properties + /// 헤더 좌표 (좌표가아닌 튜플이다) + /// - let tuple: (CGFloat, CGFloat) = (10,20) + /// - print(tuple.0) : 10, print(tuple.1) : 20 + @State var headerOffsets: (CGFloat, CGFloat) = (0,0) + /// 상품 데이터를 관리하는 뷰모델 @StateObject private var viewModel = ShopViewModel() /// Best Items 섹션의 현재 페이지 상태를 추적 @@ -18,15 +23,68 @@ struct ShopView: View { // MARK: - Body var body: some View { - ScrollView { + ScrollView(.vertical) { VStack(spacing: 30) { - bannerSection // 상단 배너 섹션 - allProductsSection // 전체 상품 카테고리 섹션 - bestItemsSection // 베스트 상품 섹션 - newProductsSection // 신규 상품 섹션 + headerView + + LazyVStack(alignment: .leading, spacing: 33, pinnedViews: [.sectionHeaders], content: { + Section(content: { + bannerSection // 상단 배너 섹션 + allProductsSection // 전체 상품 카테고리 섹션 + bestItemsSection // 베스트 상품 섹션 + newProductsSection // 신규 상품 섹션 + }, header: { + pinnedHeaderView() + .modifier(OffsetModifer(offset: $headerOffsets.0, returnromStart: false)) + .modifier(OffsetModifer(offset: $headerOffsets.1)) + }) + }) + .contentMargins(.top, 20) + + } + } + .ignoresSafeArea() + .coordinateSpace(name: "SCROLL") + .background(Color.white01) + } + // MARK: - HeaderView + /// 상단공간 처리할 뷰 + @ViewBuilder + private var headerView: some View { + GeometryReader { proxy in + let minY = proxy.frame(in: .named("SCROLL")).minY + let size = proxy.size + let height = max(0, size.height + minY) + + Rectangle() + .fill(Color.white01) + .frame(width: size.width, height: height, alignment: .top) + .offset(y: -minY) + } + .frame(height: 10) + } + + /// 고정된 헤더뷰 + @ViewBuilder + private func pinnedHeaderView() -> some View { + + let threshold = -(getScreenSize().height * 0.05) + + HStack { + if headerOffsets.0 < threshold { + Spacer() } - .background(Color.white01) + + Text("Starbucks Online Store") + .font(headerOffsets.0 < threshold ? .PretendardBold20 : .PretendardBold24) + .padding(.horizontal) + .animation(.easeIn(duration: 0.7), value: headerOffsets.0) + + Spacer() } + .frame(height: 90, alignment: .bottomLeading) + .safeAreaPadding(.bottom, headerOffsets.0 < threshold ? 10 : 0) + .background(Color.white01) } // MARK: - Banner Section @@ -35,10 +93,6 @@ struct ShopView: View { /// - 각 배너는 전체 화면 너비에서 좌우 여백을 뺀 크기로 표시 private var bannerSection: some View { VStack (alignment: .leading) { - Text("Starbucks Online Store") - .font(.PretendardBold24) - .padding(.horizontal) - ScrollView(.horizontal, showsIndicators: false) { LazyHStack(spacing: 20) { ForEach(viewModel.bannerImages, id: \.self) { imageName in