Merge pull request 'REGISTER_LOGIN_PAGE' (#2) from REGISTER_LOGIN_PAGE into master

Reviewed-on: AllDev/Swift#2
auth_manage
Emre KARTAL 2 years ago
commit e8ee58d957

@ -24,6 +24,9 @@
EC87FCD92ABBA60900363986 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCD82ABBA60900363986 /* Colors.swift */; };
EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */; };
EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */; };
ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */; };
ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDF624B2AC205E100BA8213 /* BetScreen.swift */; };
ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFC54432AC0C39E00195760 /* LoginScreen.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -65,6 +68,9 @@
EC87FCD82ABBA60900363986 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Colors.swift; path = allin/Ressources/Colors.swift; sourceTree = SOURCE_ROOT; };
EC87FCDA2ABBA6AC00363986 /* TrendingBetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TrendingBetCard.swift; path = allin/Views/TrendingBetCard.swift; sourceTree = SOURCE_ROOT; };
EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HomeScreen.swift; path = allin/Screens/HomeScreen.swift; sourceTree = SOURCE_ROOT; };
ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RegisterScreen.swift; path = allin/Screens/RegisterScreen.swift; sourceTree = SOURCE_ROOT; };
ECDF624B2AC205E100BA8213 /* BetScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = BetScreen.swift; path = allin/Screens/BetScreen.swift; sourceTree = SOURCE_ROOT; };
ECFC54432AC0C39E00195760 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LoginScreen.swift; path = allin/Screens/LoginScreen.swift; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -187,6 +193,9 @@
EC9A45AF2ABDF4A800125D41 /* HomeScreen.swift */,
EC50BF952ABF4D3300197685 /* SplashScreen.swift */,
EC50BF972ABF541B00197685 /* WelcomeScreen.swift */,
ECFC54432AC0C39E00195760 /* LoginScreen.swift */,
ECDF62492AC1CAFD00BA8213 /* RegisterScreen.swift */,
ECDF624B2AC205E100BA8213 /* BetScreen.swift */,
);
path = Screens;
sourceTree = "<group>";
@ -329,15 +338,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
ECFC54442AC0C39E00195760 /* LoginScreen.swift in Sources */,
EC87FCD62ABBA24000363986 /* Extensions.swift in Sources */,
EC46D7DD2ABCCC270030AC04 /* MenuView.swift in Sources */,
EC87FCD92ABBA60900363986 /* Colors.swift in Sources */,
D98C4D662AB9D017007A6B4D /* ContentView.swift in Sources */,
ECDF624C2AC205E100BA8213 /* BetScreen.swift in Sources */,
D92EC57C2ABADA2800CCD30E /* CoinCounterView.swift in Sources */,
D98C4D8E2AB9D440007A6B4D /* TopBarView.swift in Sources */,
EC50BF962ABF4D3300197685 /* SplashScreen.swift in Sources */,
EC9A45B02ABDF4A800125D41 /* HomeScreen.swift in Sources */,
EC46D7DF2ABCE0A20030AC04 /* ParameterMenuView.swift in Sources */,
ECDF624A2AC1CAFD00BA8213 /* RegisterScreen.swift in Sources */,
EC50BF982ABF541B00197685 /* WelcomeScreen.swift in Sources */,
D98C4D642AB9D017007A6B4D /* AllInApp.swift in Sources */,
EC87FCDB2ABBA6AC00363986 /* TrendingBetCard.swift in Sources */,

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF6",
"green" : "0x45",
"red" : "0x6E"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF6",
"green" : "0x45",
"red" : "0x6E"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x8A",
"green" : "0x8A",
"red" : "0x8A"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x8A",
"green" : "0x8A",
"red" : "0x8A"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -9,41 +9,9 @@ import SwiftUI
struct ContentView: View {
@State var showMenu = false
var body: some View {
let closeDrag = DragGesture()
.onEnded {
if $0.translation.width < -100 {
withAnimation{
self.showMenu = false
}
}
}
let openDrag = DragGesture()
.onEnded {
if $0.translation.width > 100 {
withAnimation{
self.showMenu = true
}
}
}
GeometryReader { geometry in
ZStack(alignment: .leading) {
Home(showMenu: self.$showMenu)
.frame(width: geometry.size.width, height: geometry.size.height)
.offset(x: self.showMenu ? geometry.size.width/1.21:0)
.gesture(openDrag)
if self.showMenu {
MenuView()
.frame(width: geometry.size.width*0.83)
.transition(.move(edge: .leading))
}
}
.gesture(closeDrag)
NavigationView {
Welcome()
}
}
}

@ -14,6 +14,7 @@ struct AllinColor {
static let pinkAccentText = Color("PinkAccentText")
static let darkLight = Color("DarkLight")
static let backgroundWhite = Color("BackgroundWhite")
static let PurpleText = Color("PurpleText")
static let StartBackground = Color("StartBackground")
static let blueAccent = Color("BlueAccent")
static let TopBarColorPink = Color("TopBarColorPink")
@ -21,6 +22,7 @@ struct AllinColor {
static let LightPurple = Color("LightPurple")
static let TopBarColorBlue = Color("TopBarColorBlue")
static let TopBarColorPurple = Color("TopBarColorPurple")
static let StrokeGrayColor = Color("StrokeGrayColor")
static let DescriptionColorMenu = Color("DescriptionColorMenu")
static let BorderColorMenu = Color("BorderColorMenu")
static let gradiantCard = LinearGradient(

@ -0,0 +1,101 @@
//
// LoginScreen.swift
// AllIn
//
// Created by étudiant on 24/09/2023.
//
import SwiftUI
struct Login: View {
@State private var isPasswordVisible = true
@State private var username: String = ""
@State private var password: String = ""
var body: some View {
GeometryReader { geometry in
VStack(spacing: 15) {
Spacer()
Text("Te revoilà!")
.betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40)
Text("Bon retour parmis nous tu nous as manqué!")
.frame(width: 220)
.multilineTextAlignment(.center)
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20)
.padding(.bottom, 60)
TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray))
.padding()
.background(Color.white.cornerRadius(9))
.frame(width: 300)
.foregroundColor(.black)
.overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
)
.padding(.bottom, 8)
Group {
if isPasswordVisible {
SecureField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray))
} else {
TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray))
}
}
.padding()
.background(Color.white.cornerRadius(9))
.frame(width: 300)
.overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
)
.overlay(
HStack {
Spacer()
Button(action: {
isPasswordVisible.toggle()
}) {
Image(systemName: isPasswordVisible ? "eye.slash" : "eye")
.foregroundColor(.gray)
}
.padding(.trailing, 8)
}
)
.foregroundColor(.black)
Text("Mot de passe oublié?")
.frame(alignment: .trailing)
.padding(.bottom, 20)
.padding(.leading, 150)
.betTextStyle(weight: .medium, color: AllinColor.StartTextColor, size: 14)
NavigationLink(destination: Home(page: "Bet").navigationBarBackButtonHidden(true))
{
Text("Se connecter")
.betTextStyle(weight: .bold, color: .white, size: 17)
.frame(width: 300, height: 60)
.background(LinearGradient(gradient:
Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]),
startPoint: .leading, endPoint: .trailing))
.cornerRadius(13)
}
Spacer()
HStack(spacing: 0) {
Text("Pas encore inscrit? ")
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16)
NavigationLink(destination: Register().navigationBarBackButtonHidden(true))
{
Text("S'inscrire")
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16)
}
}
}
.frame(width: geometry.size.width, height: geometry.size.height)
.background(AllinColor.StartBackground)
}
}
}

