diff --git a/Sources/allin/allin.xcodeproj/project.pbxproj b/Sources/allin/allin.xcodeproj/project.pbxproj index 5c15789..fe31ea9 100644 --- a/Sources/allin/allin.xcodeproj/project.pbxproj +++ b/Sources/allin/allin.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEC2AC093820091D57C /* TextCapsule.swift */; }; EC2C1EEF2AC098D30091D57C /* UsersPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEE2AC098D30091D57C /* UsersPreview.swift */; }; EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC3737E32AC2F5FB00E6BDB5 /* ChoiceCapsule.swift */; }; + EC3737E62AC41DB000E6BDB5 /* WinModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC3737E52AC41DB000E6BDB5 /* WinModal.swift */; }; EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC46D7DC2ABCCC270030AC04 /* MenuView.swift */; }; EC46D7DF2ABCE0A20030AC04 /* ParameterMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC46D7DE2ABCE0A20030AC04 /* ParameterMenuView.swift */; }; EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC50BF952ABF4D3300197685 /* SplashScreen.swift */; }; @@ -65,6 +66,7 @@ EC2C1EEC2AC093820091D57C /* TextCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TextCapsule.swift; path = allin/Views/TextCapsule.swift; sourceTree = SOURCE_ROOT; }; EC2C1EEE2AC098D30091D57C /* UsersPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UsersPreview.swift; path = allin/Views/UsersPreview.swift; sourceTree = SOURCE_ROOT; }; EC3737E32AC2F5FB00E6BDB5 /* ChoiceCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ChoiceCapsule.swift; path = allin/Views/ChoiceCapsule.swift; sourceTree = SOURCE_ROOT; }; + EC3737E52AC41DB000E6BDB5 /* WinModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WinModal.swift; path = allin/Screens/WinModal.swift; sourceTree = SOURCE_ROOT; }; EC46D7DC2ABCCC270030AC04 /* MenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuView.swift; path = allin/Views/MenuView.swift; sourceTree = SOURCE_ROOT; }; EC46D7DE2ABCE0A20030AC04 /* ParameterMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ParameterMenuView.swift; path = allin/Views/ParameterMenuView.swift; sourceTree = SOURCE_ROOT; }; EC50BF952ABF4D3300197685 /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SplashScreen.swift; path = allin/Screens/SplashScreen.swift; sourceTree = SOURCE_ROOT; }; @@ -199,6 +201,7 @@ EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */, EC50BF952ABF4D3300197685 /* SplashScreen.swift */, EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, + EC3737E52AC41DB000E6BDB5 /* WinModal.swift */, ); path = Screens; sourceTree = ""; @@ -348,6 +351,7 @@ D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */, D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */, EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */, + EC3737E62AC41DB000E6BDB5 /* WinModal.swift in Sources */, EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */, D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */, EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */, diff --git a/Sources/allin/allin/Assets.xcassets/Allcoins.imageset/Contents.json b/Sources/allin/allin/Assets.xcassets/Allcoins.imageset/Contents.json new file mode 100644 index 0000000..b1eca72 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/Allcoins.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Vector-3.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/Allcoins.imageset/Vector-3.png b/Sources/allin/allin/Assets.xcassets/Allcoins.imageset/Vector-3.png new file mode 100644 index 0000000..128a9dc Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/Allcoins.imageset/Vector-3.png differ diff --git a/Sources/allin/allin/Assets.xcassets/BackGradiant.imageset/Contents.json b/Sources/allin/allin/Assets.xcassets/BackGradiant.imageset/Contents.json new file mode 100644 index 0000000..f1237af --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/BackGradiant.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "image 16.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/BackGradiant.imageset/image 16.png b/Sources/allin/allin/Assets.xcassets/BackGradiant.imageset/image 16.png new file mode 100644 index 0000000..dfdd829 Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/BackGradiant.imageset/image 16.png differ diff --git a/Sources/allin/allin/Assets.xcassets/BackGradiant2.imageset/Contents.json b/Sources/allin/allin/Assets.xcassets/BackGradiant2.imageset/Contents.json new file mode 100644 index 0000000..cdaf065 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/BackGradiant2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "image 17.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/BackGradiant2.imageset/image 17.png b/Sources/allin/allin/Assets.xcassets/BackGradiant2.imageset/image 17.png new file mode 100644 index 0000000..04c25c2 Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/BackGradiant2.imageset/image 17.png differ diff --git a/Sources/allin/allin/Assets.xcassets/Close_icon.imageset/Contents.json b/Sources/allin/allin/Assets.xcassets/Close_icon.imageset/Contents.json new file mode 100644 index 0000000..538e0c7 --- /dev/null +++ b/Sources/allin/allin/Assets.xcassets/Close_icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Group 105.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/allin/allin/Assets.xcassets/Close_icon.imageset/Group 105.png b/Sources/allin/allin/Assets.xcassets/Close_icon.imageset/Group 105.png new file mode 100644 index 0000000..acc68f6 Binary files /dev/null and b/Sources/allin/allin/Assets.xcassets/Close_icon.imageset/Group 105.png differ diff --git a/Sources/allin/allin/Screens/HomeScreen.swift b/Sources/allin/allin/Screens/HomeScreen.swift index 95106d0..ced1ba2 100644 --- a/Sources/allin/allin/Screens/HomeScreen.swift +++ b/Sources/allin/allin/Screens/HomeScreen.swift @@ -10,6 +10,7 @@ import SwiftUI struct Home: View { @Binding var showMenu: Bool + @State private var showingSheet = false var body: some View { VStack(alignment: .center, spacing: 0) { @@ -30,6 +31,12 @@ struct Home: View { AllinColor.fadeInGradiantCard ScrollView(.horizontal,showsIndicators: false){ HStack{ + Button("Show Sheet") { + showingSheet.toggle() + } + .sheet(isPresented: $showingSheet) { + WinModal() + } ChoiceCapsule() ChoiceCapsule() ChoiceCapsule() diff --git a/Sources/allin/allin/Screens/WinModal.swift b/Sources/allin/allin/Screens/WinModal.swift new file mode 100644 index 0000000..4607c18 --- /dev/null +++ b/Sources/allin/allin/Screens/WinModal.swift @@ -0,0 +1,221 @@ +// +// WinModal.swift +// AllIn +// +// Created by étudiant on 27/09/2023. +// + +import SwiftUI + +struct WinModal: View { + @State var xOffset: CGFloat = 0 + var body: some View { + ZStack{ + Image("BackGradiant2").resizable() + ZStack{ + GeometryReader { geometry in + let size = geometry.size.width / 20 + + InfiniteScroller(contentWidth: size * 20) { + + VStack(spacing: 20) { + + VStack(spacing: 20) { + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing:20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + + + } + VStack(spacing: 20) { + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing:20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + HStack(spacing: 20){ + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + Image("Allcoins").resizable().frame(width: 110,height:110) + Image("Allcoins").resizable().frame(width: 110, height:110) + } + + + } + + + }.padding(10) + } + VStack { + ZStack(alignment: .topLeading){ + HStack{ + Spacer() + Image("Icon").resizable().frame(width: 35, height: 35) + Spacer() + } + + Image("Close_icon").resizable().frame(width: 25, height: 25) + + } + HStack{ + Text("FÉLICITATIONS").font(.system(size: 20)).foregroundColor(.white).fontWeight(.semibold).italic() + Text("PSEUDO!").padding(.top,9).font(.system(size: 33)).fontWeight(.heavy).foregroundColor(.white) + }.rotationEffect(.degrees(-4)).padding(.top,40) + + + }.padding([.all],20) + } + + } + }.edgesIgnoringSafeArea(.all) + + } +} + +struct WinModal_Previews: PreviewProvider { + static var previews: some View { + WinModal() + } +} + +struct InfiniteScroller: View { + var contentWidth: CGFloat + var content: (() -> Content) + + @State + var xOffset: CGFloat = -800 + + var body: some View { + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 0) { + + content() + content() + content() + content() + content() + content() + content() + content() + + + + } + .offset(x: xOffset, y: 0) + } + .disabled(true) + .onAppear { + withAnimation(.linear(duration: 25).repeatForever(autoreverses: false)) { + xOffset = +contentWidth + } + }.frame(width: 1000).rotationEffect(.degrees(-30)).opacity(0.04) + } +} + +