initial welcome page and some of the carousel done

This commit is contained in:
talksik
2021-12-11 19:26:32 -08:00
parent 315fe6210b
commit 1bfcbe4b4f
52 changed files with 954 additions and 2 deletions
@@ -0,0 +1,51 @@
//
// ChatsCarouselView.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import SwiftUI
struct ChatsCarouselView: View {
var body: some View {
mainCarouselView
}
var mainCarouselView: some View {
TabView {
ForEach(/*@START_MENU_TOKEN@*/0 ..< 5/*@END_MENU_TOKEN@*/) { item in
GeometryReader {proxy in
let minX = proxy.frame(in: .global).minX
carouselUser
.rotation3DEffect(.degrees(minX / -10), axis: (x: 0, y: 1, z: 0))
.shadow(color: Color("Shadow").opacity(0.3), radius: 10, x:0, y:10)
.blur(radius: abs(minX) / 40)
Text("\(minX)")
}gi
}
}
.tabViewStyle(.page(indexDisplayMode: .always))
.frame(height: 400)
}
//the bottom navigation of the small profile pictures
// var navigationCarouselView: some View { }
var carouselUser: some View {
Image("dummy_profile_picture")
.renderingMode(.original)
.resizable()
.aspectRatio(contentMode: .fit)
.cornerRadius(0)
.clipShape(Circle())
}
}
struct ChatsCarouselView_Previews: PreviewProvider {
static var previews: some View {
ChatsCarouselView()
}
}
+31
View File
@@ -0,0 +1,31 @@
//
// MainVoiceChat.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import SwiftUI
struct HomeView: View {
var body: some View {
VStack {
HeaderView(isAuth:true)
ChatsCarouselView()
Spacer()
}
.frame(maxWidth:.infinity, maxHeight: .infinity)
.accentColor(NirvanaColors.teal)
.background(NirvanaColors.bgLightGrey)
}
}
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
Group {
HomeView()
}
}
}
@@ -0,0 +1,13 @@
//
// HomeViewModel.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import Foundation
final class HomeViewModel: ObservableObject {
@Published var personalUsers: [User] = []
}
+8
View File
@@ -0,0 +1,8 @@
//
// Footer.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import Foundation
@@ -0,0 +1,58 @@
//
// Header.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import SwiftUI
struct HeaderView: View {
var isAuthenticated:Bool = false
init(isAuth:Bool = false) {
self.isAuthenticated = isAuth
}
var body: some View {
HStack(alignment:.center) {
if (self.isAuthenticated) {
Image(systemName: "list.bullet.circle")
.font(Font.system(.largeTitle))
.padding()
.foregroundColor(NirvanaColors.teal)
}
Spacer()
HStack {
Image("undraw_handcrafts_leaf")
.resizable()
.frame(width: 20.0, height: 32.132)
Text("nirvana")
.font(Font.custom("Satisfy-Regular", size: 35))
.foregroundColor(NirvanaColors.teal)
.multilineTextAlignment(.center)
}
Spacer()
if (self.isAuthenticated) {
Image(systemName: "person.crop.circle.badge.plus")
.font(Font.system(.largeTitle))
.padding()
.foregroundColor(NirvanaColors.teal)
}
}
.frame(maxWidth: .infinity)
}
}
struct HeaderView_Previews: PreviewProvider {
static var previews: some View {
HeaderView(isAuth:true)
}
}
@@ -0,0 +1,20 @@
//
// Onboarding.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import SwiftUI
struct Onboarding: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
struct Onboarding_Previews: PreviewProvider {
static var previews: some View {
Onboarding()
}
}
@@ -0,0 +1,100 @@
//
// Onboarding.swift
// nirvana-ios
//
// Created by Arjun Patel on 12/11/21.
//
import SwiftUI
struct WelcomeView: View {
var body: some View {
VStack {
// nav bar
HeaderView()
VStack {
// illustration
Image("undraw_friendship_mni7")
.renderingMode(.original)
.resizable()
.aspectRatio(contentMode: .fit)
.padding(.horizontal, 30)
.padding(.top, 30)
VStack(alignment: .leading) {
Text("Your ")
.font(.title)
+ Text("minimalist ")
.font(.title)
.foregroundColor(NirvanaColors.teal)
+ Text("social media.")
.font(.title)
Text("tired of the rat race on insta, tik-tok, snap, meta?")
.foregroundColor(Color.gray)
.padding(.top, 5)
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 30)
.padding(.top, 20)
Spacer()
VStack(alignment: .center) {
Button(
action: {
print("Start your detox button clicked")
},
label: {
Text("Start Your Detox")
.bold()
.foregroundColor(NirvanaColors.white)
}
)
.frame(maxWidth: .infinity)
.padding(.vertical, 25)
.background(NirvanaColors.teal)
.clipShape(Capsule())
// .shadow(color: NirvanaColors.teal, radius: 3, x: 1, y: 2)
// .cornerRadius(8)
Button(
action: {
print("link to w ebsite learn more clicked")
},
label: {
Text("Learn More")
.bold()
}
)
.background(NirvanaColors.bgLightGrey)
//learn more button to usenirvana.com
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 30)
.padding(.top, 20)
Spacer()
}
.padding()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.accentColor(NirvanaColors.teal)
.background(NirvanaColors.bgLightGrey)
// .background(RadialGradient(gradient: Gradient(colors: [NirvanaColors.teal.opacity(0.1), NirvanaColors.bgLightGrey, NirvanaColors.bgLightGrey]), center: .center, startRadius: 0, endRadius: 200)
// )
}
}
struct WelcomeView_Previews: PreviewProvider {
static var previews: some View {
WelcomeView()
}
}