@ -0,0 +1,154 @@
//
// RegisterScreen.swift
// AllIn
//
// Created by étudiant on 25/09/2023.
//
import SwiftUI
struct Register: View {
@State private var isPasswordVisible = true
@State private var pseudo: String = ""
@State private var username: String = ""
@State private var password: String = ""
@State private var passwordConfirm: String = ""
var body: some View {
GeometryReader { geometry in
ScrollView(showsIndicators: false) {
VStack(spacing: 15) {
Spacer()
VStack {
if (pseudo != "") {
Text("Bonjour "+pseudo+",")
.betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40)
.padding([.trailing, .leading], 30)
} else {
Text("Bonjour,")
.betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40)
.lineLimit(1)
.padding([.trailing, .leading], 30)
}
Text("On a besoin de ça!")
.betTextStyle(weight: .semibold, color: AllinColor.StartTextColor, size: 40)
}
Text("Promis cest rapide.")
.frame(width: 220)
.multilineTextAlignment(.center)
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 20)
.padding(.bottom, 60)
TextField("", text: $pseudo, prompt: Text("Pseudo").foregroundColor(.gray))
.padding()
.background(Color.white.cornerRadius(9))
.frame(width: 300)
.foregroundColor(.black)
.overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
)
.padding(.bottom, 8)
TextField("", text: $username, prompt: Text("Email").foregroundColor(.gray))
.padding()
.background(Color.white.cornerRadius(9))
.frame(width: 300)
.foregroundColor(.black)
.overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
)
.padding(.bottom, 8)
Group {
if isPasswordVisible {
SecureField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray))
} else {
TextField("", text: $password, prompt: Text("Mot de passe").foregroundColor(.gray))
}
}
.padding()
.background(Color.white.cornerRadius(9))
.frame(width: 300)
.overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
)
.foregroundColor(.black)
.padding(.bottom, 8)
.overlay(
HStack {
Spacer()
Button(action: {
isPasswordVisible.toggle()
}) {
Image(systemName: isPasswordVisible ? "eye.slash" : "eye")
.foregroundColor(.gray)
}
.padding(.bottom, 8)
.padding(.trailing, 8)
}
)
Group {
if isPasswordVisible {
SecureField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray))
} else {
TextField("", text: $passwordConfirm, prompt: Text("Confirmation du Mot de passe").foregroundColor(.gray))
}
}
.padding()
.background(Color.white.cornerRadius(9))
.frame(width: 300)
.overlay(
RoundedRectangle(cornerRadius: 9, style: .continuous)
.stroke(AllinColor.StrokeGrayColor, lineWidth: 1)
)
.overlay(
HStack {
Spacer()
Button(action: {
isPasswordVisible.toggle()
}) {
Image(systemName: isPasswordVisible ? "eye.slash" : "eye")
.foregroundColor(.gray)
}
.padding(.trailing, 8)
}
)
.foregroundColor(.black)
.padding(.bottom, 50)
Button(action: {}) {
Text("S'inscrire")
.betTextStyle(weight: .bold, color: .white, size: 17)
}
.frame(width: 300, height: 60)
.background(LinearGradient(gradient:
Gradient(colors:[AllinColor.TopBarColorPink,AllinColor.TopBarColorPurple,AllinColor.TopBarColorBlue]),
startPoint: .leading, endPoint: .trailing))
.cornerRadius(13)
Spacer()
HStack(spacing: 0) {
Text("Tu as déjà un compte? ")
.betTextStyle(weight: .regular, color: AllinColor.StartTextColor, size: 16)
NavigationLink(destination: Login().navigationBarBackButtonHidden(true))
{
Text("Se connecter")
.betTextStyle(weight: .semibold, color: AllinColor.PurpleText, size: 16)
}
}
}
}
.frame(width: geometry.size.width, height: geometry.size.height)
.background(AllinColor.StartBackground)
}
}
}

