pub enum Easing {
Show 30 variants
Linear,
Ease,
In,
Out,
InOut,
InSine,
OutSine,
InOutSine,
InQuad,
OutQuad,
InOutQuad,
InCubic,
OutCubic,
InOutCubic,
InQuart,
OutQuart,
InOutQuart,
InQuint,
OutQuint,
InOutQuint,
InExpo,
OutExpo,
InOutExpo,
InCirc,
OutCirc,
InOutCirc,
InBack,
OutBack,
InOutBack,
Custom(Box<dyn EasingFunction>),
}
Expand description
Specifies a standard or custom EasingFunction
.
Available easings include:
- CSS standard:
Ease
,In
,Out
,InOut
corresponding toease
,ease-in
,ease-out
andease-in-out
- Common easings that can be implemented with a cubic bezier function, i.e. the majority of functions listed on https://easings.net except for the “elastic” and “bounce” types.
- User-defined functions via
Custom
.
Variants§
Linear
Linear easing, i.e. no easing or curve, only straight-line interpolation.
Ease
Curve equivalent to CSS
ease
.
In
Curve equivalent to CSS
ease-in
.
Out
Curve equivalent to CSS
ease-out
.
InOut
Curve equivalent to CSS
ease-in-out
.
InSine
Sinusoidal easing that starts slowly and ends quickly. Subtle, almost linear curve.
OutSine
Sinusoidal easing that starts quickly and ends slowly. Subtle, almost linear curve.
InOutSine
Sinusoidal easing that starts slowly, speeds up, and then ends slowly. Subtle, almost linear curve.
InQuad
Quadratic (^2
) easing that starts slowly and ends quickly. Slightly steeper curve than
InSine
.
OutQuad
Quadratic (^2
) easing that starts quickly and ends slowly. Slightly steeper curve than
OutSine
.
InOutQuad
Quadratic (^2
) easing that starts slowly, speeds up, and then ends slowly. Slightly
steeper curve than InOutSine
.
InCubic
Cubic (^3
) easing that starts slowly and ends quickly. Slightly steeper curve than
InQuad
.
OutCubic
Cubic (^3
) easing that starts quickly and ends slowly. Slightly steeper curve than
OutQuad
.
InOutCubic
Cubic (^3
) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper
curve than InOutQuad
.
InQuart
Quartic (^4
) easing that starts slowly and ends quickly. Slightly steeper curve than
InCubic
.
OutQuart
Quartic (^4
) easing that starts quickly and ends slowly. Slightly steeper curve than
OutCubic
.
InOutQuart
Quartic (^4
) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper
curve than InOutCubic
.
InQuint
Quintic (^5
) easing that starts slowly and ends quickly. Slightly steeper curve than
InQuart
.
OutQuint
Quintic (^5
) easing that starts quickly and ends slowly. Slightly steeper curve than
OutQuart
.
InOutQuint
Quintic (^5
) easing that starts slowly, speeds up, and then ends slowly. Slightly steeper
curve than InOutQuart
.
InExpo
Exponential easing that starts slowly and ends quickly. Steeper curve than
InQuint
and generally only suitable for long animations/frames.
OutExpo
Exponential easing that starts quickly and ends slowly. Steeper curve than
OutQuint
and generally only suitable for long animations/frames.
InOutExpo
Exponential easing that starts slowly, speeds up, and then ends slowly. Steeper curve than
InOutQuint
and generally only suitable for long animations/frames.
InCirc
A curve that looks like the lower-right quarter of a circle. Starts slowly, and speeds up dramatically. Generally only suitable for long animations/frames.
OutCirc
A curve that looks like the upper-left quarter of a circle. Starts very quickly, and decelerates dramatically. Generally only suitable for long animations/frames.
InOutCirc
A curve that looks like the lower-right quarter of a circle connected to the upper-left quarter of a circle. Starts very slowly, accelerates dramatically, and ends very slowly. dramatically. Generally only suitable for long animations/frames.
InBack
A curve that has similar timing to InExpo but moves slightly backward (negative) before accelerating forward.
OutBack
A curve that has similar timing to OutExpo but overshoots the terminal value (i.e. goes above 1.0) before decelerating backward and settling at the final value.
InOutBack
A curve that has similar timing to InOutExpo but moves slightly backward (negative) before accelerating forward and also overshoots the terminal value (i.e. goes above 1.0) before decelerating backward and settling at the final value.
Custom(Box<dyn EasingFunction>)
User-defined easing, such as an ad-hoc CubicBezierEasing.