Skip to content

Commit d0c8819

Browse files
committed
Fix example and watch script
1 parent 333712b commit d0c8819

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

‎example/example.dist.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
77
var keyframes_1 = __importDefault(require("../src/keyframes"));
88
var ball = new keyframes_1.default(document.getElementById('ball'));
99
var cbElem = document.getElementById('cb');
10-
var ballMoveAnimation = [{
10+
keyframes_1.default.define([{
1111
name: 'ball-move',
1212
'0%': {
1313
marginLeft: '0',
1414
},
1515
'50%': {
16-
marginLeft: '600',
16+
marginLeft: '600px',
1717
},
1818
'100%': {
1919
marginLeft: '0',
@@ -26,8 +26,7 @@ var ballMoveAnimation = [{
2626
to: {
2727
transform: 'rotate(450deg)',
2828
},
29-
}];
30-
keyframes_1.default.define(ballMoveAnimation);
29+
}]);
3130
window.pause = function () {
3231
ball.pause();
3332
};

‎example/example.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ const ball = new Keyframes(document.getElementById('ball') as HTMLElement);
66
const cbElem = document.getElementById('cb') as HTMLElement;
77

88
// Adding a new animation sequences (keyframe)
9-
const ballMoveAnimation: KeyframeObject[] = [{
9+
Keyframes.define([{
1010
name: 'ball-move',
1111
'0%': {
1212
marginLeft: '0',
1313
},
1414
'50%': {
15-
marginLeft: '600',
15+
marginLeft: '600px',
1616
},
1717
'100%': {
1818
marginLeft: '0',
@@ -25,9 +25,7 @@ const ballMoveAnimation: KeyframeObject[] = [{
2525
to: {
2626
transform: 'rotate(450deg)',
2727
},
28-
}];
29-
30-
Keyframes.define(ballMoveAnimation);
28+
}] as KeyframeObject[]);
3129

3230
(<any>window).pause = () => {
3331
// freeze keyframe animation and kill callback

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"cleanup": "rimraf dist/*.tmp-*",
1414
"buildExample": "npm run browserifyExample && npm run cleanup",
1515
"browserifyExample": "browserify example/example.ts -o example/example.dist.js -p [ tsify --noImplicitAny ]",
16-
"watch": "nodemon --watch example/example.js --watch src --exec 'npm run build && npm run buildExample'",
16+
"watch": "nodemon --watch example/example.ts --watch src --exec 'npm run build && npm run buildExample'",
1717
"versions": "browserify --version && tsc --version && node --version",
1818
"test": "npm run buildMain && mocha test/bootstrap.js --recursive test"
1919
},

0 commit comments

Comments
 (0)