|
@@ -5,6 +5,7 @@
|
|
|
// Created by 100Years on 2025/1/14.
|
|
|
//
|
|
|
|
|
|
+
|
|
|
class TSBootPageVC: TSBaseVC {
|
|
|
|
|
|
var onComplete:(()->Void)
|
|
@@ -18,8 +19,7 @@ class TSBootPageVC: TSBaseVC {
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
}
|
|
|
var index:Int = 0
|
|
|
- let titleStrings = ["Change Hair Color".localized,"Anime Effect".localized,"Super AI Store".localized]
|
|
|
- let imageStrings = ["bootPage_3","bootPage_0","bootPage_1"]
|
|
|
+ let titleStrings = ["40+ Photo Styles".localized,"Change Hairstyle & Color".localized,"Photo Enhancer & Restore Old Photo".localized]
|
|
|
|
|
|
lazy var titleLabel: UILabel = {
|
|
|
let titleLabel = UILabel.createLabel(text: titleStrings.safeString(At: index),font: .font(size: 20,weight: .semibold),textColor: .themeColor,textAlignment:.center,numberOfLines: 0)
|
|
@@ -45,28 +45,25 @@ class TSBootPageVC: TSBaseVC {
|
|
|
return continueBtn
|
|
|
}()
|
|
|
|
|
|
- lazy var comparisonView0: TSImageComparisonView = {
|
|
|
- let comparisonView = TSImageComparisonView(frame: UIScreen.main.bounds)
|
|
|
- comparisonView.isRunloop = true
|
|
|
- comparisonView.configure(
|
|
|
- oldImage: UIImage(named: "boot_comparison_old_0"),
|
|
|
- newImage: UIImage(named: "boot_comparison_new_0")
|
|
|
- )
|
|
|
-
|
|
|
- kDelayMainShort {
|
|
|
- self.comparisonView0.startAnimation(direction: .rightToLeft)
|
|
|
- }
|
|
|
-
|
|
|
+ let imageViewH:CGFloat = 678.0*kDesignScale
|
|
|
+ lazy var comparisonView0: TYCycleImageView = {
|
|
|
+ let comparisonView = TYCycleImageView(frame: CGRectMake(0, 0, k_ScreenWidth, imageViewH))
|
|
|
+ comparisonView.itemModelArray = [
|
|
|
+ TYCycleImageModel(image: .bootImage00),
|
|
|
+ TYCycleImageModel(image: .bootImage01),
|
|
|
+ TYCycleImageModel(image: .bootImage02),
|
|
|
+ TYCycleImageModel(image: .bootImage03)]
|
|
|
+ comparisonView.cyclePagerView.autoScrollInterval = 0.8
|
|
|
return comparisonView
|
|
|
}()
|
|
|
|
|
|
- lazy var comparisonView1: TSImageComparisonView = {
|
|
|
- let comparisonView = TSImageComparisonView(frame: UIScreen.main.bounds)
|
|
|
- comparisonView.isRunloop = true
|
|
|
- comparisonView.configure(
|
|
|
- oldImage: UIImage(named: "boot_comparison_old_1"),
|
|
|
- newImage: UIImage(named: "boot_comparison_new_1")
|
|
|
- )
|
|
|
+ lazy var comparisonView1: TYCycleImageView = {
|
|
|
+ let comparisonView = TYCycleImageView(frame: CGRectMake(0, 0, k_ScreenWidth, imageViewH))
|
|
|
+ comparisonView.itemModelArray = [
|
|
|
+ TYCycleImageModel(image: .bootImage10),
|
|
|
+ TYCycleImageModel(image: .bootImage11),
|
|
|
+ TYCycleImageModel(image: .bootImage12)
|
|
|
+ ]
|
|
|
return comparisonView
|
|
|
}()
|
|
|
|
|
@@ -76,20 +73,17 @@ class TSBootPageVC: TSBaseVC {
|
|
|
let scrollView = UIScrollView()
|
|
|
scrollView.isScrollEnabled = false
|
|
|
scrollView.frame = self.view.bounds
|
|
|
-
|
|
|
- for (idx ,string) in imageStrings.enumerated() {
|
|
|
+
|
|
|
+ for idx in 0...3 {
|
|
|
if idx == 0 {
|
|
|
- comparisonView0.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+ comparisonView0.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, imageViewH)
|
|
|
scrollView.addSubview(comparisonView0)
|
|
|
}else if idx == 1 {
|
|
|
- comparisonView1.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+ comparisonView1.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, imageViewH)
|
|
|
scrollView.addSubview(comparisonView1)
|
|
|
- }else if idx == 2 {
|
|
|
- boatAnimateScrollView.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
- scrollView.addSubview(boatAnimateScrollView)
|
|
|
}else{
|
|
|
- let imageView = UIImageView.createImageView(imageName: string,contentMode: .scaleAspectFill)
|
|
|
- imageView.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+ let imageView = UIImageView.createImageView(image: .bootImage2,contentMode: .scaleAspectFill)
|
|
|
+ imageView.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, imageViewH)
|
|
|
scrollView.addSubview(imageView)
|
|
|
}
|
|
|
|
|
@@ -98,12 +92,6 @@ class TSBootPageVC: TSBaseVC {
|
|
|
return scrollView
|
|
|
}()
|
|
|
|
|
|
-// lazy var deepseek: UIImageView = {
|
|
|
-// let deepseek = UIImageView.createImageView(imageName: "boot_deepseek")
|
|
|
-// deepseek.isHidden = true
|
|
|
-// return deepseek
|
|
|
-// }()
|
|
|
-
|
|
|
override func createView() {
|
|
|
setNavBarViewHidden(true)
|
|
|
self.view.backgroundColor = .black
|
|
@@ -113,9 +101,6 @@ class TSBootPageVC: TSBaseVC {
|
|
|
overlayImageView.frame = CGRectMake(0, k_ScreenHeight-407*kDesignScale, k_ScreenWidth, 407*kDesignScale)
|
|
|
view.addSubview(overlayImageView)
|
|
|
|
|
|
-// deepseek.frame = CGRectMake((k_ScreenWidth-220)/2 , k_ScreenHeight-183-48, 220, 48)
|
|
|
-// view.addSubview(deepseek)
|
|
|
-
|
|
|
view.addSubview(titleLabel)
|
|
|
view.addSubview(continueBtn)
|
|
|
continueBtn.snp.makeConstraints { make in
|
|
@@ -139,14 +124,11 @@ class TSBootPageVC: TSBaseVC {
|
|
|
dePrint("clickContinue index=\(index)")
|
|
|
titleLabel.text = titleStrings.safeString(At: index)
|
|
|
|
|
|
-// deepseek.isHidden = !(index == pageIndex)//第二页
|
|
|
-
|
|
|
if index == 1{
|
|
|
- self.comparisonView0.stopAnimation()
|
|
|
- self.comparisonView1.startAnimation(direction: .rightToLeft)
|
|
|
+ comparisonView0.cyclePagerView.autoScrollInterval = 0.0
|
|
|
+ comparisonView1.cyclePagerView.autoScrollInterval = 0.8
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if index <= pageIndex{
|
|
|
scrollView.contentOffset = CGPointMake(k_ScreenWidth*CGFloat(index), 0)
|
|
|
}else{
|
|
@@ -163,6 +145,165 @@ class TSBootPageVC: TSBaseVC {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+//class TSBootPageVC: TSBaseVC {
|
|
|
+//
|
|
|
+// var onComplete:(()->Void)
|
|
|
+//
|
|
|
+// init(onComplete: @escaping () -> Void) {
|
|
|
+// self.onComplete = onComplete
|
|
|
+// super.init()
|
|
|
+// }
|
|
|
+//
|
|
|
+// @MainActor required init?(coder: NSCoder) {
|
|
|
+// fatalError("init(coder:) has not been implemented")
|
|
|
+// }
|
|
|
+// var index:Int = 0
|
|
|
+// let titleStrings = ["Change Hair Color".localized,"Anime Effect".localized,"Super AI Store".localized]
|
|
|
+// let imageStrings = ["bootPage_3","bootPage_0","bootPage_1"]
|
|
|
+//
|
|
|
+// lazy var titleLabel: UILabel = {
|
|
|
+// let titleLabel = UILabel.createLabel(text: titleStrings.safeString(At: index),font: .font(size: 20,weight: .semibold),textColor: .themeColor,textAlignment:.center,numberOfLines: 0)
|
|
|
+// return titleLabel
|
|
|
+// }()
|
|
|
+//
|
|
|
+// lazy var continueBtn: UIButton = {
|
|
|
+// let continueBtn = kCreateNormalSubmitBtn(title: "Continue".localized) { [weak self] in
|
|
|
+// guard let self = self else { return }
|
|
|
+// clickContinue()
|
|
|
+// }
|
|
|
+// continueBtn.frame = CGRect(x: 0, y: 0, width: 343, height: 50)
|
|
|
+// continueBtn.titleLabel?.font = .font(size: 18,weight: .medium)
|
|
|
+// continueBtn.cornerRadius = 25.0
|
|
|
+// let imageView = UIImageView.createImageView(imageName: "launch_rightArrow",contentMode: .scaleToFill)
|
|
|
+// continueBtn.addSubview(imageView)
|
|
|
+// imageView.snp.makeConstraints { make in
|
|
|
+// make.width.height.equalTo(24)
|
|
|
+// make.centerY.equalToSuperview()
|
|
|
+// make.trailing.equalTo(-24)
|
|
|
+// }
|
|
|
+//
|
|
|
+// return continueBtn
|
|
|
+// }()
|
|
|
+//
|
|
|
+// lazy var comparisonView0: TSImageComparisonView = {
|
|
|
+// let comparisonView = TSImageComparisonView(frame: UIScreen.main.bounds)
|
|
|
+// comparisonView.isRunloop = true
|
|
|
+// comparisonView.configure(
|
|
|
+// oldImage: UIImage(named: "boot_comparison_old_0"),
|
|
|
+// newImage: UIImage(named: "boot_comparison_new_0")
|
|
|
+// )
|
|
|
+//
|
|
|
+// kDelayMainShort {
|
|
|
+// self.comparisonView0.startAnimation(direction: .rightToLeft)
|
|
|
+// }
|
|
|
+//
|
|
|
+// return comparisonView
|
|
|
+// }()
|
|
|
+//
|
|
|
+// lazy var comparisonView1: TSImageComparisonView = {
|
|
|
+// let comparisonView = TSImageComparisonView(frame: UIScreen.main.bounds)
|
|
|
+// comparisonView.isRunloop = true
|
|
|
+// comparisonView.configure(
|
|
|
+// oldImage: UIImage(named: "boot_comparison_old_1"),
|
|
|
+// newImage: UIImage(named: "boot_comparison_new_1")
|
|
|
+// )
|
|
|
+// return comparisonView
|
|
|
+// }()
|
|
|
+//
|
|
|
+// let boatAnimateScrollView:TSBootImagesAnimateScrollView = TSBootImagesAnimateScrollView()
|
|
|
+//
|
|
|
+// lazy var scrollView: UIScrollView = {
|
|
|
+// let scrollView = UIScrollView()
|
|
|
+// scrollView.isScrollEnabled = false
|
|
|
+// scrollView.frame = self.view.bounds
|
|
|
+//
|
|
|
+// for (idx ,string) in imageStrings.enumerated() {
|
|
|
+// if idx == 0 {
|
|
|
+// comparisonView0.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+// scrollView.addSubview(comparisonView0)
|
|
|
+// }else if idx == 1 {
|
|
|
+// comparisonView1.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+// scrollView.addSubview(comparisonView1)
|
|
|
+// }else if idx == 2 {
|
|
|
+// boatAnimateScrollView.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+// scrollView.addSubview(boatAnimateScrollView)
|
|
|
+// }else{
|
|
|
+// let imageView = UIImageView.createImageView(imageName: string,contentMode: .scaleAspectFill)
|
|
|
+// imageView.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
|
|
|
+// scrollView.addSubview(imageView)
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// return scrollView
|
|
|
+// }()
|
|
|
+//
|
|
|
+//// lazy var deepseek: UIImageView = {
|
|
|
+//// let deepseek = UIImageView.createImageView(imageName: "boot_deepseek")
|
|
|
+//// deepseek.isHidden = true
|
|
|
+//// return deepseek
|
|
|
+//// }()
|
|
|
+//
|
|
|
+// override func createView() {
|
|
|
+// setNavBarViewHidden(true)
|
|
|
+// self.view.backgroundColor = .black
|
|
|
+// self.view.addSubview(scrollView)
|
|
|
+//
|
|
|
+// let overlayImageView = UIImageView.createImageView(imageName: "boot_overlay",contentMode: .scaleToFill)
|
|
|
+// overlayImageView.frame = CGRectMake(0, k_ScreenHeight-407*kDesignScale, k_ScreenWidth, 407*kDesignScale)
|
|
|
+// view.addSubview(overlayImageView)
|
|
|
+//
|
|
|
+//// deepseek.frame = CGRectMake((k_ScreenWidth-220)/2 , k_ScreenHeight-183-48, 220, 48)
|
|
|
+//// view.addSubview(deepseek)
|
|
|
+//
|
|
|
+// view.addSubview(titleLabel)
|
|
|
+// view.addSubview(continueBtn)
|
|
|
+// continueBtn.snp.makeConstraints { make in
|
|
|
+// make.width.equalTo(continueBtn.width)
|
|
|
+// make.height.equalTo(continueBtn.height)
|
|
|
+// make.bottom.equalTo(-26-k_Height_safeAreaInsetsBottom())
|
|
|
+// make.centerX.equalToSuperview()
|
|
|
+// }
|
|
|
+//
|
|
|
+// titleLabel.snp.makeConstraints { make in
|
|
|
+// make.leading.equalTo(16)
|
|
|
+// make.trailing.equalTo(-16)
|
|
|
+// make.bottom.equalTo(continueBtn.snp.top).offset(-36)
|
|
|
+// }
|
|
|
+//
|
|
|
+// boatAnimateScrollView.startAnimation()
|
|
|
+// }
|
|
|
+// var pageIndex = 2//最大坐标
|
|
|
+// func clickContinue(){
|
|
|
+// index+=1
|
|
|
+// dePrint("clickContinue index=\(index)")
|
|
|
+// titleLabel.text = titleStrings.safeString(At: index)
|
|
|
+//
|
|
|
+//// deepseek.isHidden = !(index == pageIndex)//第二页
|
|
|
+//
|
|
|
+// if index == 1{
|
|
|
+// self.comparisonView0.stopAnimation()
|
|
|
+// self.comparisonView1.startAnimation(direction: .rightToLeft)
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// if index <= pageIndex{
|
|
|
+// scrollView.contentOffset = CGPointMake(k_ScreenWidth*CGFloat(index), 0)
|
|
|
+// }else{
|
|
|
+// let vc = TSPurchaseVC()
|
|
|
+// vc.closePageBlock = { [weak self] in
|
|
|
+// guard let self = self else { return }
|
|
|
+// onComplete()
|
|
|
+// }
|
|
|
+// self.navigationController?.pushViewController(vc, animated: false)
|
|
|
+// AppDelegate.setsTopDayPopPurchase()
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//}
|
|
|
+
|
|
|
+
|
|
|
class TSBootImagesAnimateScrollView: TSBaseView {
|
|
|
|
|
|
lazy var imageScroll1 = createImageScroll(imageName: "boot_img_premium_photos_1", direction: .leftToRight)
|