From f519c9c29e7c4248155f2c5f02ee3d7928cb56bd Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:42:24 +0200 Subject: [PATCH 1/7] =?UTF-8?q?Update:=20rename=20project=20name=20+=20con?= =?UTF-8?q?figure=20background=20image=20base=20=E2=9C=8D=EF=B8=8F?= =?UTF-8?q?=F0=9F=91=A8=F0=9F=8F=BB=E2=80=8D=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp/{HikeAppApp.swift => HikeApp.swift} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename HikeApp/{HikeAppApp.swift => HikeApp.swift} (100%) diff --git a/HikeApp/HikeAppApp.swift b/HikeApp/HikeApp.swift similarity index 100% rename from HikeApp/HikeAppApp.swift rename to HikeApp/HikeApp.swift From 9dcf5ebe0839b2ff0bfeea103753c9bca2f54521 Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:42:45 +0200 Subject: [PATCH 2/7] =?UTF-8?q?Update:=20rename=20project=20name=20?= =?UTF-8?q?=E2=9C=8D=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp.xcodeproj/project.pbxproj | 8 ++++---- HikeApp/ContentView.swift | 10 +++------- HikeApp/HikeApp.swift | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/HikeApp.xcodeproj/project.pbxproj b/HikeApp.xcodeproj/project.pbxproj index e0b2ae1..6a89f64 100644 --- a/HikeApp.xcodeproj/project.pbxproj +++ b/HikeApp.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - F4A0A8822C1F800B003AFEA1 /* HikeAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8812C1F800B003AFEA1 /* HikeAppApp.swift */; }; + F4A0A8822C1F800B003AFEA1 /* HikeApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */; }; F4A0A8842C1F800B003AFEA1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8832C1F800B003AFEA1 /* ContentView.swift */; }; F4A0A8862C1F800D003AFEA1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */; }; F4A0A8892C1F800D003AFEA1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4A0A8882C1F800D003AFEA1 /* Preview Assets.xcassets */; }; @@ -15,7 +15,7 @@ /* Begin PBXFileReference section */ F4A0A87E2C1F800B003AFEA1 /* HikeApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HikeApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - F4A0A8812C1F800B003AFEA1 /* HikeAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeAppApp.swift; sourceTree = ""; }; + F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeApp.swift; sourceTree = ""; }; F4A0A8832C1F800B003AFEA1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; F4A0A8882C1F800D003AFEA1 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; @@ -51,7 +51,7 @@ F4A0A8802C1F800B003AFEA1 /* HikeApp */ = { isa = PBXGroup; children = ( - F4A0A8812C1F800B003AFEA1 /* HikeAppApp.swift */, + F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */, F4A0A8832C1F800B003AFEA1 /* ContentView.swift */, F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */, F4A0A8872C1F800D003AFEA1 /* Preview Content */, @@ -138,7 +138,7 @@ buildActionMask = 2147483647; files = ( F4A0A8842C1F800B003AFEA1 /* ContentView.swift in Sources */, - F4A0A8822C1F800B003AFEA1 /* HikeAppApp.swift in Sources */, + F4A0A8822C1F800B003AFEA1 /* HikeApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/HikeApp/ContentView.swift b/HikeApp/ContentView.swift index eaab56a..4443e7f 100644 --- a/HikeApp/ContentView.swift +++ b/HikeApp/ContentView.swift @@ -9,13 +9,9 @@ import SwiftUI struct ContentView: View { var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundStyle(.tint) - Text("Hello, world!") - } - .padding() + Image("image-1") + .resizable() + .scaledToFit() } } diff --git a/HikeApp/HikeApp.swift b/HikeApp/HikeApp.swift index 6f74cbe..9ca6951 100644 --- a/HikeApp/HikeApp.swift +++ b/HikeApp/HikeApp.swift @@ -1,5 +1,5 @@ // -// HikeAppApp.swift +// HikeApp.swift // HikeApp // // Created by Dorian Emenir on 16/06/2024. @@ -8,7 +8,7 @@ import SwiftUI @main -struct HikeAppApp: App { +struct HikeApp: App { var body: some Scene { WindowGroup { ContentView() From 707215ffc84ca6c128a08f879241d372d13c6447 Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:43:09 +0200 Subject: [PATCH 3/7] =?UTF-8?q?Create:=20CardView=20and=20add=20ZStack=20w?= =?UTF-8?q?ith=20background=20color=20for=20Image()=20using=20LinearGradie?= =?UTF-8?q?nt()=20=F0=9F=91=A8=F0=9F=8F=BB=E2=80=8D=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp.xcodeproj/project.pbxproj | 4 ++++ HikeApp/CardView.swift | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 HikeApp/CardView.swift diff --git a/HikeApp.xcodeproj/project.pbxproj b/HikeApp.xcodeproj/project.pbxproj index 6a89f64..039cc56 100644 --- a/HikeApp.xcodeproj/project.pbxproj +++ b/HikeApp.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + F43259AF2C22279E00F258E5 /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F43259AE2C22279E00F258E5 /* CardView.swift */; }; F4A0A8822C1F800B003AFEA1 /* HikeApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */; }; F4A0A8842C1F800B003AFEA1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8832C1F800B003AFEA1 /* ContentView.swift */; }; F4A0A8862C1F800D003AFEA1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */; }; @@ -14,6 +15,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + F43259AE2C22279E00F258E5 /* CardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = ""; }; F4A0A87E2C1F800B003AFEA1 /* HikeApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HikeApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeApp.swift; sourceTree = ""; }; F4A0A8832C1F800B003AFEA1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -53,6 +55,7 @@ children = ( F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */, F4A0A8832C1F800B003AFEA1 /* ContentView.swift */, + F43259AE2C22279E00F258E5 /* CardView.swift */, F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */, F4A0A8872C1F800D003AFEA1 /* Preview Content */, ); @@ -138,6 +141,7 @@ buildActionMask = 2147483647; files = ( F4A0A8842C1F800B003AFEA1 /* ContentView.swift in Sources */, + F43259AF2C22279E00F258E5 /* CardView.swift in Sources */, F4A0A8822C1F800B003AFEA1 /* HikeApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/HikeApp/CardView.swift b/HikeApp/CardView.swift new file mode 100644 index 0000000..95c5cee --- /dev/null +++ b/HikeApp/CardView.swift @@ -0,0 +1,28 @@ +// +// CardView.swift +// HikeApp +// +// Created by Dorian Emenir on 18/06/2024. +// + +import SwiftUI + +struct CardView: View { + var body: some View { + ZStack { + Circle() + .fill( + LinearGradient(colors: [Color(.colorIndigoMedium), Color(.colorSalmonLight)], startPoint: .topLeading, endPoint: .bottomTrailing) + ) + .frame(width: 256, height: 256) + + Image("image-1") + .resizable() + .scaledToFit() + } + } +} + +#Preview { + CardView() +} From 6e9799f0a082606ef6b779567f9ad1299cb959dd Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:43:28 +0200 Subject: [PATCH 4/7] =?UTF-8?q?Update:=20call=20newly=20created=20view=20C?= =?UTF-8?q?ardView()=20=F0=9F=94=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp/ContentView.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/HikeApp/ContentView.swift b/HikeApp/ContentView.swift index 4443e7f..ca0b594 100644 --- a/HikeApp/ContentView.swift +++ b/HikeApp/ContentView.swift @@ -9,9 +9,7 @@ import SwiftUI struct ContentView: View { var body: some View { - Image("image-1") - .resizable() - .scaledToFit() + CardView() } } From b3e41c3a90e8287375d39200075bf0c1d71e69d3 Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:12:23 +0200 Subject: [PATCH 5/7] =?UTF-8?q?Create:=20CustomBackgroundView=20&=20ColorE?= =?UTF-8?q?xtension=20files=20=F0=9F=97=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp.xcodeproj/project.pbxproj | 26 +++++++++++++++++++- HikeApp/{ => Component}/CardView.swift | 0 HikeApp/Component/CustomBackgroundView.swift | 18 ++++++++++++++ HikeApp/Utility/ColorExtension.swift | 8 ++++++ 4 files changed, 51 insertions(+), 1 deletion(-) rename HikeApp/{ => Component}/CardView.swift (100%) create mode 100644 HikeApp/Component/CustomBackgroundView.swift create mode 100644 HikeApp/Utility/ColorExtension.swift diff --git a/HikeApp.xcodeproj/project.pbxproj b/HikeApp.xcodeproj/project.pbxproj index 039cc56..f5406df 100644 --- a/HikeApp.xcodeproj/project.pbxproj +++ b/HikeApp.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ F43259AF2C22279E00F258E5 /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F43259AE2C22279E00F258E5 /* CardView.swift */; }; + F4610AD42C28B67A0095D75F /* CustomBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4610AD32C28B67A0095D75F /* CustomBackgroundView.swift */; }; + F4610AD72C28B78C0095D75F /* ColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4610AD62C28B78C0095D75F /* ColorExtension.swift */; }; F4A0A8822C1F800B003AFEA1 /* HikeApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */; }; F4A0A8842C1F800B003AFEA1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0A8832C1F800B003AFEA1 /* ContentView.swift */; }; F4A0A8862C1F800D003AFEA1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */; }; @@ -16,6 +18,8 @@ /* Begin PBXFileReference section */ F43259AE2C22279E00F258E5 /* CardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = ""; }; + F4610AD32C28B67A0095D75F /* CustomBackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBackgroundView.swift; sourceTree = ""; }; + F4610AD62C28B78C0095D75F /* ColorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorExtension.swift; sourceTree = ""; }; F4A0A87E2C1F800B003AFEA1 /* HikeApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HikeApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HikeApp.swift; sourceTree = ""; }; F4A0A8832C1F800B003AFEA1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -34,6 +38,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + F4610AD22C28B6560095D75F /* Component */ = { + isa = PBXGroup; + children = ( + F43259AE2C22279E00F258E5 /* CardView.swift */, + F4610AD32C28B67A0095D75F /* CustomBackgroundView.swift */, + ); + path = Component; + sourceTree = ""; + }; + F4610AD52C28B7730095D75F /* Utility */ = { + isa = PBXGroup; + children = ( + F4610AD62C28B78C0095D75F /* ColorExtension.swift */, + ); + path = Utility; + sourceTree = ""; + }; F4A0A8752C1F800B003AFEA1 = { isa = PBXGroup; children = ( @@ -55,7 +76,8 @@ children = ( F4A0A8812C1F800B003AFEA1 /* HikeApp.swift */, F4A0A8832C1F800B003AFEA1 /* ContentView.swift */, - F43259AE2C22279E00F258E5 /* CardView.swift */, + F4610AD22C28B6560095D75F /* Component */, + F4610AD52C28B7730095D75F /* Utility */, F4A0A8852C1F800D003AFEA1 /* Assets.xcassets */, F4A0A8872C1F800D003AFEA1 /* Preview Content */, ); @@ -143,6 +165,8 @@ F4A0A8842C1F800B003AFEA1 /* ContentView.swift in Sources */, F43259AF2C22279E00F258E5 /* CardView.swift in Sources */, F4A0A8822C1F800B003AFEA1 /* HikeApp.swift in Sources */, + F4610AD42C28B67A0095D75F /* CustomBackgroundView.swift in Sources */, + F4610AD72C28B78C0095D75F /* ColorExtension.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/HikeApp/CardView.swift b/HikeApp/Component/CardView.swift similarity index 100% rename from HikeApp/CardView.swift rename to HikeApp/Component/CardView.swift diff --git a/HikeApp/Component/CustomBackgroundView.swift b/HikeApp/Component/CustomBackgroundView.swift new file mode 100644 index 0000000..55bbe1e --- /dev/null +++ b/HikeApp/Component/CustomBackgroundView.swift @@ -0,0 +1,18 @@ +// +// CustomBackgroundView.swift +// HikeApp +// +// Created by Dorian Emenir on 23/06/2024. +// + +import SwiftUI + +struct CustomBackgroundView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + CustomBackgroundView() +} diff --git a/HikeApp/Utility/ColorExtension.swift b/HikeApp/Utility/ColorExtension.swift new file mode 100644 index 0000000..0cdce42 --- /dev/null +++ b/HikeApp/Utility/ColorExtension.swift @@ -0,0 +1,8 @@ +// +// ColorExtension.swift +// HikeApp +// +// Created by Dorian Emenir on 23/06/2024. +// + +import Foundation From 65bbd139d6d79d76ea3e71baba1e948e2e8ff597 Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:13:51 +0200 Subject: [PATCH 6/7] =?UTF-8?q?Update:=20add=20CustomBackgroundView()=20ca?= =?UTF-8?q?ll=20to=20make=20the=20background=20view=20appears=20behind=20t?= =?UTF-8?q?he=20Image=20=F0=9F=91=A8=F0=9F=8F=BB=E2=80=8D=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp/Component/CardView.swift | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/HikeApp/Component/CardView.swift b/HikeApp/Component/CardView.swift index 95c5cee..56eb7c6 100644 --- a/HikeApp/Component/CardView.swift +++ b/HikeApp/Component/CardView.swift @@ -9,17 +9,24 @@ import SwiftUI struct CardView: View { var body: some View { + // MARK: - CARD + ZStack { - Circle() - .fill( - LinearGradient(colors: [Color(.colorIndigoMedium), Color(.colorSalmonLight)], startPoint: .topLeading, endPoint: .bottomTrailing) - ) - .frame(width: 256, height: 256) + CustomBackgroundView() - Image("image-1") - .resizable() - .scaledToFit() - } + ZStack { + Circle() + .fill( + LinearGradient(colors: [Color.colorIndigoMedium, Color.colorSalmonLight], startPoint: .topLeading, endPoint: .bottomTrailing) + ) + .frame(width: 256, height: 256) + + Image("image-1") + .resizable() + .scaledToFit() + } + } //: CARD + .frame(width: 320, height: 570) } } From afc03a0d5f388f035715147df18a5afe35b94a47 Mon Sep 17 00:00:00 2001 From: Dorian <61510923+dodoleouf@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:15:05 +0200 Subject: [PATCH 7/7] =?UTF-8?q?Create:=20ColorExtension=20extension=20to?= =?UTF-8?q?=20ease=20the=20call=20of=20colors=20passed=20in=20assets=20(th?= =?UTF-8?q?is=20file=20is=20not=20used=20because=20Xcode=20is=20able=20to?= =?UTF-8?q?=20recognize=20the=20colors=20without=20this=20extension)=20?= =?UTF-8?q?=F0=9F=94=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HikeApp/Component/CustomBackgroundView.swift | 21 +++++++++++++++++++- HikeApp/Utility/ColorExtension.swift | 11 ++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/HikeApp/Component/CustomBackgroundView.swift b/HikeApp/Component/CustomBackgroundView.swift index 55bbe1e..636d91f 100644 --- a/HikeApp/Component/CustomBackgroundView.swift +++ b/HikeApp/Component/CustomBackgroundView.swift @@ -9,10 +9,29 @@ import SwiftUI struct CustomBackgroundView: View { var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + ZStack { + // MARK: - 3. DEPTH + + Color.colorGreenDark + .clipShape(.rect(cornerRadius: 40)) + .offset(y: 12) + + // MARK: - 2. LIGHT + + Color.colorGreenLight + .clipShape(.rect(cornerRadius: 40)) + .offset(y: 3) + .opacity(0.85) + + // MARK: - 1. SURFACE + + LinearGradient(colors: [Color.colorGreenLight, Color.colorGreenMedium], startPoint: .top, endPoint: .bottom) + .clipShape(.rect(cornerRadius: 40)) + } } } #Preview { CustomBackgroundView() + .padding() } diff --git a/HikeApp/Utility/ColorExtension.swift b/HikeApp/Utility/ColorExtension.swift index 0cdce42..e9d8171 100644 --- a/HikeApp/Utility/ColorExtension.swift +++ b/HikeApp/Utility/ColorExtension.swift @@ -6,3 +6,14 @@ // import Foundation +import SwiftUI + +extension Color { + static let customGreenLight = Color("ColorGreenLight") + static let customGreenMedium = Color("ColorGreenMedium") + static let customGreenDark = Color("ColorGreenDark") + static let customGrayLight = Color("ColorGrayLight") + static let customGrayMedium = Color("ColorGrayMedium") + static let customIndigoMedium = Color("ColorIndigoMedium") + static let customSalmonLight = Color("ColorSalmonLight") +}