animejs 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/anime.js +14 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -247,7 +247,7 @@ anime({
247
247
  });
248
248
  ```
249
249
 
250
- [Live example on CodePen](http://codepen.io/juliangarnier/pen/d1cf92b2af5bb4166cde511e233e8a0d?editors=0010)
250
+ [Live example on CodePen](http://codepen.io/juliangarnier/pen/zBogap?editors=0010)
251
251
 
252
252
  ## Playback controls
253
253
 
package/anime.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Anime v1.1.1
2
+ * Anime v1.1.3
3
3
  * http://anime-js.com
4
4
  * JavaScript animation engine
5
5
  * Copyright (c) 2016 Julian Garnier
@@ -22,7 +22,7 @@
22
22
  }
23
23
  }(this, function () {
24
24
 
25
- var version = '1.1.1';
25
+ var version = '1.1.3';
26
26
 
27
27
  // Defaults
28
28
 
@@ -69,7 +69,7 @@
69
69
  var eases = {};
70
70
  var names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
71
71
  var functions = {
72
- Sine: function(t) { return 1 - Math.cos( t * Math.PI / 2 ); },
72
+ Sine: function(t) { return 1 + Math.sin(Math.PI / 2 * t - Math.PI / 2); },
73
73
  Circ: function(t) { return 1 - Math.sqrt( 1 - t * t ); },
74
74
  Elastic: function(t, m) {
75
75
  if( t === 0 || t === 1 ) return t;
@@ -391,7 +391,11 @@
391
391
  }
392
392
 
393
393
  var getTweensDuration = function(tweens) {
394
- if (tweens.length) return Math.max.apply(Math, tweens.map(function(tween){ return tween.totalDuration; }));
394
+ return Math.max.apply(Math, tweens.map(function(tween){ return tween.totalDuration; }));
395
+ }
396
+
397
+ var getTweensDelay = function(tweens) {
398
+ return Math.min.apply(Math, tweens.map(function(tween){ return tween.delay; }));
395
399
  }
396
400
 
397
401
  // will-change
@@ -499,7 +503,6 @@
499
503
  anim.animatables[t].target.style[transform] = transforms[t].join(' ');
500
504
  }
501
505
  }
502
- if (anim.settings.update) anim.settings.update(anim);
503
506
  }
504
507
 
505
508
  // Animation
@@ -510,7 +513,8 @@
510
513
  anim.settings = mergeObjects(params, defaultSettings);
511
514
  anim.properties = getProperties(params, anim.settings);
512
515
  anim.tweens = getTweens(anim.animatables, anim.properties);
513
- anim.duration = getTweensDuration(anim.tweens) || params.duration;
516
+ anim.duration = anim.tweens.length ? getTweensDuration(anim.tweens) : params.duration;
517
+ anim.delay = anim.tweens.length ? getTweensDelay(anim.tweens) : params.delay;
514
518
  anim.currentTime = 0;
515
519
  anim.progress = 0;
516
520
  anim.ended = false;
@@ -547,7 +551,10 @@
547
551
  time.current = Math.min(Math.max(time.last + now - time.start, 0), anim.duration);
548
552
  setAnimationProgress(anim, time.current);
549
553
  var s = anim.settings;
550
- if (s.begin && time.current >= s.delay) { s.begin(anim); s.begin = undefined; };
554
+ if (time.current >= anim.delay) {
555
+ if (s.begin) s.begin(anim); s.begin = undefined;
556
+ if (s.update) s.update(anim);
557
+ }
551
558
  if (time.current >= anim.duration) {
552
559
  if (s.loop) {
553
560
  time.start = now;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "animejs",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "JavaScript animation engine",
5
5
  "main": "anime.js",
6
6
  "repository": {