Skip to content

Commit

Permalink
Fix expo easing
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangarnier committed Nov 28, 2023
1 parent 620464f commit 0da58d2
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 11 deletions.
7 changes: 4 additions & 3 deletions lib/anime.es.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* anime.js v3.2.1
* (c) 2020 Julian Garnier
* anime.js v3.2.2
* (c) 2023 Julian Garnier
* Released under the MIT license
* animejs.com
*/
Expand Down Expand Up @@ -227,6 +227,7 @@ var penner = (function () {

var functionEasings = {
Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
Expo: function () { return function (t) { return t ? Math.pow(2, 10 * t - 10) : 0; }; },
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) {
Expand All @@ -247,7 +248,7 @@ var penner = (function () {
}
};

var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint'];

baseEasings.forEach(function (name, i) {
functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
Expand Down
7 changes: 4 additions & 3 deletions lib/anime.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* anime.js v3.2.1
* (c) 2020 Julian Garnier
* anime.js v3.2.2
* (c) 2023 Julian Garnier
* Released under the MIT license
* animejs.com
*/
Expand Down Expand Up @@ -229,6 +229,7 @@ var penner = (function () {

var functionEasings = {
Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
Expo: function () { return function (t) { return t ? Math.pow(2, 10 * t - 10) : 0; }; },
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) {
Expand All @@ -249,7 +250,7 @@ var penner = (function () {
}
};

var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint'];

baseEasings.forEach(function (name, i) {
functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
Expand Down
6 changes: 3 additions & 3 deletions lib/anime.min.js

Large diffs are not rendered by default.

270 changes: 270 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "animejs",
"version": "3.2.1",
"version": "3.2.2",
"homepage": "http://animejs.com",
"repository": "juliangarnier/anime",
"description": "JavaScript animation engine",
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const penner = (() => {

const functionEasings = {
Sine: () => t => 1 - Math.cos(t * Math.PI / 2),
Expo: () => t => t ? Math.pow(2, 10 * t - 10) : 0,
Circ: () => t => 1 - Math.sqrt(1 - t * t),
Back: () => t => t * t * (3 * t - 2),
Bounce: () => t => {
Expand All @@ -235,7 +236,7 @@ const penner = (() => {
}
}

const baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
const baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint'];

baseEasings.forEach((name, i) => {
functionEasings[name] = () => t => Math.pow(t, i + 2);
Expand Down

0 comments on commit 0da58d2

Please sign in to comment.