开发者社区> 镜像站> NPM> @platform/util.animate
@platform/util.animate
Programmatic animation.
Last updated 7 days ago by philcockfield .
MIT · Original npm · Tarball · package.json
$ cnpm install @platform/util.animate 
SYNC missed versions from official npm registry.

Module License: MIT NPM

util.animate

Physics based animation. Uses dynamics.js under the hood.

Setup

yarn add @platform/util.animate

Usage

Within a React component:

private animate(target: { value1: number; value2: number }) {
  this.stop$.next();  // Stop currently executing animation (if any).
  const current = () => this.state;
  const duration = 200;
  animation
    .start({ target, current, duration, type: 'easeInOut' })
    .pipe(takeUntil(this.stop$))
    .subscribe({
      next: data => this.setState(data as any),
      complete: () => {
         // Done.
      },
    });
}

Current Tags

  • 0.0.100                                ...           latest (7 days ago)

63 Versions

  • 0.0.100                                ...           7 days ago
  • 0.0.96                                ...           24 days ago
  • 0.0.92                                ...           2 months ago
  • 0.0.90                                ...           3 months ago
  • 0.0.88                                ...           5 months ago
  • 0.0.86                                ...           6 months ago
  • 0.0.85                                ...           6 months ago
  • 0.0.79                                ...           6 months ago
  • 0.0.78                                ...           9 months ago
  • 0.0.75                                ...           9 months ago
  • 0.0.72                                ...           9 months ago
  • 0.0.70                                ...           10 months ago
  • 0.0.69                                ...           10 months ago
  • 0.0.68                                ...           10 months ago
  • 0.0.67                                ...           a year ago
  • 0.0.65                                ...           a year ago
  • 0.0.63                                ...           a year ago
  • 0.0.62                                ...           a year ago
  • 0.0.60                                ...           a year ago
  • 0.0.58                                ...           a year ago
  • 0.0.55                                ...           a year ago
  • 0.0.53                                ...           a year ago
  • 0.0.50                                ...           a year ago
  • 0.0.49                                ...           a year ago
  • 0.0.48                                ...           a year ago
  • 0.0.45                                ...           a year ago
  • 0.0.43                                ...           a year ago
  • 0.0.42                                ...           a year ago
  • 0.0.40                                ...           a year ago
  • 0.0.38                                ...           a year ago
  • 0.0.36                                ...           a year ago
  • 0.0.35                                ...           2 years ago
  • 0.0.34                                ...           2 years ago
  • 0.0.33                                ...           2 years ago
  • 0.0.32                                ...           2 years ago
  • 0.0.31                                ...           2 years ago
  • 0.0.28                                ...           2 years ago
  • 0.0.27                                ...           2 years ago
  • 0.0.26                                ...           2 years ago
  • 0.0.25                                ...           2 years ago
  • 0.0.24                                ...           2 years ago
  • 0.0.23                                ...           2 years ago
  • 0.0.22                                ...           2 years ago
  • 0.0.21                                ...           2 years ago
  • 0.0.20                                ...           2 years ago
  • 0.0.19                                ...           2 years ago
  • 0.0.18                                ...           2 years ago
  • 0.0.17                                ...           2 years ago
  • 0.0.16                                ...           2 years ago
  • 0.0.15                                ...           2 years ago
  • 0.0.14                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 3
Last Day 3
Last Week 13
Last Month 29
Dependencies (2)
Dev Dependencies (2)