Browse Source

1.调整动画

wenweiwei 3 years ago
parent
commit
0e41b75f5b

+ 8 - 8
BFCommonKit/Classes/BFBase/View/PQHeartAnimation.swift

@@ -9,7 +9,7 @@
 import UIKit
 
 public class PQHeartAnimation: NSObject {
-    static let angleArr: [CGFloat] = [CGFloat.pi / 4.0, -CGFloat.pi / 4.0, 0.0]
+    static let angleArr: [CGFloat] = [CGFloat.pi / 4.0, -CGFloat.pi / 4.0]
     var isRepeat: Bool = false
 
     static public func showAnimation(isRepeat: Bool = false, point: CGPoint, size: CGFloat = 80.0, baseView: UIView,imageName:String? = nil, completeHander: @escaping (_ isFinised: Bool) -> Void) {
@@ -23,12 +23,12 @@ public class PQHeartAnimation: NSObject {
         baseView.addSubview(imgV)
 
         // 偏移角度
-        var num = 2
-        if !isRepeat {
-            num = Int(arc4random_uniform(3))
-        }
-//      BFLog(message: "num = \(num)")
-        imgV.transform = CGAffineTransform(rotationAngle: angleArr[num])
+//        var num = 2
+//        if !isRepeat {
+//            num = Int(arc4random_uniform(2))
+//        }
+//        debugPrint("num = \(num)")
+//        imgV.transform = CGAffineTransform(rotationAngle: angleArr[num])
         // 放大动画
         let animation = CAKeyframeAnimation(keyPath: "transform.scale")
         animation.duration = 0.5
@@ -36,7 +36,7 @@ public class PQHeartAnimation: NSObject {
         animation.values = [1.3, 0.8, 1.0]
         imgV.layer.add(animation, forKey: "transform.scale")
 
-        UIView.animate(withDuration: 1, delay: 0.5, options: .allowUserInteraction, animations: {
+        UIView.animate(withDuration: 1, delay: 0, options: .allowUserInteraction, animations: {
             imgV.alpha = 0.0
             var newFrame = imgV.frame
             newFrame.origin.x -= (isRepeat ? -cDefaultMargin * 2 : cDefaultMargin)

+ 8 - 0
BFCommonKit/Classes/BFBase/View/PQSlideView.swift

@@ -69,6 +69,10 @@ public class PQSlideView: UIView {
         currentTimeLab.text = "00:00"
         currentTimeLab.textColor = UIColor.white
         currentTimeLab.font = UIFont.systemFont(ofSize: 12)
+        currentTimeLab.layer.shadowColor = UIColor.black.cgColor
+        currentTimeLab.layer.shadowRadius = 4.0
+        currentTimeLab.layer.shadowOpacity = 0.4
+        currentTimeLab.layer.shadowOffset = CGSize.zero
         return currentTimeLab
     }()
 
@@ -77,6 +81,10 @@ public class PQSlideView: UIView {
         totalLab.textColor = UIColor.white
         totalLab.text = "00:00"
         totalLab.font = UIFont.systemFont(ofSize: 12)
+        totalLab.layer.shadowColor = UIColor.black.cgColor
+        totalLab.layer.shadowRadius = 4.0
+        totalLab.layer.shadowOpacity = 0.4
+        totalLab.layer.shadowOffset = CGSize.zero
         return totalLab
     }()