From 0938ad6f40acfb9ffafb059e364a6de467a89be6 Mon Sep 17 00:00:00 2001
From: Tobias K
Date: Sat, 19 Jan 2019 21:58:50 +0100
Subject: [PATCH 01/34] fixed value in documentation
---
documentation/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..c2d1e774 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -2460,7 +2460,7 @@ Time Offsets
.add({
targets: '.offsets-demo .el.triangle',
translateX: 250,
-}, 0); // absolute offset
+}, 400); // absolute offset
/*DEMO*/
}
From 357678e4b9f542b55614705d0d294fe262cfc238 Mon Sep 17 00:00:00 2001
From: Nick Pannuto
Date: Thu, 24 Jan 2019 01:47:58 -0500
Subject: [PATCH 02/34] degres -> degrees
Small typo
---
documentation/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..fe3b3702 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -3215,7 +3215,7 @@ Motion path
'angle' |
myPath('angle') |
- Return the current angle value in 'degres' of the SVG path |
+ Return the current angle value in 'degrees' of the SVG path |
From 52d83ea6499fac19123905cd615b4c101346d61d Mon Sep 17 00:00:00 2001
From: ItsJonQ
Date: Sun, 27 Jan 2019 10:10:39 -0500
Subject: [PATCH 03/34] README: Update import/require path in examples
This update fixes the import/require paths for the `animejs` module when
using it from `node_modules`.
Since the paths are defined in `package.json`, node will use
`node_modules/animejs/lib` as the root :)
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3719dbac..11ac71a8 100644
--- a/README.md
+++ b/README.md
@@ -37,13 +37,13 @@ or manual [download](https://github.com/juliangarnier/anime/archive/master.zip).
#### ES6 modules
```javascript
-import anime from 'lib/anime.es.js';
+import anime from 'anime';
```
#### CommonJS
```javascript
-const anime = require('lib/anime.js');
+const anime = require('anime');
```
#### File include
From 8fc492ac7b956e54eee3280d2fa710a126dbaa5b Mon Sep 17 00:00:00 2001
From: Riley Gowan
Date: Sun, 27 Jan 2019 10:21:58 -0500
Subject: [PATCH 04/34] Change variable name from seekCild -> seekChild
---
lib/anime.es.js | 6 +++---
lib/anime.js | 6 +++---
src/index.js | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/anime.es.js b/lib/anime.es.js
index e25346f3..035eed68 100644
--- a/lib/anime.es.js
+++ b/lib/anime.es.js
@@ -951,15 +951,15 @@ function anime(params) {
lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
}
- function seekCild(time, child) {
+ function seekChild(time, child) {
if (child) { child.seek(time - child.timelineOffset); }
}
function syncInstanceChildren(time) {
if (!instance.reversePlayback) {
- for (var i = 0; i < childrenLength; i++) { seekCild(time, children[i]); }
+ for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }
} else {
- for (var i$1 = childrenLength; i$1--;) { seekCild(time, children[i$1]); }
+ for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }
}
}
diff --git a/lib/anime.js b/lib/anime.js
index 7d3d1c1c..b65bee3f 100644
--- a/lib/anime.js
+++ b/lib/anime.js
@@ -953,15 +953,15 @@ function anime(params) {
lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
}
- function seekCild(time, child) {
+ function seekChild(time, child) {
if (child) { child.seek(time - child.timelineOffset); }
}
function syncInstanceChildren(time) {
if (!instance.reversePlayback) {
- for (var i = 0; i < childrenLength; i++) { seekCild(time, children[i]); }
+ for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }
} else {
- for (var i$1 = childrenLength; i$1--;) { seekCild(time, children[i$1]); }
+ for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }
}
}
diff --git a/src/index.js b/src/index.js
index f06be1ea..e053928e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -931,15 +931,15 @@ function anime(params = {}) {
lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
}
- function seekCild(time, child) {
+ function seekChild(time, child) {
if (child) child.seek(time - child.timelineOffset);
}
function syncInstanceChildren(time) {
if (!instance.reversePlayback) {
- for (let i = 0; i < childrenLength; i++) seekCild(time, children[i]);
+ for (let i = 0; i < childrenLength; i++) seekChild(time, children[i]);
} else {
- for (let i = childrenLength; i--;) seekCild(time, children[i]);
+ for (let i = childrenLength; i--;) seekChild(time, children[i]);
}
}
From ce0fcd404f3618218c994d0ce380478c1dc0ea7a Mon Sep 17 00:00:00 2001
From: whitelight
Date: Wed, 30 Jan 2019 17:34:51 -0500
Subject: [PATCH 05/34] Just fixing a little error I noticed ;)
---
src/index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/index.js b/src/index.js
index 7caf091c..df536205 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1024,7 +1024,7 @@ function anime(params = {}) {
const insTime = adjustTime(engineTime);
instance.progress = minMax((insTime / insDuration) * 100, 0, 100);
instance.reversePlayback = insTime < instance.currentTime;
- if (children) { syncInstanceChildren(insTime); };
+ if (children) { syncInstanceChildren(insTime); }
if (!instance.began && instance.currentTime > 0) {
instance.began = true;
setCallback('begin');
@@ -1270,4 +1270,4 @@ anime.easing = parseEasings;
anime.penner = penner;
anime.random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
-export default anime;
\ No newline at end of file
+export default anime;
From b3f851ac53487dd2f1d8ae746f05f5bd4dce804e Mon Sep 17 00:00:00 2001
From: Eric NICOLAS
Date: Sat, 2 Feb 2019 22:20:05 +0100
Subject: [PATCH 06/34] Fix a couple of typos
Most importantly, `their is` became `there is`.
---
documentation/index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..251f11ed 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -1419,7 +1419,7 @@ Animation keyframes
Animation keyframes are defined using an Array, within the keyframes
property.
- If there is no duration specified inside the keyframes, each keyframe duration will be equal to the animation total duration divided by the number of keyframes.
+ If there is no duration specified inside the keyframes, each keyframe duration will be equal to the animation's total duration divided by the number of keyframes.
@@ -1467,7 +1467,7 @@ Property keyframes
Similar to animation keyframes, property keyframes are defined using an Array of property Object. Property keyframes allow overlapping animations since each property have its own keyframes array.
- If their is no duration specified inside the keyframes, each keyframe duration will be equal to the animation total duration divided by the number of keyframes.
+ If there is no duration specified inside the keyframes, each keyframe duration will be equal to the animation's total duration divided by the number of keyframes.
From ba35b74830354e3abd3c0fabe3f653586378b3b6 Mon Sep 17 00:00:00 2001
From: Lawrence Gosset
Date: Sun, 17 Feb 2019 17:08:19 +0000
Subject: [PATCH 07/34] =?UTF-8?q?Fix=20documentation=20typo=20degres=20?=
=?UTF-8?q?=E2=86=92=20degrees?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
documentation/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..fe3b3702 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -3215,7 +3215,7 @@ Motion path
'angle' |
myPath('angle') |
- Return the current angle value in 'degres' of the SVG path |
+ Return the current angle value in 'degrees' of the SVG path |
From 77f129bcd160b190e3250e74d406a9048e27cfef Mon Sep 17 00:00:00 2001
From: YuriFA
Date: Tue, 26 Feb 2019 17:33:58 +0300
Subject: [PATCH 08/34] Fix getParentSvgEl with return parent of svg element
but not root svg element
---
src/index.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/index.js b/src/index.js
index 7caf091c..d26403f4 100644
--- a/src/index.js
+++ b/src/index.js
@@ -126,7 +126,7 @@ function elastic(amplitude = 1, period = .5) {
const a = minMax(amplitude, 1, 10);
const p = minMax(period, .1, 2);
return t => {
- return (t === 0 || t === 1) ? t :
+ return (t === 0 || t === 1) ? t :
-a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
}
}
@@ -262,7 +262,7 @@ const penner = (() => {
]
}
- let eases = {
+ let eases = {
linear: [0.250, 0.250, 0.750, 0.750]
}
@@ -523,7 +523,7 @@ function getRectLength(el) {
function getLineLength(el) {
return getDistance(
- {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
+ {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
{x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}
);
}
@@ -569,8 +569,8 @@ function setDashoffset(el) {
function getParentSvgEl(el) {
let parentEl = el.parentNode;
while (is.svg(parentEl)) {
- parentEl = parentEl.parentNode;
if (!is.svg(parentEl.parentNode)) break;
+ parentEl = parentEl.parentNode;
}
return parentEl;
}
@@ -858,7 +858,7 @@ let pausedInstances = [];
let raf;
const engine = (() => {
- function play() {
+ function play() {
raf = requestAnimationFrame(step);
}
function step(t) {
From 93cb4b638ba49818f7aec619e49cd217f77f37c0 Mon Sep 17 00:00:00 2001
From: Yuri FA
Date: Wed, 27 Feb 2019 10:07:58 +0300
Subject: [PATCH 09/34] Revert removed spaces
---
src/index.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/index.js b/src/index.js
index d26403f4..946d2af6 100644
--- a/src/index.js
+++ b/src/index.js
@@ -126,7 +126,7 @@ function elastic(amplitude = 1, period = .5) {
const a = minMax(amplitude, 1, 10);
const p = minMax(period, .1, 2);
return t => {
- return (t === 0 || t === 1) ? t :
+ return (t === 0 || t === 1) ? t :
-a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
}
}
@@ -262,7 +262,7 @@ const penner = (() => {
]
}
- let eases = {
+ let eases = {
linear: [0.250, 0.250, 0.750, 0.750]
}
@@ -523,7 +523,7 @@ function getRectLength(el) {
function getLineLength(el) {
return getDistance(
- {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
+ {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
{x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}
);
}
@@ -858,7 +858,7 @@ let pausedInstances = [];
let raf;
const engine = (() => {
- function play() {
+ function play() {
raf = requestAnimationFrame(step);
}
function step(t) {
@@ -1270,4 +1270,4 @@ anime.easing = parseEasings;
anime.penner = penner;
anime.random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
-export default anime;
\ No newline at end of file
+export default anime;
From df81656741c26e00c2916156674f9714fa962d87 Mon Sep 17 00:00:00 2001
From: Johan Nordberg
Date: Thu, 28 Feb 2019 15:20:31 +0100
Subject: [PATCH 10/34] Set progress to duration instead of 0 when reversed
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 7caf091c..43f42840 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1093,7 +1093,7 @@ function anime(params = {}) {
childrenLength = children.length;
for (let i = childrenLength; i--;) instance.children[i].reset();
if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) instance.remaining++;
- setAnimationsProgress(0);
+ setAnimationsProgress(instance.reversed ? instance.duration : 0);
}
// Set Value helper
From 091cb4249b59605c41b06b84678491085c1f26ff Mon Sep 17 00:00:00 2001
From: Ari Lotter
Date: Wed, 6 Mar 2019 13:54:46 -0500
Subject: [PATCH 11/34] Allow numeric values with leading '+' and/or with
exponent parts. Fixes #551
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 7caf091c..a661b543 100644
--- a/src/index.js
+++ b/src/index.js
@@ -625,7 +625,7 @@ function getPathProgress(path, progress) {
// Decompose value
function decomposeValue(val, unit) {
- const rgx = /-?\d*\.?\d+/g;
+ const rgx = /[-+]?\d*\.?\d+([eE][-+]?\d+)?/g;
const value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';
return {
original: value,
From d6f3a3c82a5197095c1059f255eb03c1b5a69b3c Mon Sep 17 00:00:00 2001
From: Daniel Ruf
Date: Fri, 8 Mar 2019 08:50:11 +0100
Subject: [PATCH 12/34] Remove duplicate CSS properties and rename flex-pack to
justify-content
---
documentation/assets/css/animejs.css | 1 -
documentation/assets/css/documentation.css | 1 -
documentation/assets/css/website.css | 1 -
documentation/assets/js/website.js | 2 +-
4 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/documentation/assets/css/animejs.css b/documentation/assets/css/animejs.css
index 337af6d9..ef09535c 100644
--- a/documentation/assets/css/animejs.css
+++ b/documentation/assets/css/animejs.css
@@ -63,7 +63,6 @@
margin: 0;
padding: 0;
border: 0;
- font-size: 100%;
font: inherit;
vertical-align: baseline;
}
diff --git a/documentation/assets/css/documentation.css b/documentation/assets/css/documentation.css
index e36df003..a0f9f4bb 100644
--- a/documentation/assets/css/documentation.css
+++ b/documentation/assets/css/documentation.css
@@ -367,7 +367,6 @@ article {
z-index: 1;
display: flex;
align-items: center;
- flex-pack: center;
justify-content: center;
width: 100%;
min-height: 200px;
diff --git a/documentation/assets/css/website.css b/documentation/assets/css/website.css
index 856fb844..be7e3fac 100644
--- a/documentation/assets/css/website.css
+++ b/documentation/assets/css/website.css
@@ -114,7 +114,6 @@ a:hover .arrow:before,
.nav-bar-content {
display: flex;
flex-shrink: 0;
- flex-direction: row;
grid-column: 1/13;
justify-content: space-between;
flex-direction: row;
diff --git a/documentation/assets/js/website.js b/documentation/assets/js/website.js
index bcd0ad8d..35c28f9c 100644
--- a/documentation/assets/js/website.js
+++ b/documentation/assets/js/website.js
@@ -235,7 +235,7 @@ var logoAnimation = (function() {
targets: '.dot',
scale: 1,
rotate: '1turn',
- scaleY: {value: .5, delay: 0, duration: 150, delay: 230},
+ scaleY: {value: .5, duration: 150, delay: 230},
translateX: 430,
translateY: [
{value: 244, duration: 100},
From fce16371e3f84d40f40bae0911518af655731931 Mon Sep 17 00:00:00 2001
From: Chris Brown
Date: Thu, 28 Mar 2019 16:37:09 +0000
Subject: [PATCH 13/34] Update anime.running reference when clearing array on
visibilitychange event
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 7caf091c..5bc3a484 100644
--- a/src/index.js
+++ b/src/index.js
@@ -890,7 +890,7 @@ function handleVisibilityChange() {
if (document.hidden) {
activeInstances.forEach(ins => ins.pause());
pausedInstances = activeInstances.slice(0);
- activeInstances = [];
+ anime.running = activeInstances = [];
} else {
pausedInstances.forEach(ins => ins.play());
}
From 75320f30e1878f2a8cd6dae7b96dd0467fc9805f Mon Sep 17 00:00:00 2001
From: Dimitris Raptis
Date: Tue, 16 Apr 2019 10:45:39 +0300
Subject: [PATCH 14/34] Fix small typo
Change the world "indivudaly" to "individually".
---
documentation/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..cbbb309a 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -293,7 +293,7 @@ CSS Properties
CSS Transforms
- Animate CSS transforms properties indivudaly.
+ Animate CSS transforms properties individually.
It's possible to specify different timing for each transforms properties, more details in the specific property parameters section.
From 32b4f5acaab145da2e0c6a2884510919eb52beb9 Mon Sep 17 00:00:00 2001
From: Eugene Kopich
Date: Thu, 6 Jun 2019 12:00:42 +0300
Subject: [PATCH 15/34] correct sign
---
documentation/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..a7bc5114 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -1204,7 +1204,7 @@ Relative
easing: 'easeInOutSine'
},
rotate: {
- value: '+=2turn', // 0 * 2 = '2turn'
+ value: '+=2turn', // 0 + 2 = '2turn'
duration: 1800,
easing: 'easeInOutSine'
},
From 1556b756986ce4a4cc884032de06c9bb3a31e998 Mon Sep 17 00:00:00 2001
From: Eugene Kopich
Date: Thu, 6 Jun 2019 12:13:17 +0300
Subject: [PATCH 16/34] Hexadecimal
---
documentation/index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..537dc39d 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -1220,7 +1220,7 @@ Relative
Colors
- anime.js accepts and converts Haxadecimal, RGB, RGBA, HSL, and HSLA color values.
+ anime.js accepts and converts Hexadecimal, RGB, RGBA, HSL, and HSLA color values.
CSS color codes ( e.g. : 'red', 'yellow', 'aqua'
) are not supported.
@@ -1231,7 +1231,7 @@
Colors
Example |
- Haxadecimal |
+ Hexadecimal |
'#FFF' or '#FFFFFF' |
From 31fae15557e2c345420ce7d4ca0867ef1aa3fbac Mon Sep 17 00:00:00 2001
From: Julian Garnier
Date: Tue, 23 Jul 2019 10:32:59 +0200
Subject: [PATCH 17/34] create v3.1.0
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 706559ce..a4cd3e40 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "animejs",
- "version": "3.0.1",
+ "version": "3.1.0",
"homepage": "http://animejs.com",
"repository": "juliangarnier/anime",
"description": "JavaScript animation engine",
From f814d5b5f3ca1f725062d517d7224b8ac4508252 Mon Sep 17 00:00:00 2001
From: Julian Garnier
Date: Tue, 23 Jul 2019 10:37:34 +0200
Subject: [PATCH 18/34] Easings refactoring + add Bounce easing
---
documentation/index.html | 47 +++++++++++++++---
lib/anime.es.js | 100 +++++++++++++++------------------------
lib/anime.js | 100 +++++++++++++++------------------------
lib/anime.min.js | 4 +-
src/index.js | 92 +++++++++++++----------------------
5 files changed, 150 insertions(+), 193 deletions(-)
diff --git a/documentation/index.html b/documentation/index.html
index a7824b73..bb9a74e8 100644
--- a/documentation/index.html
+++ b/documentation/index.html
@@ -3436,6 +3436,11 @@ Penner's functions
'easeOutBack' |
'easeInOutBack' |
+
+ 'easeInBounce' |
+ 'easeOutBounce' |
+ 'easeInOutBounce' |
+
@@ -3445,10 +3450,39 @@
Penner's functions
/*DEMO*/
var demoContentEl = document.querySelector('.penner-equations-demo');
var fragment = document.createDocumentFragment();
+var easingNames = [
+ 'easeInQuad',
+ 'easeInCubic',
+ 'easeInQuart',
+ 'easeInQuint',
+ 'easeInSine',
+ 'easeInExpo',
+ 'easeInCirc',
+ 'easeInBack',
+ 'easeInBounce',
+ 'easeInOutQuad',
+ 'easeInOutCubic',
+ 'easeInOutQuart',
+ 'easeInOutQuint',
+ 'easeInOutSine',
+ 'easeInOutExpo',
+ 'easeInOutCirc',
+ 'easeInOutBack',
+ 'easeInOutBounce',
+ 'easeOutQuad',
+ 'easeOutCubic',
+ 'easeOutQuart',
+ 'easeOutQuint',
+ 'easeOutSine',
+ 'easeOutExpo',
+ 'easeOutCirc',
+ 'easeOutBack',
+ 'easeOutBounce'
+]
function createEasingDemo(easing) {
var demoEl = document.createElement('div');
- demoEl.classList.add('stretched','square','el');
+ demoEl.classList.add('stretched','square','el', 'easing-'+easing);
anime({
targets: demoEl,
translateX: 250,
@@ -3456,16 +3490,15 @@ Penner's functions
loop: true,
delay: 200,
endDelay: 200,
- easing: easing,
+ duration: 2000,
+ easing: easing
});
fragment.appendChild(demoEl);
}
-for (var easeName in anime.penner) {
- if (Array.isArray(anime.penner[easeName])) {
- createEasingDemo(easeName);
- }
-}
+easingNames.forEach(function(easeName) {
+ createEasingDemo(easeName);
+});
demoContentEl.innerHTML = '';
demoContentEl.appendChild(fragment);
diff --git a/lib/anime.es.js b/lib/anime.es.js
index 2a26911b..9c52d3b1 100644
--- a/lib/anime.es.js
+++ b/lib/anime.es.js
@@ -1,5 +1,5 @@
/*
- * anime.js v3.0.1
+ * anime.js v3.1.0
* (c) 2019 Julian Garnier
* Released under the MIT license
* animejs.com
@@ -127,20 +127,6 @@ function spring(string, duration) {
}
-// Elastic easing adapted from jQueryUI http://api.jqueryui.com/easings/
-
-function elastic(amplitude, period) {
- if ( amplitude === void 0 ) amplitude = 1;
- if ( period === void 0 ) period = .5;
-
- var a = minMax(amplitude, 1, 10);
- var p = minMax(period, .1, 2);
- return function (t) {
- return (t === 0 || t === 1) ? t :
- -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
- }
-}
-
// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
function steps(steps) {
@@ -234,57 +220,45 @@ var bezier = (function () {
var penner = (function () {
- var names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic'];
-
- // Approximated Penner equations http://matthewlein.com/ceaser/
-
- var curves = {
- In: [
- [0.550, 0.085, 0.680, 0.530], /* inQuad */
- [0.550, 0.055, 0.675, 0.190], /* inCubic */
- [0.895, 0.030, 0.685, 0.220], /* inQuart */
- [0.755, 0.050, 0.855, 0.060], /* inQuint */
- [0.470, 0.000, 0.745, 0.715], /* inSine */
- [0.950, 0.050, 0.795, 0.035], /* inExpo */
- [0.600, 0.040, 0.980, 0.335], /* inCirc */
- [0.600,-0.280, 0.735, 0.045], /* inBack */
- elastic /* inElastic */
- ],
- Out: [
- [0.250, 0.460, 0.450, 0.940], /* outQuad */
- [0.215, 0.610, 0.355, 1.000], /* outCubic */
- [0.165, 0.840, 0.440, 1.000], /* outQuart */
- [0.230, 1.000, 0.320, 1.000], /* outQuint */
- [0.390, 0.575, 0.565, 1.000], /* outSine */
- [0.190, 1.000, 0.220, 1.000], /* outExpo */
- [0.075, 0.820, 0.165, 1.000], /* outCirc */
- [0.175, 0.885, 0.320, 1.275], /* outBack */
- function (a, p) { return function (t) { return 1 - elastic(a, p)(1 - t); }; } /* outElastic */
- ],
- InOut: [
- [0.455, 0.030, 0.515, 0.955], /* inOutQuad */
- [0.645, 0.045, 0.355, 1.000], /* inOutCubic */
- [0.770, 0.000, 0.175, 1.000], /* inOutQuart */
- [0.860, 0.000, 0.070, 1.000], /* inOutQuint */
- [0.445, 0.050, 0.550, 0.950], /* inOutSine */
- [1.000, 0.000, 0.000, 1.000], /* inOutExpo */
- [0.785, 0.135, 0.150, 0.860], /* inOutCirc */
- [0.680,-0.550, 0.265, 1.550], /* inOutBack */
- function (a, p) { return function (t) { return t < .5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2; }; } /* inOutElastic */
- ]
+ // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
+
+ var eases = { linear: function () { return function (t) { return t; }; } };
+
+ var functionEasings = {
+ Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
+ Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },
+ Back: function () { return function (t) { return t * t * (3 * t - 2); }; },
+ Bounce: function () { return function (t) {
+ var pow2, b = 4;
+ while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}
+ return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
+ }; },
+ Elastic: function (amplitude, period) {
+ if ( amplitude === void 0 ) amplitude = 1;
+ if ( period === void 0 ) period = .5;
+
+ var a = minMax(amplitude, 1, 10);
+ var p = minMax(period, .1, 2);
+ return function (t) {
+ return (t === 0 || t === 1) ? t :
+ -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
+ }
+ }
};
- var eases = {
- linear: [0.250, 0.250, 0.750, 0.750]
- };
+ var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
- var loop = function ( coords ) {
- curves[coords].forEach(function (ease, i) {
- eases['ease'+coords+names[i]] = ease;
- });
- };
+ baseEasings.forEach(function (name, i) {
+ functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
+ });
- for (var coords in curves) loop( coords );
+ Object.keys(functionEasings).forEach(function (name) {
+ var easeIn = functionEasings[name];
+ eases['easeIn' + name] = easeIn;
+ eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };
+ eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
+ 1 - easeIn(a, b)(t * -2 + 2) / 2; }; };
+ });
return eases;
@@ -299,7 +273,7 @@ function parseEasings(easing, duration) {
case 'spring' : return spring(easing, duration);
case 'cubicBezier' : return applyArguments(bezier, args);
case 'steps' : return applyArguments(steps, args);
- default : return is.fnc(ease) ? applyArguments(ease, args) : applyArguments(bezier, ease);
+ default : return applyArguments(ease, args);
}
}
diff --git a/lib/anime.js b/lib/anime.js
index 7bde123d..f48317e5 100644
--- a/lib/anime.js
+++ b/lib/anime.js
@@ -1,5 +1,5 @@
/*
- * anime.js v3.0.1
+ * anime.js v3.1.0
* (c) 2019 Julian Garnier
* Released under the MIT license
* animejs.com
@@ -129,20 +129,6 @@ function spring(string, duration) {
}
-// Elastic easing adapted from jQueryUI http://api.jqueryui.com/easings/
-
-function elastic(amplitude, period) {
- if ( amplitude === void 0 ) amplitude = 1;
- if ( period === void 0 ) period = .5;
-
- var a = minMax(amplitude, 1, 10);
- var p = minMax(period, .1, 2);
- return function (t) {
- return (t === 0 || t === 1) ? t :
- -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
- }
-}
-
// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
function steps(steps) {
@@ -236,57 +222,45 @@ var bezier = (function () {
var penner = (function () {
- var names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic'];
-
- // Approximated Penner equations http://matthewlein.com/ceaser/
-
- var curves = {
- In: [
- [0.550, 0.085, 0.680, 0.530], /* inQuad */
- [0.550, 0.055, 0.675, 0.190], /* inCubic */
- [0.895, 0.030, 0.685, 0.220], /* inQuart */
- [0.755, 0.050, 0.855, 0.060], /* inQuint */
- [0.470, 0.000, 0.745, 0.715], /* inSine */
- [0.950, 0.050, 0.795, 0.035], /* inExpo */
- [0.600, 0.040, 0.980, 0.335], /* inCirc */
- [0.600,-0.280, 0.735, 0.045], /* inBack */
- elastic /* inElastic */
- ],
- Out: [
- [0.250, 0.460, 0.450, 0.940], /* outQuad */
- [0.215, 0.610, 0.355, 1.000], /* outCubic */
- [0.165, 0.840, 0.440, 1.000], /* outQuart */
- [0.230, 1.000, 0.320, 1.000], /* outQuint */
- [0.390, 0.575, 0.565, 1.000], /* outSine */
- [0.190, 1.000, 0.220, 1.000], /* outExpo */
- [0.075, 0.820, 0.165, 1.000], /* outCirc */
- [0.175, 0.885, 0.320, 1.275], /* outBack */
- function (a, p) { return function (t) { return 1 - elastic(a, p)(1 - t); }; } /* outElastic */
- ],
- InOut: [
- [0.455, 0.030, 0.515, 0.955], /* inOutQuad */
- [0.645, 0.045, 0.355, 1.000], /* inOutCubic */
- [0.770, 0.000, 0.175, 1.000], /* inOutQuart */
- [0.860, 0.000, 0.070, 1.000], /* inOutQuint */
- [0.445, 0.050, 0.550, 0.950], /* inOutSine */
- [1.000, 0.000, 0.000, 1.000], /* inOutExpo */
- [0.785, 0.135, 0.150, 0.860], /* inOutCirc */
- [0.680,-0.550, 0.265, 1.550], /* inOutBack */
- function (a, p) { return function (t) { return t < .5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2; }; } /* inOutElastic */
- ]
+ // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
+
+ var eases = { linear: function () { return function (t) { return t; }; } };
+
+ var functionEasings = {
+ Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
+ Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },
+ Back: function () { return function (t) { return t * t * (3 * t - 2); }; },
+ Bounce: function () { return function (t) {
+ var pow2, b = 4;
+ while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}
+ return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
+ }; },
+ Elastic: function (amplitude, period) {
+ if ( amplitude === void 0 ) amplitude = 1;
+ if ( period === void 0 ) period = .5;
+
+ var a = minMax(amplitude, 1, 10);
+ var p = minMax(period, .1, 2);
+ return function (t) {
+ return (t === 0 || t === 1) ? t :
+ -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
+ }
+ }
};
- var eases = {
- linear: [0.250, 0.250, 0.750, 0.750]
- };
+ var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
- var loop = function ( coords ) {
- curves[coords].forEach(function (ease, i) {
- eases['ease'+coords+names[i]] = ease;
- });
- };
+ baseEasings.forEach(function (name, i) {
+ functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
+ });
- for (var coords in curves) loop( coords );
+ Object.keys(functionEasings).forEach(function (name) {
+ var easeIn = functionEasings[name];
+ eases['easeIn' + name] = easeIn;
+ eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };
+ eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
+ 1 - easeIn(a, b)(t * -2 + 2) / 2; }; };
+ });
return eases;
@@ -301,7 +275,7 @@ function parseEasings(easing, duration) {
case 'spring' : return spring(easing, duration);
case 'cubicBezier' : return applyArguments(bezier, args);
case 'steps' : return applyArguments(steps, args);
- default : return is.fnc(ease) ? applyArguments(ease, args) : applyArguments(bezier, ease);
+ default : return applyArguments(ease, args);
}
}
diff --git a/lib/anime.min.js b/lib/anime.min.js
index 3f0baf1c..0f84643a 100644
--- a/lib/anime.min.js
+++ b/lib/anime.min.js
@@ -1,8 +1,8 @@
/*
- * anime.js v3.0.1
+ * anime.js v3.1.0
* (c) 2019 Julian Garnier
* Released under the MIT license
* animejs.com
*/
-!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):n.anime=e()}(this,function(){"use strict";var n={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},e={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},r=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective"],t={CSS:{},springs:{}};function a(n,e,r){return Math.min(Math.max(n,e),r)}function o(n,e){return n.indexOf(e)>-1}function i(n,e){return n.apply(null,e)}var u={arr:function(n){return Array.isArray(n)},obj:function(n){return o(Object.prototype.toString.call(n),"Object")},pth:function(n){return u.obj(n)&&n.hasOwnProperty("totalLength")},svg:function(n){return n instanceof SVGElement},inp:function(n){return n instanceof HTMLInputElement},dom:function(n){return n.nodeType||u.svg(n)},str:function(n){return"string"==typeof n},fnc:function(n){return"function"==typeof n},und:function(n){return void 0===n},hex:function(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)},rgb:function(n){return/^rgb/.test(n)},hsl:function(n){return/^hsl/.test(n)},col:function(n){return u.hex(n)||u.rgb(n)||u.hsl(n)},key:function(r){return!n.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&"targets"!==r&&"keyframes"!==r}};function s(n){var e=/\(([^)]+)\)/.exec(n);return e?e[1].split(",").map(function(n){return parseFloat(n)}):[]}function c(n,e){var r=s(n),o=a(u.und(r[0])?1:r[0],.1,100),i=a(u.und(r[1])?100:r[1],.1,100),c=a(u.und(r[2])?10:r[2],.1,100),f=a(u.und(r[3])?0:r[3],.1,100),l=Math.sqrt(i/o),d=c/(2*Math.sqrt(i*o)),p=d<1?l*Math.sqrt(1-d*d):0,v=1,h=d<1?(d*l-f)/p:-f+l;function g(n){var r=e?e*n/1e3:n;return r=d<1?Math.exp(-r*d*l)*(v*Math.cos(p*r)+h*Math.sin(p*r)):(v+h*r)*Math.exp(-r*l),0===n||1===n?n:1-r}return e?g:function(){var e=t.springs[n];if(e)return e;for(var r=0,a=0;;)if(1===g(r+=1/6)){if(++a>=16)break}else a=0;var o=r*(1/6)*1e3;return t.springs[n]=o,o}}function f(n,e){void 0===n&&(n=1),void 0===e&&(e=.5);var r=a(n,1,10),t=a(e,.1,2);return function(n){return 0===n||1===n?n:-r*Math.pow(2,10*(n-1))*Math.sin((n-1-t/(2*Math.PI)*Math.asin(1/r))*(2*Math.PI)/t)}}function l(n){return void 0===n&&(n=10),function(e){return Math.round(e*n)*(1/n)}}var d=function(){var n=11,e=1/(n-1);function r(n,e){return 1-3*e+3*n}function t(n,e){return 3*e-6*n}function a(n){return 3*n}function o(n,e,o){return((r(e,o)*n+t(e,o))*n+a(e))*n}function i(n,e,o){return 3*r(e,o)*n*n+2*t(e,o)*n+a(e)}return function(r,t,a,u){if(0<=r&&r<=1&&0<=a&&a<=1){var s=new Float32Array(n);if(r!==t||a!==u)for(var c=0;c=.001?function(n,e,r,t){for(var a=0;a<4;++a){var u=i(e,r,t);if(0===u)return e;e-=(o(e,r,t)-n)/u}return e}(t,l,r,a):0===d?l:function(n,e,r,t,a){for(var i,u,s=0;(i=o(u=e+(r-e)/2,t,a)-n)>0?r=u:e=u,Math.abs(i)>1e-7&&++s<10;);return u}(t,u,u+e,r,a)}}}(),p=function(){var n=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],e={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],f],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(n,e){return function(r){return 1-f(n,e)(1-r)}}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(n,e){return function(r){return r<.5?f(n,e)(2*r)/2:1-f(n,e)(-2*r+2)/2}}]},r={linear:[.25,.25,.75,.75]},t=function(t){e[t].forEach(function(e,a){r["ease"+t+n[a]]=e})};for(var a in e)t(a);return r}();function v(n,e){if(u.fnc(n))return n;var r=n.split("(")[0],t=p[r],a=s(n);switch(r){case"spring":return c(n,e);case"cubicBezier":return i(d,a);case"steps":return i(l,a);default:return u.fnc(t)?i(t,a):i(d,t)}}function h(n){try{return document.querySelectorAll(n)}catch(n){return}}function g(n,e){for(var r=n.length,t=arguments.length>=2?arguments[1]:void 0,a=[],o=0;o1&&(r-=1),r<1/6?n+6*(e-n)*r:r<.5?e:r<2/3?n+(e-n)*(2/3-r)*6:n}if(0==i)e=r=t=u;else{var f=u<.5?u*(1+i):u+i-u*i,l=2*u-f;e=c(l,f,o+1/3),r=c(l,f,o),t=c(l,f,o-1/3)}return"rgba("+255*e+","+255*r+","+255*t+","+s+")"}(n):void 0;var e,r,t,a}function C(n){var e=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(n);if(e)return e[2]}function O(n,e){return u.fnc(n)?n(e.target,e.id,e.total):n}function P(n,e){return n.getAttribute(e)}function I(n,e,r){if(b([r,"deg","rad","turn"],C(e)))return e;var a=t.CSS[e+r];if(!u.und(a))return a;var o=document.createElement(n.tagName),i=n.parentNode&&n.parentNode!==document?n.parentNode:document.body;i.appendChild(o),o.style.position="absolute",o.style.width=100+r;var s=100/o.offsetWidth;i.removeChild(o);var c=s*parseFloat(e);return t.CSS[e+r]=c,c}function B(n,e,r){if(e in n.style){var t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=n.style[e]||getComputedStyle(n).getPropertyValue(t)||"0";return r?I(n,a,r):a}}function D(n,e){return u.dom(n)&&!u.inp(n)&&(P(n,e)||u.svg(n)&&n[e])?"attribute":u.dom(n)&&b(r,e)?"transform":u.dom(n)&&"transform"!==e&&B(n,e)?"css":null!=n[e]?"object":void 0}function T(n){if(u.dom(n)){for(var e,r=n.style.transform||"",t=/(\w+)\(([^)]*)\)/g,a=new Map;e=t.exec(r);)a.set(e[1],e[2]);return a}}function F(n,e,r,t){var a,i=o(e,"scale")?1:0+(o(a=e,"translate")||"perspective"===a?"px":o(a,"rotate")||o(a,"skew")?"deg":void 0),u=T(n).get(e)||i;return r&&(r.transforms.list.set(e,u),r.transforms.last=e),t?I(n,u,t):u}function N(n,e,r,t){switch(D(n,e)){case"transform":return F(n,e,t,r);case"css":return B(n,e,r);case"attribute":return P(n,e);default:return n[e]||0}}function A(n,e){var r=/^(\*=|\+=|-=)/.exec(n);if(!r)return n;var t=C(n)||0,a=parseFloat(e),o=parseFloat(n.replace(r[0],""));switch(r[0][0]){case"+":return a+o+t;case"-":return a-o+t;case"*":return a*o+t}}function E(n,e){if(u.col(n))return k(n);var r=C(n),t=r?n.substr(0,n.length-r.length):n;return e&&!/\s/g.test(n)?t+e:t}function L(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function S(n){for(var e,r=n.points,t=0,a=0;a0&&(t+=L(e,o)),e=o}return t}function j(n){if(n.getTotalLength)return n.getTotalLength();switch(n.tagName.toLowerCase()){case"circle":return o=n,2*Math.PI*P(o,"r");case"rect":return 2*P(a=n,"width")+2*P(a,"height");case"line":return L({x:P(t=n,"x1"),y:P(t,"y1")},{x:P(t,"x2"),y:P(t,"y2")});case"polyline":return S(n);case"polygon":return r=(e=n).points,S(e)+L(r.getItem(r.numberOfItems-1),r.getItem(0))}var e,r,t,a,o}function q(n,e){var r=e||{},t=r.el||function(n){for(var e=n.parentNode;u.svg(e)&&(e=e.parentNode,u.svg(e.parentNode)););return e}(n),a=t.getBoundingClientRect(),o=P(t,"viewBox"),i=a.width,s=a.height,c=r.viewBox||(o?o.split(" "):[0,0,i,s]);return{el:t,viewBox:c,x:c[0]/1,y:c[1]/1,w:i/c[2],h:s/c[3]}}function $(n,e){function r(r){void 0===r&&(r=0);var t=e+r>=1?e+r:0;return n.el.getPointAtLength(t)}var t=q(n.el,n.svg),a=r(),o=r(-1),i=r(1);switch(n.property){case"x":return(a.x-t.x)*t.w;case"y":return(a.y-t.y)*t.h;case"angle":return 180*Math.atan2(i.y-o.y,i.x-o.x)/Math.PI}}function X(n,e){var r=/-?\d*\.?\d+/g,t=E(u.pth(n)?n.totalLength:n,e)+"";return{original:t,numbers:t.match(r)?t.match(r).map(Number):[0],strings:u.str(n)||e?t.split(r):[]}}function Y(n){return g(n?m(u.arr(n)?n.map(y):y(n)):[],function(n,e,r){return r.indexOf(n)===e})}function Z(n){var e=Y(n);return e.map(function(n,r){return{target:n,id:r,total:e.length,transforms:{list:T(n)}}})}function Q(n,e){var r=x(e);if(/^spring/.test(r.easing)&&(r.duration=c(r.easing)),u.arr(n)){var t=n.length;2===t&&!u.obj(n[0])?n={value:n}:u.fnc(e.duration)||(r.duration=e.duration/t)}var a=u.arr(n)?n:[n];return a.map(function(n,r){var t=u.obj(n)&&!u.pth(n)?n:{value:n};return u.und(t.delay)&&(t.delay=r?0:e.delay),u.und(t.endDelay)&&(t.endDelay=r===a.length-1?e.endDelay:0),t}).map(function(n){return w(n,r)})}function V(n,e){var r=[],t=e.keyframes;for(var a in t&&(e=w(function(n){for(var e=g(m(n.map(function(n){return Object.keys(n)})),function(n){return u.key(n)}).reduce(function(n,e){return n.indexOf(e)<0&&n.push(e),n},[]),r={},t=function(t){var a=e[t];r[a]=n.map(function(n){var e={};for(var r in n)u.key(r)?r==a&&(e.value=n[r]):e[r]=n[r];return e})},a=0;a-1&&(U.splice(o,1),r=U.length)}else a.tick(e);t++}n()}else K=cancelAnimationFrame(K)}return n}();function en(r){void 0===r&&(r={});var t,o=0,i=0,u=0,s=0,c=null;function f(n){var e=window.Promise&&new Promise(function(n){return c=n});return n.finished=e,e}var l,d,p,v,h,m,y,b,x=(d=M(n,l=r),p=M(e,l),v=V(p,l),h=Z(l.targets),m=R(h,v),y=W(m,p),b=J,J++,w(d,{id:b,children:[],animatables:h,animations:m,duration:y.duration,delay:y.delay,endDelay:y.endDelay}));f(x);function k(){var n=x.direction;"alternate"!==n&&(x.direction="normal"!==n?"normal":"reverse"),x.reversed=!x.reversed,t.forEach(function(n){return n.reversed=x.reversed})}function C(n){return x.reversed?x.duration-n:n}function O(){o=0,i=C(x.currentTime)*(1/en.speed)}function P(n,e){e&&e.seek(n-e.timelineOffset)}function I(n){for(var e=0,r=x.animations,t=r.length;e2||(b=Math.round(b*p)/p)),v.push(b)}var k=d.length;if(k){m=d[0];for(var C=0;C0&&(x.began=!0,B("begin"),B("loopBegin")),d<=r&&0!==x.currentTime&&I(0),(d>=l&&x.currentTime!==e||!e)&&I(e),d>r&&d=e&&(i=0,x.remaining&&!0!==x.remaining&&x.remaining--,x.remaining?(o=u,B("loopComplete"),B("loopBegin"),"alternate"===x.direction&&k()):(x.paused=!0,x.completed||(x.completed=!0,B("loopComplete"),B("complete"),!x.passThrough&&"Promise"in window&&(c(),f(x)))))}return x.reset=function(){var n=x.direction;x.passThrough=!1,x.currentTime=0,x.progress=0,x.paused=!0,x.began=!1,x.changeBegan=!1,x.completed=!1,x.changeCompleted=!1,x.reversePlayback=!1,x.reversed="reverse"===n,x.remaining=x.loop,t=x.children;for(var e=s=t.length;e--;)x.children[e].reset();(x.reversed&&!0!==x.loop||"alternate"===n&&1===x.loop)&&x.remaining++,I(0)},x.set=function(n,e){return G(n,e),x},x.tick=function(n){u=n,o||(o=u),D((u+(i-o))*en.speed)},x.seek=function(n){D(C(n))},x.pause=function(){x.paused=!0,O()},x.play=function(){x.paused&&(x.completed&&x.reset(),x.paused=!1,U.push(x),O(),K||nn())},x.reverse=function(){k(),O()},x.restart=function(){x.reset(),x.play()},x.reset(),x.autoplay&&x.play(),x}function rn(n,e){for(var r=e.length;r--;)b(n,e[r].animatable.target)&&e.splice(r,1)}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){document.hidden?(U.forEach(function(n){return n.pause()}),_=U.slice(0),U=[]):_.forEach(function(n){return n.play()})}),en.version="3.0.1",en.speed=1,en.running=U,en.remove=function(n){for(var e=Y(n),r=U.length;r--;){var t=U[r],a=t.animations,o=t.children;rn(e,a);for(var i=o.length;i--;){var u=o[i],s=u.animations;rn(e,s),s.length||u.children.length||o.splice(i,1)}a.length||o.length||t.pause()}},en.get=N,en.set=G,en.convertPx=I,en.path=function(n,e){var r=u.str(n)?h(n)[0]:n,t=e||100;return function(n){return{property:n,el:r,svg:q(r),totalLength:j(r)*(t/100)}}},en.setDashoffset=function(n){var e=j(n);return n.setAttribute("stroke-dasharray",e),e},en.stagger=function(n,e){void 0===e&&(e={});var r=e.direction||"normal",t=e.easing?v(e.easing):null,a=e.grid,o=e.axis,i=e.from||0,s="first"===i,c="center"===i,f="last"===i,l=u.arr(n),d=l?parseFloat(n[0]):parseFloat(n),p=l?parseFloat(n[1]):0,h=C(l?n[1]:n)||0,g=e.start||0+(l?d:0),m=[],y=0;return function(n,e,u){if(s&&(i=0),c&&(i=(u-1)/2),f&&(i=u-1),!m.length){for(var v=0;v-1&&U.splice(o,1);for(var c=0;c-1}function u(n,e){return n.apply(null,e)}var i={arr:function(n){return Array.isArray(n)},obj:function(n){return o(Object.prototype.toString.call(n),"Object")},pth:function(n){return i.obj(n)&&n.hasOwnProperty("totalLength")},svg:function(n){return n instanceof SVGElement},inp:function(n){return n instanceof HTMLInputElement},dom:function(n){return n.nodeType||i.svg(n)},str:function(n){return"string"==typeof n},fnc:function(n){return"function"==typeof n},und:function(n){return void 0===n},hex:function(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)},rgb:function(n){return/^rgb/.test(n)},hsl:function(n){return/^hsl/.test(n)},col:function(n){return i.hex(n)||i.rgb(n)||i.hsl(n)},key:function(t){return!n.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function c(n){var e=/\(([^)]+)\)/.exec(n);return e?e[1].split(",").map(function(n){return parseFloat(n)}):[]}function s(n,e){var t=c(n),o=a(i.und(t[0])?1:t[0],.1,100),u=a(i.und(t[1])?100:t[1],.1,100),s=a(i.und(t[2])?10:t[2],.1,100),f=a(i.und(t[3])?0:t[3],.1,100),l=Math.sqrt(u/o),d=s/(2*Math.sqrt(u*o)),p=d<1?l*Math.sqrt(1-d*d):0,h=1,v=d<1?(d*l-f)/p:-f+l;function g(n){var t=e?e*n/1e3:n;return t=d<1?Math.exp(-t*d*l)*(h*Math.cos(p*t)+v*Math.sin(p*t)):(h+v*t)*Math.exp(-t*l),0===n||1===n?n:1-t}return e?g:function(){var e=r.springs[n];if(e)return e;for(var t=0,a=0;;)if(1===g(t+=1/6)){if(++a>=16)break}else a=0;var o=t*(1/6)*1e3;return r.springs[n]=o,o}}function f(n){return void 0===n&&(n=10),function(e){return Math.round(e*n)*(1/n)}}var l,d,p=function(){var n=11,e=1/(n-1);function t(n,e){return 1-3*e+3*n}function r(n,e){return 3*e-6*n}function a(n){return 3*n}function o(n,e,o){return((t(e,o)*n+r(e,o))*n+a(e))*n}function u(n,e,o){return 3*t(e,o)*n*n+2*r(e,o)*n+a(e)}return function(t,r,a,i){if(0<=t&&t<=1&&0<=a&&a<=1){var c=new Float32Array(n);if(t!==r||a!==i)for(var s=0;s=.001?function(n,e,t,r){for(var a=0;a<4;++a){var i=u(e,t,r);if(0===i)return e;e-=(o(e,t,r)-n)/i}return e}(r,l,t,a):0===d?l:function(n,e,t,r,a){for(var u,i,c=0;(u=o(i=e+(t-e)/2,r,a)-n)>0?t=i:e=i,Math.abs(u)>1e-7&&++c<10;);return i}(r,i,i+e,t,a)}}}(),h=(l={linear:function(){return function(n){return n}}},d={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var e,t=4;n<((e=Math.pow(2,--t))-1)/11;);return 1/Math.pow(4,3-t)-7.5625*Math.pow((3*e-2)/22-n,2)}},Elastic:function(n,e){void 0===n&&(n=1),void 0===e&&(e=.5);var t=a(n,1,10),r=a(e,.1,2);return function(n){return 0===n||1===n?n:-t*Math.pow(2,10*(n-1))*Math.sin((n-1-r/(2*Math.PI)*Math.asin(1/t))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach(function(n,e){d[n]=function(){return function(n){return Math.pow(n,e+2)}}}),Object.keys(d).forEach(function(n){var e=d[n];l["easeIn"+n]=e,l["easeOut"+n]=function(n,t){return function(r){return 1-e(n,t)(1-r)}},l["easeInOut"+n]=function(n,t){return function(r){return r<.5?e(n,t)(2*r)/2:1-e(n,t)(-2*r+2)/2}}}),l);function v(n,e){if(i.fnc(n))return n;var t=n.split("(")[0],r=h[t],a=c(n);switch(t){case"spring":return s(n,e);case"cubicBezier":return u(p,a);case"steps":return u(f,a);default:return u(r,a)}}function g(n){try{return document.querySelectorAll(n)}catch(n){return}}function m(n,e){for(var t=n.length,r=arguments.length>=2?arguments[1]:void 0,a=[],o=0;o1&&(t-=1),t<1/6?n+6*(e-n)*t:t<.5?e:t<2/3?n+(e-n)*(2/3-t)*6:n}if(0==u)e=t=r=i;else{var f=i<.5?i*(1+u):i+u-i*u,l=2*i-f;e=s(l,f,o+1/3),t=s(l,f,o),r=s(l,f,o-1/3)}return"rgba("+255*e+","+255*t+","+255*r+","+c+")"}(n):void 0;var e,t,r,a}function C(n){var e=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(n);if(e)return e[2]}function P(n,e){return i.fnc(n)?n(e.target,e.id,e.total):n}function I(n,e){return n.getAttribute(e)}function B(n,e,t){if(M([t,"deg","rad","turn"],C(e)))return e;var a=r.CSS[e+t];if(!i.und(a))return a;var o=document.createElement(n.tagName),u=n.parentNode&&n.parentNode!==document?n.parentNode:document.body;u.appendChild(o),o.style.position="absolute",o.style.width=100+t;var c=100/o.offsetWidth;u.removeChild(o);var s=c*parseFloat(e);return r.CSS[e+t]=s,s}function D(n,e,t){if(e in n.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=n.style[e]||getComputedStyle(n).getPropertyValue(r)||"0";return t?B(n,a,t):a}}function T(n,e){return i.dom(n)&&!i.inp(n)&&(I(n,e)||i.svg(n)&&n[e])?"attribute":i.dom(n)&&M(t,e)?"transform":i.dom(n)&&"transform"!==e&&D(n,e)?"css":null!=n[e]?"object":void 0}function E(n){if(i.dom(n)){for(var e,t=n.style.transform||"",r=/(\w+)\(([^)]*)\)/g,a=new Map;e=r.exec(t);)a.set(e[1],e[2]);return a}}function F(n,e,t,r){var a,u=o(e,"scale")?1:0+(o(a=e,"translate")||"perspective"===a?"px":o(a,"rotate")||o(a,"skew")?"deg":void 0),i=E(n).get(e)||u;return t&&(t.transforms.list.set(e,i),t.transforms.last=e),r?B(n,i,r):i}function N(n,e,t,r){switch(T(n,e)){case"transform":return F(n,e,r,t);case"css":return D(n,e,t);case"attribute":return I(n,e);default:return n[e]||0}}function A(n,e){var t=/^(\*=|\+=|-=)/.exec(n);if(!t)return n;var r=C(n)||0,a=parseFloat(e),o=parseFloat(n.replace(t[0],""));switch(t[0][0]){case"+":return a+o+r;case"-":return a-o+r;case"*":return a*o+r}}function L(n,e){if(i.col(n))return O(n);var t=C(n),r=t?n.substr(0,n.length-t.length):n;return e&&!/\s/g.test(n)?r+e:r}function j(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function S(n){for(var e,t=n.points,r=0,a=0;a0&&(r+=j(e,o)),e=o}return r}function q(n){if(n.getTotalLength)return n.getTotalLength();switch(n.tagName.toLowerCase()){case"circle":return o=n,2*Math.PI*I(o,"r");case"rect":return 2*I(a=n,"width")+2*I(a,"height");case"line":return j({x:I(r=n,"x1"),y:I(r,"y1")},{x:I(r,"x2"),y:I(r,"y2")});case"polyline":return S(n);case"polygon":return t=(e=n).points,S(e)+j(t.getItem(t.numberOfItems-1),t.getItem(0))}var e,t,r,a,o}function $(n,e){var t=e||{},r=t.el||function(n){for(var e=n.parentNode;i.svg(e)&&(e=e.parentNode,i.svg(e.parentNode)););return e}(n),a=r.getBoundingClientRect(),o=I(r,"viewBox"),u=a.width,c=a.height,s=t.viewBox||(o?o.split(" "):[0,0,u,c]);return{el:r,viewBox:s,x:s[0]/1,y:s[1]/1,w:u/s[2],h:c/s[3]}}function X(n,e){function t(t){void 0===t&&(t=0);var r=e+t>=1?e+t:0;return n.el.getPointAtLength(r)}var r=$(n.el,n.svg),a=t(),o=t(-1),u=t(1);switch(n.property){case"x":return(a.x-r.x)*r.w;case"y":return(a.y-r.y)*r.h;case"angle":return 180*Math.atan2(u.y-o.y,u.x-o.x)/Math.PI}}function Y(n,e){var t=/-?\d*\.?\d+/g,r=L(i.pth(n)?n.totalLength:n,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:i.str(n)||e?r.split(t):[]}}function Z(n){return m(n?y(i.arr(n)?n.map(b):b(n)):[],function(n,e,t){return t.indexOf(n)===e})}function Q(n){var e=Z(n);return e.map(function(n,t){return{target:n,id:t,total:e.length,transforms:{list:E(n)}}})}function V(n,e){var t=x(e);if(/^spring/.test(t.easing)&&(t.duration=s(t.easing)),i.arr(n)){var r=n.length;2===r&&!i.obj(n[0])?n={value:n}:i.fnc(e.duration)||(t.duration=e.duration/r)}var a=i.arr(n)?n:[n];return a.map(function(n,t){var r=i.obj(n)&&!i.pth(n)?n:{value:n};return i.und(r.delay)&&(r.delay=t?0:e.delay),i.und(r.endDelay)&&(r.endDelay=t===a.length-1?e.endDelay:0),r}).map(function(n){return k(n,t)})}function z(n,e){var t=[],r=e.keyframes;for(var a in r&&(e=k(function(n){for(var e=m(y(n.map(function(n){return Object.keys(n)})),function(n){return i.key(n)}).reduce(function(n,e){return n.indexOf(e)<0&&n.push(e),n},[]),t={},r=function(r){var a=e[r];t[a]=n.map(function(n){var e={};for(var t in n)i.key(t)?t==a&&(e.value=n[t]):e[t]=n[t];return e})},a=0;a-1&&(_.splice(o,1),t=_.length)}else a.tick(e);r++}n()}else U=cancelAnimationFrame(U)}return n}();function tn(t){void 0===t&&(t={});var r,o=0,u=0,i=0,c=0,s=null;function f(n){var e=window.Promise&&new Promise(function(n){return s=n});return n.finished=e,e}var l,d,p,h,v,g,y,b,M=(d=w(n,l=t),p=w(e,l),h=z(p,l),v=Q(l.targets),g=W(v,h),y=J(g,p),b=K,K++,k(d,{id:b,children:[],animatables:v,animations:g,duration:y.duration,delay:y.delay,endDelay:y.endDelay}));f(M);function x(){var n=M.direction;"alternate"!==n&&(M.direction="normal"!==n?"normal":"reverse"),M.reversed=!M.reversed,r.forEach(function(n){return n.reversed=M.reversed})}function O(n){return M.reversed?M.duration-n:n}function C(){o=0,u=O(M.currentTime)*(1/tn.speed)}function P(n,e){e&&e.seek(n-e.timelineOffset)}function I(n){for(var e=0,t=M.animations,r=t.length;e2||(b=Math.round(b*p)/p)),h.push(b)}var k=d.length;if(k){g=d[0];for(var O=0;O0&&(M.began=!0,B("begin"),B("loopBegin")),d<=t&&0!==M.currentTime&&I(0),(d>=l&&M.currentTime!==e||!e)&&I(e),d>t&&d=e&&(u=0,M.remaining&&!0!==M.remaining&&M.remaining--,M.remaining?(o=i,B("loopComplete"),B("loopBegin"),"alternate"===M.direction&&x()):(M.paused=!0,M.completed||(M.completed=!0,B("loopComplete"),B("complete"),!M.passThrough&&"Promise"in window&&(s(),f(M)))))}return M.reset=function(){var n=M.direction;M.passThrough=!1,M.currentTime=0,M.progress=0,M.paused=!0,M.began=!1,M.changeBegan=!1,M.completed=!1,M.changeCompleted=!1,M.reversePlayback=!1,M.reversed="reverse"===n,M.remaining=M.loop,r=M.children;for(var e=c=r.length;e--;)M.children[e].reset();(M.reversed&&!0!==M.loop||"alternate"===n&&1===M.loop)&&M.remaining++,I(0)},M.set=function(n,e){return R(n,e),M},M.tick=function(n){i=n,o||(o=i),D((i+(u-o))*tn.speed)},M.seek=function(n){D(O(n))},M.pause=function(){M.paused=!0,C()},M.play=function(){M.paused&&(M.completed&&M.reset(),M.paused=!1,_.push(M),C(),U||en())},M.reverse=function(){x(),C()},M.restart=function(){M.reset(),M.play()},M.reset(),M.autoplay&&M.play(),M}function rn(n,e){for(var t=e.length;t--;)M(n,e[t].animatable.target)&&e.splice(t,1)}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){document.hidden?(_.forEach(function(n){return n.pause()}),nn=_.slice(0),_=[]):nn.forEach(function(n){return n.play()})}),tn.version="3.0.1",tn.speed=1,tn.running=_,tn.remove=function(n){for(var e=Z(n),t=_.length;t--;){var r=_[t],a=r.animations,o=r.children;rn(e,a);for(var u=o.length;u--;){var i=o[u],c=i.animations;rn(e,c),c.length||i.children.length||o.splice(u,1)}a.length||o.length||r.pause()}},tn.get=N,tn.set=R,tn.convertPx=B,tn.path=function(n,e){var t=i.str(n)?g(n)[0]:n,r=e||100;return function(n){return{property:n,el:t,svg:$(t),totalLength:q(t)*(r/100)}}},tn.setDashoffset=function(n){var e=q(n);return n.setAttribute("stroke-dasharray",e),e},tn.stagger=function(n,e){void 0===e&&(e={});var t=e.direction||"normal",r=e.easing?v(e.easing):null,a=e.grid,o=e.axis,u=e.from||0,c="first"===u,s="center"===u,f="last"===u,l=i.arr(n),d=l?parseFloat(n[0]):parseFloat(n),p=l?parseFloat(n[1]):0,h=C(l?n[1]:n)||0,g=e.start||0+(l?d:0),m=[],y=0;return function(n,e,i){if(c&&(u=0),s&&(u=(i-1)/2),f&&(u=i-1),!m.length){for(var v=0;v-1&&_.splice(o,1);for(var s=0;s {
- return (t === 0 || t === 1) ? t :
- -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
- }
-}
-
// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
function steps(steps = 10) {
@@ -222,55 +211,42 @@ const bezier = (() => {
const penner = (() => {
- const names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic'];
-
- // Approximated Penner equations http://matthewlein.com/ceaser/
-
- const curves = {
- In: [
- [0.550, 0.085, 0.680, 0.530], /* inQuad */
- [0.550, 0.055, 0.675, 0.190], /* inCubic */
- [0.895, 0.030, 0.685, 0.220], /* inQuart */
- [0.755, 0.050, 0.855, 0.060], /* inQuint */
- [0.470, 0.000, 0.745, 0.715], /* inSine */
- [0.950, 0.050, 0.795, 0.035], /* inExpo */
- [0.600, 0.040, 0.980, 0.335], /* inCirc */
- [0.600,-0.280, 0.735, 0.045], /* inBack */
- elastic /* inElastic */
- ],
- Out: [
- [0.250, 0.460, 0.450, 0.940], /* outQuad */
- [0.215, 0.610, 0.355, 1.000], /* outCubic */
- [0.165, 0.840, 0.440, 1.000], /* outQuart */
- [0.230, 1.000, 0.320, 1.000], /* outQuint */
- [0.390, 0.575, 0.565, 1.000], /* outSine */
- [0.190, 1.000, 0.220, 1.000], /* outExpo */
- [0.075, 0.820, 0.165, 1.000], /* outCirc */
- [0.175, 0.885, 0.320, 1.275], /* outBack */
- (a, p) => t => 1 - elastic(a, p)(1 - t) /* outElastic */
- ],
- InOut: [
- [0.455, 0.030, 0.515, 0.955], /* inOutQuad */
- [0.645, 0.045, 0.355, 1.000], /* inOutCubic */
- [0.770, 0.000, 0.175, 1.000], /* inOutQuart */
- [0.860, 0.000, 0.070, 1.000], /* inOutQuint */
- [0.445, 0.050, 0.550, 0.950], /* inOutSine */
- [1.000, 0.000, 0.000, 1.000], /* inOutExpo */
- [0.785, 0.135, 0.150, 0.860], /* inOutCirc */
- [0.680,-0.550, 0.265, 1.550], /* inOutBack */
- (a, p) => t => t < .5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2 /* inOutElastic */
- ]
+ // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
+
+ const eases = { linear: () => t => t };
+
+ const functionEasings = {
+ Sine: () => t => 1 - Math.cos(t * Math.PI / 2),
+ Circ: () => t => 1 - Math.sqrt(1 - t * t),
+ Back: () => t => t * t * (3 * t - 2),
+ Bounce: () => t => {
+ let pow2, b = 4;
+ while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {};
+ return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
+ },
+ Elastic: (amplitude = 1, period = .5) => {
+ const a = minMax(amplitude, 1, 10);
+ const p = minMax(period, .1, 2);
+ return t => {
+ return (t === 0 || t === 1) ? t :
+ -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
+ }
+ }
}
- let eases = {
- linear: [0.250, 0.250, 0.750, 0.750]
- }
+ const baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
- for (let coords in curves) {
- curves[coords].forEach((ease, i) => {
- eases['ease'+coords+names[i]] = ease;
- });
- }
+ baseEasings.forEach((name, i) => {
+ functionEasings[name] = () => t => Math.pow(t, i + 2);
+ });
+
+ Object.keys(functionEasings).forEach(name => {
+ const easeIn = functionEasings[name];
+ eases['easeIn' + name] = easeIn;
+ eases['easeOut' + name] = (a, b) => t => 1 - easeIn(a, b)(1 - t);
+ eases['easeInOut' + name] = (a, b) => t => t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
+ 1 - easeIn(a, b)(t * -2 + 2) / 2;
+ });
return eases;
@@ -285,7 +261,7 @@ function parseEasings(easing, duration) {
case 'spring' : return spring(easing, duration);
case 'cubicBezier' : return applyArguments(bezier, args);
case 'steps' : return applyArguments(steps, args);
- default : return is.fnc(ease) ? applyArguments(ease, args) : applyArguments(bezier, ease);
+ default : return applyArguments(ease, args);
}
}
From 2d214342da5c5ef3f5109108a88ae80d9457eaab Mon Sep 17 00:00:00 2001
From: Julian Garnier
Date: Tue, 23 Jul 2019 10:37:39 +0200
Subject: [PATCH 19/34] Update documentation
---
documentation/examples/advanced-staggering-2.html | 2 +-
documentation/examples/advanced-staggering.html | 2 +-
documentation/examples/anime-stagger-demo.html | 2 +-
documentation/examples/anime-staggering-demo.html | 13 ++++++++++---
4 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/documentation/examples/advanced-staggering-2.html b/documentation/examples/advanced-staggering-2.html
index 90715b32..172c77ef 100644
--- a/documentation/examples/advanced-staggering-2.html
+++ b/documentation/examples/advanced-staggering-2.html
@@ -93,7 +93,7 @@
nextIndex = anime.random(0, numberOfElements);
- anime.setValue('.cursor', {
+ anime.set('.cursor', {
translateX: anime.stagger('-38px', {grid: [24, 11], from: index, axis: 'x'}),
translateY: anime.stagger('-38px', {grid: [24, 11], from: index, axis: 'y'})
});
diff --git a/documentation/examples/advanced-staggering.html b/documentation/examples/advanced-staggering.html
index 941b6a3a..cfa8d372 100644
--- a/documentation/examples/advanced-staggering.html
+++ b/documentation/examples/advanced-staggering.html
@@ -92,7 +92,7 @@
nextIndex = anime.random(0, numberOfElements);
- anime.setValue('.cursor', {
+ anime.set('.cursor', {
translateX: anime.stagger('-1rem', {grid: [16, 16], from: index, axis: 'x'}),
translateY: anime.stagger('-1rem', {grid: [16, 16], from: index, axis: 'y'})
});
diff --git a/documentation/examples/anime-stagger-demo.html b/documentation/examples/anime-stagger-demo.html
index ce348915..728c72d6 100644
--- a/documentation/examples/anime-stagger-demo.html
+++ b/documentation/examples/anime-stagger-demo.html
@@ -82,7 +82,7 @@
delay: anime.stagger(10, {from: 'center'})
})
.add({
- scale: anime.stagger([2.5, 1], {from: 'center', easing: 'easeInSine'}),
+ scale: anime.stagger([2.5, 1], {from: 'center', easing: 'easeInOutCirc'}),
translateX: anime.stagger([-200, 200]),
translateY: anime.stagger([-200, 200]),
rotate: 0,
diff --git a/documentation/examples/anime-staggering-demo.html b/documentation/examples/anime-staggering-demo.html
index 6c6046a4..bec0e87a 100644
--- a/documentation/examples/anime-staggering-demo.html
+++ b/documentation/examples/anime-staggering-demo.html
@@ -126,22 +126,29 @@
anime({
targets: '.easing-visualizer div',
+ translateZ: 0,
translateY: (() => {
const keyframes = [];
+ // keyframes.push({ value: 0, delay: stagger(.125) });
+ // keyframes.push({ value: stagger([0, -400], {easing: 'steps(10)'}), delay: stagger(.125) });
for (let ease in anime.penner) {
keyframes.push({
value: stagger([0, -400], {easing: ease}),
delay: stagger(.125)
});
};
- keyframes.push({ value: stagger([0, -400], {easing: 'steps(10)'}), delay: stagger(.125) });
- keyframes.push({ value: 0, delay: stagger(.125) });
return keyframes;
})(),
+ // translateY: {
+ // value: stagger([0, -400], {easing:'easeInOutSine'}),
+ // delay: stagger(.125)
+ // },
easing: 'easeInOutSine',
- duration: 16000,
+ duration: 6000,
loop: true
});
+ console.log(anime.penner);
+