-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- UIVisualEffectView로 blur 뷰 구현 - 해당 뷰 contentiView에 텍스트와 정지 이미지 추가 - 피그마 디자인과 유사하게 하기 위해서 alpha값 추가함
- Loading branch information
Showing
1 changed file
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// | ||
// PauseView.swift | ||
// Falling | ||
// | ||
// Created by SeungMin on 1/31/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import DSKit | ||
|
||
open class PauseView: TFBaseView { | ||
private lazy var blurView: UIVisualEffectView = { | ||
let effect = UIBlurEffect(style: .regular) | ||
|
||
let visualEffectView = UIVisualEffectView(effect: effect) | ||
visualEffectView.frame = bounds | ||
visualEffectView.layer.cornerRadius = 20 | ||
visualEffectView.clipsToBounds = true | ||
visualEffectView.backgroundColor = DSKitAsset.Color.blur.color | ||
// TODO: alpha값은 더 투명하게 보이게 하기 위해 임의로 설정 | ||
visualEffectView.alpha = 0.88 | ||
return visualEffectView | ||
}() | ||
|
||
private lazy var stackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .vertical | ||
stackView.alignment = .center | ||
stackView.distribution = .fill | ||
stackView.spacing = 32 | ||
return stackView | ||
}() | ||
|
||
private lazy var pauseImageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.image = DSKitAsset.Image.Icons.pause.image | ||
return imageView | ||
}() | ||
|
||
private lazy var labelStackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .vertical | ||
stackView.spacing = 4 | ||
return stackView | ||
}() | ||
|
||
private lazy var titleLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "잠시 쉬었다 가시겠어요?" | ||
label.font = UIFont.thtH4Sb | ||
label.textAlignment = .center | ||
label.textColor = DSKitAsset.Color.neutral50.color | ||
return label | ||
}() | ||
|
||
private lazy var subTitleLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "저희가 잠시 홀드 해 놓을게요." | ||
label.font = UIFont.thtP1M | ||
label.textAlignment = .center | ||
label.textColor = DSKitAsset.Color.neutral50.color | ||
return label | ||
}() | ||
|
||
private lazy var resumeLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "더블탭으로 다시 시작하기" | ||
label.font = UIFont.thtP1M | ||
label.textAlignment = .center | ||
label.textColor = DSKitAsset.Color.neutral50.color | ||
return label | ||
}() | ||
|
||
open override func makeUI() { | ||
self.addSubview(blurView) | ||
self.blurView.contentView.addSubview(stackView) | ||
self.blurView.contentView.addSubview(resumeLabel) | ||
|
||
stackView.addArrangedSubviews([ | ||
pauseImageView, | ||
labelStackView | ||
]) | ||
|
||
pauseImageView.snp.makeConstraints { | ||
$0.width.height.equalTo(66) | ||
} | ||
resumeLabel.snp.makeConstraints { | ||
$0.centerX.equalToSuperview() | ||
$0.bottom.equalToSuperview().inset(20) | ||
} | ||
|
||
labelStackView.addArrangedSubviews([ | ||
titleLabel, | ||
subTitleLabel | ||
]) | ||
|
||
stackView.snp.makeConstraints { | ||
$0.centerX.centerY.equalToSuperview() | ||
} | ||
} | ||
} |