From 77f129bcd160b190e3250e74d406a9048e27cfef Mon Sep 17 00:00:00 2001 From: YuriFA Date: Tue, 26 Feb 2019 17:33:58 +0300 Subject: [PATCH 1/2] 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 2/2] 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;