Skip to content

Commit

Permalink
modified layout
Browse files Browse the repository at this point in the history
  • Loading branch information
imathur1 committed Jan 8, 2024
1 parent 0e752ff commit a10835c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 5 additions & 2 deletions HackIllinois/SwiftUI/HIOnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ struct HIOnboardingView: View {
}
} else {
VStack {
Spacer()
HICarouselSwiftUIView(carouselData: viewModel.data)
Button {
NotificationCenter.default.post(name: .getStarted, object: nil)
}label: {
Text("GET STARTED")
.font(.title2.bold())
.tracking(2)
// .onAppear {
// print("The screen height is \(UIScreen.main.bounds.height)")
// }
}
.padding()
.font(.title3.bold())
Expand All @@ -45,7 +47,8 @@ struct HIOnboardingView: View {
.background(Color.clear)
.overlay(RoundedRectangle(cornerRadius: 50)
.stroke(.white, lineWidth: 3))
.offset(y: -70)
.padding(.top, 20)
.padding(.bottom, UIScreen.main.bounds.height < 750 ? 10 : 75)
Spacer()
}
}
Expand Down
11 changes: 5 additions & 6 deletions HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// This file is part of the Hackillinois iOS App.
// The Hackillinois iOS App is open source software, released under the University of
// Illinois/NCSA Open Source License. You should have received a copy of
// this license in a file with the distribution.
// this license in a file with the distribution.
//

import Foundation
Expand All @@ -24,31 +24,30 @@ struct HICarouselSwiftUIView: View {
@State private var currentIndex = 0
var body: some View {
VStack {
Spacer()
TabView(selection: $currentIndex) {
ForEach(0..<carouselData.count, id: \.self) { index in
VStack {
Spacer()
Image(uiImage: carouselData[index].image!)
.resizable()
.scaledToFit()
.frame(height: UIDevice.current.userInterfaceIdiom == .pad ? 600: 400)
.padding()
.offset(y: -20)
HILableSUI(text: carouselData[index].titleText, style: .onboardingTitle)
.frame(width: 20, height: 20)
.offset(y: -30)
.padding(.top, 10)
Text(carouselData[index].descriptionText)
.bold()
.foregroundColor(.white)
.multilineTextAlignment(.center)
.offset(y: -20)
.padding(.vertical, 10)
}
.tag(index)
.padding(.horizontal, horizontalCarouselPadding)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
HITabIndicator(count: carouselData.count, current: $currentIndex)
.offset(y: -90)
}
.frame(width: UIScreen.main.bounds.width)
.padding(.horizontal, -horizontalCarouselPadding)
Expand Down

0 comments on commit a10835c

Please sign in to comment.