GithubHelp home page GithubHelp logo

elflyanimationdemo's Introduction

ELFlyAnimationDemo

高仿飞聊红包打赏动画

效果图如下 animation.gif

原理

动画主要分为几部分

  • 散射粒子动画 (CAEmitterLayer + 金币图画)
  • 循环滚动的RMB动画 (Timer)
  • 到达某几个档位时的LOTTIE动画 (对应档位的LOTTIE json动画)
  • 持续的震动效果 AudioServicesPlaySystemSound

注意

  • 散射动画的具体散射形状 角度 速率 自转 重力等效果自己在CAEmitterLayer 和 CAEmitterCell 设置
  • 飞聊动画在会话cell上,为节省资源开销,全局使用一份动画
  • 长按手势的几个状态处理,当长按时,push下一个页面可能会有问题,注意UIGestureRecognizerStateCancelled的处理
  • AudioServicesDisposeSystemSoundID(1519) 为短振,注意在iPhone6 以上机型是没有震动效果的

有不明白的在评论中回复即可,对你有帮助的话麻烦star一下哦

elflyanimationdemo's People

Contributors

elegantliar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.