Commit 15dc6d7a authored by yqz's avatar yqz

首页动画

parent 0d78e6da
{"nm":"Render Me","h":1000,"w":1000,"meta":{"g":"LottieFiles AE 1.0.0","tc":"#ffffff"},"layers":[{"ty":4,"nm":"Blue","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":7},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":9},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":35},{"s":[0],"t":37}]}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[-55.228,0],[0,55.228],[55.228,0]],"o":[[0,55.228],[55.228,0],[0,-55.228],[-55.228,0]],"v":[[-100,0],[0,100],[100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[55.228,0],[0,55.228],[-55.228,0]],"o":[[0,55.228],[-55.228,0],[0,-55.228],[55.228,0]],"v":[[100,0],[0,100],[-100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"tm","nm":"Trim Paths 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[85],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[70],"t":30},{"s":[85],"t":60}]},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":60}]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[90],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100],"t":30},{"s":[90],"t":60}]},"m":2}],"ind":1},{"ty":4,"nm":"Red","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[-55.228,0],[0,55.228],[55.228,0]],"o":[[0,55.228],[55.228,0],[0,-55.228],[-55.228,0]],"v":[[-100,0],[0,100],[100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[55.228,0],[0,55.228],[-55.228,0]],"o":[[0,55.228],[-55.228,0],[0,-55.228],[55.228,0]],"v":[[100,0],[0,100],[-100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"tm","nm":"Trim Paths 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[85],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[70],"t":30},{"s":[85],"t":60}]},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":60}]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[90],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100],"t":30},{"s":[90],"t":60}]},"m":2}],"ind":2},{"ty":4,"nm":"Circles","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"el","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[76,76]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100],"t":34},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[140,140],"t":39},{"s":[100,100],"t":47}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"el","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[76,76]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100],"t":6},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[140,140],"t":11},{"s":[100,100],"t":19}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 1","it":[{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 2","it":[{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":3}],"v":"4.8.0","fr":29.97,"op":60,"ip":0,"assets":[]}
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/> <device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -16,18 +17,16 @@ ...@@ -16,18 +17,16 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="In6-Ib-vMq"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="In6-Ib-vMq">
<rect key="frame" x="0.0" y="0.33333333333331439" width="393" height="851.33333333333348"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<constraints>
<constraint firstAttribute="width" secondItem="In6-Ib-vMq" secondAttribute="height" multiplier="0.4618" id="pro-at-5R5"/>
</constraints>
</view> </view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/> <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstItem="In6-Ib-vMq" firstAttribute="centerX" secondItem="5EZ-qb-Rvc" secondAttribute="centerX" id="Chj-38-1sF"/> <constraint firstAttribute="bottom" secondItem="In6-Ib-vMq" secondAttribute="bottom" id="Fxc-W0-tn1"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="width" secondItem="5EZ-qb-Rvc" secondAttribute="width" id="YGg-mA-X9M"/> <constraint firstItem="In6-Ib-vMq" firstAttribute="top" secondItem="5EZ-qb-Rvc" secondAttribute="top" id="SWH-Pc-co8"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="centerY" secondItem="5EZ-qb-Rvc" secondAttribute="centerY" id="ZB8-n3-NkT"/> <constraint firstItem="In6-Ib-vMq" firstAttribute="trailing" secondItem="vDu-zF-Fre" secondAttribute="trailing" id="Ujk-gr-J7O"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="X8d-PF-cLI"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
......
...@@ -12,10 +12,15 @@ class LauchVC:UIViewController { ...@@ -12,10 +12,15 @@ class LauchVC:UIViewController {
@IBOutlet weak var backView: UIView! @IBOutlet weak var backView: UIView!
lazy var LaunchingView:LottieAnimationView = { private lazy var LaunchingView:LottieAnimationView = {
let animationView = LottieAnimationView(name: "AppLauncher")
let animationView = LottieAnimationView(name: "applicationLauncher") animationView.loopMode = .playOnce
animationView.play()
return animationView
}()
private lazy var LaunchingLoop: LottieAnimationView = {
let animationView = LottieAnimationView(name: "Loading_white")
animationView.loopMode = .loop animationView.loopMode = .loop
animationView.play() animationView.play()
return animationView return animationView
...@@ -24,46 +29,37 @@ class LauchVC:UIViewController { ...@@ -24,46 +29,37 @@ class LauchVC:UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
LaunchingView.frame = backView.bounds
backView.addSubview(LaunchingView) backView.addSubview(LaunchingView)
backView.addSubview(LaunchingLoop)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: { LaunchingView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-80)
make.width.equalToSuperview().offset(-20)
make.height.equalTo(LaunchingView.snp.width).multipliedBy(276/504.0)
}
LaunchingLoop.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.centerY.equalToSuperview().offset(80)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: {
var vc:UIViewController? var vc:UIViewController?
if (UserDef.shard.isShowLanding) { if (UserDef.shard.isShowLanding) {
vc = HomeViewController() vc = HomeViewController()
}else { }else {
let Ssoryboard = UIStoryboard(name: "PermissionVC", bundle: nil) let Ssoryboard = UIStoryboard(name: "PermissionVC", bundle: nil)
if let current = Ssoryboard.instantiateViewController(identifier: "PermissionVCID") as? PermissionVC { if let current = Ssoryboard.instantiateViewController(identifier: "PermissionVCID") as? PermissionVC {
vc = current vc = current
} }
} }
guard let vc else {return} guard let vc else {return}
let nav = BaseNavViewController(rootViewController: vc) let nav = BaseNavViewController(rootViewController: vc)
cWindow?.rootViewController = nav cWindow?.rootViewController = nav
let transition = CATransition() let transition = CATransition()
transition.duration = 0.5 transition.duration = 0.5
// transition.type = CATransitionType.push // 推入动画
transition.subtype = CATransitionSubtype.fromRight // 从左侧推入 transition.subtype = CATransitionSubtype.fromRight // 从左侧推入
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
// 添加动画到 window 的 layer
cWindow?.layer.add(transition, forKey: kCATransition) cWindow?.layer.add(transition, forKey: kCATransition)
// 显示 window
cWindow?.makeKeyAndVisible() cWindow?.makeKeyAndVisible()
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment