react-component / tween-one

Animate One React Element
https://tween-one.vercel.app/
MIT License
380 stars 30 forks source link

API 建议(长期补充) #1

Closed afc163 closed 8 years ago

afc163 commented 8 years ago
  1. vars 改为 animationkeyframes
  2. type={start|pause|reverse|restart} 不是声明式的语法,可以拆为 paused={true|false} reverse={true|false}。可加入时间轴的参数来控制动画的状态。

    <Tween defaultMoment={0}></Tween>
    onChange(moment) {
     this.setState({ moment });
    }
    ...
    <Tween moment={this.state.moment} onChange={this.onChange}></Tween>

    moment 表示动画当前运行到的总时刻

  3. vars 里的 type 感觉没用。
  4. varsonXxxx 可以都提到 Tween 上面的 onChange,相关信息放在参数里。
onChange(moment, currentKeyframe) {
  // currentKeyframe
  // currentKeyframe.currentDuration => currentDuration
}
jljsj33 commented 8 years ago

3。vars 里的 type 有用的。。

jljsj33 commented 8 years ago

4.这块难搞把。。如果单个动画参数是可以的。。。时间轴时就不行了吧。。我当初也想提出来的。。。发现如果有4个,,那我要在第3个参数结束后调用。。。如果在外面不就要算了???

afc163 commented 8 years ago

可以加一个。

onChange(moment, currentKeyframe, index) {
  // currentKeyframe
  // currentKeyframe.currentDuration => currentDuration
}
hi-caicai commented 8 years ago

Please make a simple API

jljsj33 commented 8 years ago

Please speak Chinese!