Skip to content

Commit 0868c5b

Browse files
committed
fix(animation): Minor improvements
1 parent 3325984 commit 0868c5b

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["es2015-node4", "stage-0"]
2+
"presets": ["es2015-node4"]
33
}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
work
2626
build
27+
examples
2728
src
2829
test
2930
pids

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ notifications:
77
email: true
88
node_js:
99
- stable
10+
- 5
1011
- 4
1112
before_script:
1213
- npm prune

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ Extend and export your animation:
2929
import Animation from 'kittik-animation-basic';
3030

3131
export default class Print extends Animation {
32-
animate(chunk, cb) {
33-
// Do your animation here and trigger cb
34-
cb(chunk);
32+
animate(shape, cursor) {
33+
// shape is an instance of the Shape that need to animate
34+
// cursor is a Cursor instance that you can use for your own purposes
35+
// animate() method must return Promise that fullfils when animation is done
36+
return Promise.all([
37+
this.animateProperty({shape: shape, property: 'x', startValue: 1, endValue: shape.getX()});
38+
this.animateProperty({shape: shape, property: 'y', startValue: 1, endValue: shape.getY()});
39+
]);
3540
}
3641
}
3742
```

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"devDependencies": {
2626
"babel-cli": "6.4.0",
2727
"babel-preset-es2015-node4": "2.0.2",
28-
"babel-preset-stage-0": "6.3.13",
2928
"chai": "3.4.1",
3029
"coveralls": "2.11.6",
3130
"cz-conventional-changelog": "1.1.5",

0 commit comments

Comments
 (0)