add modal win

bet_component
lucas delanier 2 years ago
parent 1427b274f5
commit 2b9ea15560

@ -20,6 +20,7 @@
EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEC2AC093820091D57C /* TextCapsule.swift */; }; EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEC2AC093820091D57C /* TextCapsule.swift */; };
EC2C1EEF2AC098D30091D57C /* UsersPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEE2AC098D30091D57C /* UsersPreview.swift */; }; EC2C1EEF2AC098D30091D57C /* UsersPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C1EEE2AC098D30091D57C /* UsersPreview.swift */; };
EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC3737E32AC2F5FB00E6BDB5 /* ChoiceCapsule.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 */; }; EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC46D7DC2ABCCC270030AC04 /* MenuView.swift */; };
EC46D7DF2ABCE0A20030AC04 /* ParameterMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC46D7DE2ABCE0A20030AC04 /* ParameterMenuView.swift */; }; EC46D7DF2ABCE0A20030AC04 /* ParameterMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC46D7DE2ABCE0A20030AC04 /* ParameterMenuView.swift */; };
EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC50BF952ABF4D3300197685 /* SplashScreen.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; }; 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; }; 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; }; 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; }; 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; }; 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; }; 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 */, EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */,
EC50BF952ABF4D3300197685 /* SplashScreen.swift */, EC50BF952ABF4D3300197685 /* SplashScreen.swift */,
EC50BF972ABF541B00197685 /* WelcomeScreen.swift */, EC50BF972ABF541B00197685 /* WelcomeScreen.swift */,
EC3737E52AC41DB000E6BDB5 /* WinModal.swift */,
); );
path = Screens; path = Screens;
sourceTree = "<group>"; sourceTree = "<group>";
@ -348,6 +351,7 @@
D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */, D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */,
D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */, D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */,
EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */, EC3737E42AC2F5FB00E6BDB5 /* ChoiceCapsule.swift in Sources */,
EC3737E62AC41DB000E6BDB5 /* WinModal.swift in Sources */,
EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */, EC2C1EED2AC093820091D57C /* TextCapsule.swift in Sources */,
D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */, D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */,
EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */, EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */,

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

@ -10,6 +10,7 @@ import SwiftUI
struct Home: View { struct Home: View {
@Binding var showMenu: Bool @Binding var showMenu: Bool
@State private var showingSheet = false
var body: some View { var body: some View {
VStack(alignment: .center, spacing: 0) { VStack(alignment: .center, spacing: 0) {
@ -30,6 +31,12 @@ struct Home: View {
AllinColor.fadeInGradiantCard AllinColor.fadeInGradiantCard
ScrollView(.horizontal,showsIndicators: false){ ScrollView(.horizontal,showsIndicators: false){
HStack{ HStack{
Button("Show Sheet") {
showingSheet.toggle()
}
.sheet(isPresented: $showingSheet) {
WinModal()
}
ChoiceCapsule() ChoiceCapsule()
ChoiceCapsule() ChoiceCapsule()
ChoiceCapsule() ChoiceCapsule()

@ -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<Content: View>: 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)
}
}
Loading…
Cancel
Save