Skip to content

Commit

Permalink
Merge pull request #1246 from wakmusic/1245-apply-glass-effect-on-wak…
Browse files Browse the repository at this point in the history
…-music-playlist

🔀 :: (#1245) SingleAction 버튼 Blur 적용
  • Loading branch information
yongbeomkwak authored Aug 28, 2024
2 parents 6f33b0a + 61151d5 commit d9105f6
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public final class SingleActionButtonView: UIView {
$0.backgroundColor = .white.withAlphaComponent(0.4)
}

private let translucentView = UIVisualEffectView(effect: UIBlurEffect(style: .regular)).then {
$0.layer.cornerRadius = 8
$0.clipsToBounds = true
}

private let imageView = UIImageView().then {
$0.contentMode = .scaleAspectFit
}
Expand All @@ -34,7 +39,7 @@ public final class SingleActionButtonView: UIView {
public init(frame: CGRect, topSpacing: CGFloat = 16) {
self.topSpacing = topSpacing
super.init(frame: frame)
backgroundColor = DesignSystemAsset.BlueGrayColor.gray100.color
backgroundColor = .clear
addView()
setLayout()
addAction()
Expand Down Expand Up @@ -66,6 +71,7 @@ private extension SingleActionButtonView {
}

func addView() {
addSubview(translucentView)
addSubview(baseView)
addSubview(imageView)
addSubview(label)
Expand All @@ -92,5 +98,9 @@ private extension SingleActionButtonView {
label.snp.makeConstraints {
$0.center.equalTo(button.snp.center)
}

translucentView.snp.makeConstraints {
$0.edges.equalTo(baseView)
}
}
}

0 comments on commit d9105f6

Please sign in to comment.