-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheasing.js
More file actions
361 lines (329 loc) · 12.1 KB
/
easing.js
File metadata and controls
361 lines (329 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.easing = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function backInOut(t) {
const s = 1.70158 * 1.525;
if ((t *= 2) < 1)
return 0.5 * (t * t * ((s + 1) * t - s));
return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
}
exports.backInOut = backInOut;
},{}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function backIn(t) {
const s = 1.70158;
return t * t * ((s + 1) * t - s);
}
exports.backIn = backIn;
},{}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function backOut(t) {
const s = 1.70158;
return --t * t * ((s + 1) * t + s) + 1;
}
exports.backOut = backOut;
},{}],4:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bounce_out_1 = require("./bounce-out");
function bounceInOut(t) {
return t < 0.5
? 0.5 * (1.0 - bounce_out_1.bounceOut(1.0 - t * 2.0))
: 0.5 * bounce_out_1.bounceOut(t * 2.0 - 1.0) + 0.5;
}
exports.bounceInOut = bounceInOut;
},{"./bounce-out":6}],5:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bounce_out_1 = require("./bounce-out");
function bounceIn(t) {
return 1.0 - bounce_out_1.bounceOut(1.0 - t);
}
exports.bounceIn = bounceIn;
},{"./bounce-out":6}],6:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function bounceOut(t) {
const a = 4.0 / 11.0;
const b = 8.0 / 11.0;
const c = 9.0 / 10.0;
const ca = 4356.0 / 361.0;
const cb = 35442.0 / 1805.0;
const cc = 16061.0 / 1805.0;
const t2 = t * t;
return t < a
? 7.5625 * t2
: t < b
? 9.075 * t2 - 9.9 * t + 3.4
: t < c
? ca * t2 - cb * t + cc
: 10.8 * t * t - 20.52 * t + 10.72;
}
exports.bounceOut = bounceOut;
},{}],7:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function circInOut(t) {
if ((t *= 2) < 1)
return -0.5 * (Math.sqrt(1 - t * t) - 1);
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
}
exports.circInOut = circInOut;
},{}],8:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function circIn(t) {
return 1.0 - Math.sqrt(1.0 - t * t);
}
exports.circIn = circIn;
},{}],9:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function circOut(t) {
return Math.sqrt(1 - (--t * t));
}
exports.circOut = circOut;
},{}],10:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function cubicInOut(t) {
return t < 0.5
? 4.0 * t * t * t
: 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;
}
exports.cubicInOut = cubicInOut;
},{}],11:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function cubicIn(t) {
return t * t * t;
}
exports.cubicIn = cubicIn;
},{}],12:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function cubicOut(t) {
var f = t - 1.0;
return f * f * f + 1.0;
}
exports.cubicOut = cubicOut;
},{}],13:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function elasticInOut(t) {
return t < 0.5
? 0.5 * Math.sin(+13.0 * Math.PI / 2 * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0))
: 0.5 * Math.sin(-13.0 * Math.PI / 2 * ((2.0 * t - 1.0) + 1.0)) * Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;
}
exports.elasticInOut = elasticInOut;
},{}],14:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function elasticIn(t) {
return Math.sin(13.0 * t * Math.PI / 2) * Math.pow(2.0, 10.0 * (t - 1.0));
}
exports.elasticIn = elasticIn;
},{}],15:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function elasticOut(t) {
return Math.sin(-13.0 * (t + 1.0) * Math.PI / 2) * Math.pow(2.0, -10.0 * t) + 1.0;
}
exports.elasticOut = elasticOut;
},{}],16:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function expoInOut(t) {
return (t === 0.0 || t === 1.0)
? t
: t < 0.5
? +0.5 * Math.pow(2.0, (20.0 * t) - 10.0)
: -0.5 * Math.pow(2.0, 10.0 - (t * 20.0)) + 1.0;
}
exports.expoInOut = expoInOut;
},{}],17:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function expoIn(t) {
return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));
}
exports.expoIn = expoIn;
},{}],18:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function expoOut(t) {
return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);
}
exports.expoOut = expoOut;
},{}],19:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var back_in_out_1 = require("./back-in-out");
exports.backInOut = back_in_out_1.backInOut;
var back_in_1 = require("./back-in");
exports.backIn = back_in_1.backIn;
var back_out_1 = require("./back-out");
exports.backOut = back_out_1.backOut;
var bounce_in_out_1 = require("./bounce-in-out");
exports.bounceInOut = bounce_in_out_1.bounceInOut;
var bounce_in_1 = require("./bounce-in");
exports.bounceIn = bounce_in_1.bounceIn;
var bounce_out_1 = require("./bounce-out");
exports.bounceOut = bounce_out_1.bounceOut;
var circ_in_out_1 = require("./circ-in-out");
exports.circInOut = circ_in_out_1.circInOut;
var circ_in_1 = require("./circ-in");
exports.circIn = circ_in_1.circIn;
var circ_out_1 = require("./circ-out");
exports.circOut = circ_out_1.circOut;
var cubic_in_out_1 = require("./cubic-in-out");
exports.cubicInOut = cubic_in_out_1.cubicInOut;
var cubic_in_1 = require("./cubic-in");
exports.cubicIn = cubic_in_1.cubicIn;
var cubic_out_1 = require("./cubic-out");
exports.cubicOut = cubic_out_1.cubicOut;
var elastic_in_out_1 = require("./elastic-in-out");
exports.elasticInOut = elastic_in_out_1.elasticInOut;
var elastic_in_1 = require("./elastic-in");
exports.elasticIn = elastic_in_1.elasticIn;
var elastic_out_1 = require("./elastic-out");
exports.elasticOut = elastic_out_1.elasticOut;
var expo_in_out_1 = require("./expo-in-out");
exports.expoInOut = expo_in_out_1.expoInOut;
var expo_in_1 = require("./expo-in");
exports.expoIn = expo_in_1.expoIn;
var expo_out_1 = require("./expo-out");
exports.expoOut = expo_out_1.expoOut;
var linear_1 = require("./linear");
exports.linear = linear_1.linear;
var quad_in_out_1 = require("./quad-in-out");
exports.quadInOut = quad_in_out_1.quadInOut;
var quad_in_1 = require("./quad-in");
exports.quadIn = quad_in_1.quadIn;
var quad_out_1 = require("./quad-out");
exports.quadOut = quad_out_1.quadOut;
var quart_in_out_1 = require("./quart-in-out");
exports.quartInOut = quart_in_out_1.quartInOut;
var quart_in_1 = require("./quart-in");
exports.quartIn = quart_in_1.quartIn;
var quart_out_1 = require("./quart-out");
exports.quartOut = quart_out_1.quartOut;
var quint_in_out_1 = require("./quint-in-out");
exports.quintInOut = quint_in_out_1.quintInOut;
var quint_in_1 = require("./quint-in");
exports.quintIn = quint_in_1.quintIn;
var quint_out_1 = require("./quint-out");
exports.quintOut = quint_out_1.quintOut;
var sine_in_out_1 = require("./sine-in-out");
exports.sineInOut = sine_in_out_1.sineInOut;
var sine_in_1 = require("./sine-in");
exports.sineIn = sine_in_1.sineIn;
var sine_out_1 = require("./sine-out");
exports.sineOut = sine_out_1.sineOut;
},{"./back-in":2,"./back-in-out":1,"./back-out":3,"./bounce-in":5,"./bounce-in-out":4,"./bounce-out":6,"./circ-in":8,"./circ-in-out":7,"./circ-out":9,"./cubic-in":11,"./cubic-in-out":10,"./cubic-out":12,"./elastic-in":14,"./elastic-in-out":13,"./elastic-out":15,"./expo-in":17,"./expo-in-out":16,"./expo-out":18,"./linear":20,"./quad-in":22,"./quad-in-out":21,"./quad-out":23,"./quart-in":25,"./quart-in-out":24,"./quart-out":26,"./quint-in":28,"./quint-in-out":27,"./quint-out":29,"./sine-in":31,"./sine-in-out":30,"./sine-out":32}],20:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function linear(t) {
return t;
}
exports.linear = linear;
},{}],21:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quadInOut(t) {
t /= 0.5;
if (t < 1)
return 0.5 * t * t;
t--;
return -0.5 * (t * (t - 2) - 1);
}
exports.quadInOut = quadInOut;
},{}],22:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quadIn(t) {
return t * t;
}
exports.quadIn = quadIn;
},{}],23:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quadOut(t) {
return -t * (t - 2.0);
}
exports.quadOut = quadOut;
},{}],24:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quartInOut(t) {
return t < 0.5
? +8.0 * Math.pow(t, 4.0)
: -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;
}
exports.quartInOut = quartInOut;
},{}],25:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quartIn(t) {
return Math.pow(t, 4.0);
}
exports.quartIn = quartIn;
},{}],26:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quartOut(t) {
return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;
}
exports.quartOut = quartOut;
},{}],27:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quintInOut(t) {
if ((t *= 2) < 1)
return 0.5 * t * t * t * t * t;
return 0.5 * ((t -= 2) * t * t * t * t + 2);
}
exports.quintInOut = quintInOut;
},{}],28:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quintIn(t) {
return t * t * t * t * t;
}
exports.quintIn = quintIn;
},{}],29:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function quintOut(t) {
return --t * t * t * t * t + 1;
}
exports.quintOut = quintOut;
},{}],30:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function sineInOut(t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
}
exports.sineInOut = sineInOut;
},{}],31:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function sineIn(t) {
var v = Math.cos(t * Math.PI * 0.5);
if (Math.abs(v) < 1e-14)
return 1;
else
return 1 - v;
}
exports.sineIn = sineIn;
},{}],32:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function sineOut(t) {
return Math.sin(t * Math.PI / 2);
}
exports.sineOut = sineOut;
},{}]},{},[19])(19)
});