|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
521 bytes
|
| Line | |
|---|
| 1 | var b1 = 4 / 11,
|
|---|
| 2 | b2 = 6 / 11,
|
|---|
| 3 | b3 = 8 / 11,
|
|---|
| 4 | b4 = 3 / 4,
|
|---|
| 5 | b5 = 9 / 11,
|
|---|
| 6 | b6 = 10 / 11,
|
|---|
| 7 | b7 = 15 / 16,
|
|---|
| 8 | b8 = 21 / 22,
|
|---|
| 9 | b9 = 63 / 64,
|
|---|
| 10 | b0 = 1 / b1 / b1;
|
|---|
| 11 |
|
|---|
| 12 | export function bounceIn(t) {
|
|---|
| 13 | return 1 - bounceOut(1 - t);
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | export function bounceOut(t) {
|
|---|
| 17 | return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | export function bounceInOut(t) {
|
|---|
| 21 | return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
|
|---|
| 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.