@ -61,19 +61,24 @@ struct Welcome: View {
.padding([.leading,.trailing], 40)
Spacer()
Spacer()
Button(action: {}) {
NavigationLink(destination: Register().navigationBarBackButtonHidden(true))
{
Text("Rejoindre")
.betTextStyle(weight: .bold, color: AllinColor.StartBackground, size: 17)
.frame(width: geometry.size.width*0.85, height: 50)
.background(AllinColor.LightPurple)
.cornerRadius(30)
}
.frame(width: geometry.size.width*0.85, height: 50)
.background(AllinColor.LightPurple)
.cornerRadius(30)
HStack(spacing: 0) {
Text("Tu as déja un compte? ")
.betTextStyle(weight: .regular, color: AllinColor.LightPurple, size: 16)
Text("Connexion")
.betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16)
.underline()
NavigationLink(destination: Login().navigationBarBackButtonHidden(true))
{
Text("Connexion")
.betTextStyle(weight: .semibold, color: AllinColor.LightPurple, size: 16)
.underline()
}
}
Spacer()
}

@ -12,8 +12,11 @@ struct MenuView: View {
var body: some View {
VStack(alignment: .leading, spacing: 10) {
ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.")
.padding([.leading,.trailing], 13)
NavigationLink(destination: Home(page: "CreationBet").navigationBarBackButtonHidden(true))
{
ParameterMenuView(icon: "VideoGame", title: "CREER UN BET", description: "Créez un nouveau BET et faites participer vos amis.")
.padding([.leading,.trailing], 13)
}
ParameterMenuView(icon: "Eyes", title: "HISTORIQUE DES BETS", description: "Consultez vos paris en cours et terminés.")
.padding([.leading,.trailing], 13)

@ -14,7 +14,7 @@ struct TopBarView: View {
var body: some View {
ZStack{
HStack{
Button(action: {withAnimation{ self.showMenu = !self.showMenu }}) {
Button(action: {withAnimation{ self.showMenu.toggle() }}) {
Image("menu")
.resizable()
.frame(width: 26,height: 15)

Loading…
Cancel
Save