The system.transitions package use the core.easings library who contains all the easing functions to create the specific tweening effects.
These easings functions provide different flavors of math-based motion under a consistent API.
| easing | description | in | out | inout |
|---|---|---|---|---|
| linear | simple linear tweening : no easing, no acceleration | - | - | - |
| back | back easing : overshooting cubic easing: (s+1)t^3 - st^2 | yes | yes | yes |
| bounce | bounce easing : exponentially decaying parabolic bounce | yes | yes | yes |
| circular | circular easing : sqrt(1-t^2) | yes | yes | yes |
| cubic | cubic easing : t^3 | yes | yes | yes |
| elastic | elastic easing : exponentially decaying sine wave | yes | yes | yes |
| expo | exponential easing : 2^t | yes | yes | yes |
| quad | quadratic easing : t^2 | yes | yes | yes |
| quartic | quartic easing : t^4 | yes | yes | yes |
| quintic | quintic easing : t^5 | yes | yes | yes |
| regular | regular easing | yes | yes | yes |
| sine | sinusoidal easing : sin(t) | yes | yes | yes |
- License:
- Tutorials:
- See:
Methods
-
backIn(t, b, c, d [, s])
-
The
backInfunction starts the motion by backtracking and then reversing direction and moving toward the target.Parameters:
Name Type Argument Default Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
snumber <optional>
1.70158 Specifies the amount of overshoot, where the higher the value, the greater the overshoot.
Returns:
The value of the interpolated property at the specified time.
- Type
- number
-
backInOut(t, b, c, d [, s])
-
The
backInOutmethod combines the motion of thebackInandbackOutmethodsParameters:
Name Type Argument Default Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
snumber <optional>
1.70158 Specifies the amount of overshoot, where the higher the value, the greater the overshoot.
Returns:
The value of the interpolated property at the specified time.
-
backOut(t, b, c, d [, s])
-
The
backInfunction starts the motion by moving towards the target, overshooting it slightly,Parameters:
Name Type Argument Default Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
snumber <optional>
1.70158 Specifies the amount of overshoot, where the higher the value, the greater the overshoot.
Returns:
The value of the interpolated property at the specified time.
-
bounceIn(t, b, c, d)
-
The
bounceInfunction starts the bounce motion slowly and then accelerates motion as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
bounceInOut(t, b, c, d)
-
The
bounceInOutfunction combines the motion of thebounceInandbounceOutfunctionsParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
bounceOut(t, b, c, d)
-
The
bounceOutfunction starts the bounce motion fast and then decelerates motion as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
circularIn(t, b, c, d)
-
The
circularInfunction starts motion from zero velocity and then accelerates motion as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
circularInOut(t, b, c, d)
-
The
circularInOutfunction combines the motion of the circularIn and circularOut methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
circularOut(t, b, c, d)
-
The
circularOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
cubicIn(t, b, c, d)
-
The
cubicInfunction starts motion from zero velocity and then accelerates motion as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
cubicInOut(t, b, c, d)
-
The
cubicOutfunction combines the motion of the cubicIn and cubicOut functions to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity.A cubic equation is based on the power of three :
p(t) = t * t * t.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
cubicOut(t, b, c, d)
-
The
cubicOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes.A cubic equation is based on the power of three :
p(t) = t * t * t.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
elasticIn(t, b, c, d [, a] [, p])
-
The
elasticInfunction starts motion from zero velocity and then accelerates motion as it executes.Parameters:
Name Type Argument Default Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
anumber <optional>
0 Specifies the amplitude of the sine wave.
pnumber <optional>
0 Specifies the period of the sine wave.
Returns:
The value of the interpolated property at the specified time.
-
elasticInOut(t, b, c, d [, a] [, p])
-
The
elasticInOutfunction combines the motion of the elasticIn and elasticOut methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity.Parameters:
Name Type Argument Default Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
anumber <optional>
0 Specifies the amplitude of the sine wave.
pnumber <optional>
0 Specifies the period of the sine wave.
Returns:
The value of the interpolated property at the specified time.
-
elasticOut(t, b, c, d [, a] [, p])
-
The
elasticOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes.Parameters:
Name Type Argument Default Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
anumber <optional>
0 Specifies the amplitude of the sine wave.
pnumber <optional>
0 Specifies the period of the sine wave.
Returns:
The value of the interpolated property at the specified time.
-
expoIn(t, b, c, d)
-
The
expoInfunction starts motion from zero velocity and then accelerates motion as it executes. The exponential functions is based on the number 2 raised to a multiple of 10 :p(t) = 2^10(t-1)Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
expoInOut(t, b, c, d)
-
The
expoInOutfunction combines the motion of the expoIn and expoOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. The exponential functions is based on the number 2 raised to a multiple of 10 :p(t) = 2^10(t-1)Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
expoOut(t, b, c, d)
-
The
expoOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes. The exponential functions is based on the number 2 raised to a multiple of 10 :p(t) = 2^10(t-1)Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
linear(t, b, c, d)
-
The
linearfunction starts a basic and linear motion.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
quarticIn(t, b, c, d)
-
The
quarticInfunction starts motion from zero velocity and then accelerates motion as it executes. A quartic equation is based on the power of four :p(t) = t * t * t * tParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
quarticInOut(t, b, c, d)
-
The
quarticInOutfunction combines the motion of the quarticIn and quarticOut methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. A quartic equation is based on the power of four :p(t) = t * t * t * tParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
quarticOut(t, b, c, d)
-
The
quarticOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes. A quartic equation is based on the power of four :p(t) = t * t * t * tParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
quintic(t, b, c, d)
-
The
quinticInfunction starts motion from zero velocity and then accelerates motion as it executes. A quintic easing continues the upward trend, raises time to the fifth power :p(t) = t * t * t * t * tParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
quinticInOut(t, b, c, d)
-
The
quinticInOutfunction combines the motion of the quinticIn() and quinticOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. A quintic easing continues the upward trend, raises time to the fifth power :p(t) = t * t * t * t * tParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
quinticOut(t, b, c, d)
-
The
quinticOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes. A quintic easing continues the upward trend, raises time to the fifth power :p(t) = t * t * t * t * tParameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
regularIn(t, b, c, d)
-
The
regularInfunction starts motion from zero velocity and then accelerates motion as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
regularInOut(t, b, c, d)
-
The
regularInOutfunction combines the motion of the regularIn() and regularOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
regularOut(t, b, c, d)
-
The
regularOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes.Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
sineIn(t, b, c, d)
-
The
sineInfunction starts motion from zero velocity and then accelerates motion as it executes.A sinusoidal equation is based on a sine or cosine function. Either one produces a sine wave—a periodic oscillation of a specific shape.
This is the equation on which I based the easing curve :
p(t) = sin( t * Math.PI / 2 )Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
sineInOut(t, b, c, d)
-
The
sineInOutfunction combines the motion of the sineIn() and sineOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity.A sinusoidal equation is based on a sine or cosine function. Either one produces a sine wave—a periodic oscillation of a specific shape.
This is the equation on which I based the easing curve :
p(t) = sin( t * Math.PI / 2 )Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.
-
sineOut(t, b, c, d)
-
The
sineOutfunction starts motion fast and then decelerates motion to a zero velocity as it executes.A sinusoidal equation is based on a sine or cosine function. Either one produces a sine wave—a periodic oscillation of a specific shape.
This is the equation on which I based the easing curve :
p(t) = sin( t * Math.PI / 2 )Parameters:
Name Type Description tnumber Specifies the current time, between 0 and duration inclusive.
bnumber Specifies the initial value of the animation property.
cnumber Specifies the total change in the animation property.
dnumber Specifies the duration of the motion.
Returns:
The value of the interpolated property at the specified time.