Dosen原创
开始学习Framerjs,边学边翻译,也加了一些我学习过程中的理解。写下来留作以后查阅,看官如果发现有地方写的不对请指出。转载请联系作者。
Events 事件
Events are things that can happen to a layer, mostly triggered by user interaction. With events, you can animate layers based on these interactions. Framer contains many events: click events, touch events, scroll events, drag events and more.
事件是一个层可以发生的事情,大多数时候被用户交互所触发。使用事件,你可以基于这些交互给层创建动画。Framer有很多事件:点击事件,触摸事件,滚动事件,拖动事件,等
One of the most common use cases of events is toggling between a set of states on tap (which is click or touch).
最常见的事件使用案例是,监听点击或触摸切换不同的状态。
Example: Animation Chaining 例子:联动动画
Events can also be used to chain animations. With these events, you can start a new animation after another one ends by listening for the AnimationEnd event.
事件可以被用在联动动画。你可以监听动画的结束事件,并结束后开始另一个新的动画。
Below is a simple example of a chained animation. Every animation gets an AnimationEnd event, so they can be chained infinitely.
下面是一个简单的联动动画例子。这个动画有一个动画监听事件,所以可以无限联动下去。
这段原话翻译的不太好,从代码看就是一个右移的层动画,给它添加了动画结束事件,在右移的动画结束后触发事件,再左移,再右移,再左移.........循环
Summary 概要
Events are things that can happen to a layer
事件是层发生的事情
Events are often used to toggle states
事件经常用于切换状态
Animations can be chained with the AnimationEnd event
动画结束事件可以使动画联动起来。
网友评论