Skip to main content

AnimationEffect

Enum AnimationEffect 

Source
pub enum AnimationEffect {
Show 56 variants FadeIn(AnimationTiming), FadeInUp(AnimationTiming), FadeInDown(AnimationTiming), FadeInLeft(AnimationTiming), FadeInRight(AnimationTiming), SlideInLeft(AnimationTiming), SlideInRight(AnimationTiming), SlideInUp(AnimationTiming), SlideInDown(AnimationTiming), ScaleIn(AnimationTiming), BounceIn(AnimationTiming), BlurIn(AnimationTiming), RotateIn(AnimationTiming), ElasticIn(AnimationTiming), PopIn(AnimationTiming), FadeOut(AnimationTiming), FadeOutUp(AnimationTiming), FadeOutDown(AnimationTiming), SlideOutLeft(AnimationTiming), SlideOutRight(AnimationTiming), SlideOutUp(AnimationTiming), SlideOutDown(AnimationTiming), ScaleOut(AnimationTiming), BounceOut(AnimationTiming), BlurOut(AnimationTiming), RotateOut(AnimationTiming), Pulse(AnimationTiming), Float(AnimationTiming), Shake(AnimationTiming), Spin(AnimationTiming), FlipInX(AnimationTiming), FlipInY(AnimationTiming), FlipOutX(AnimationTiming), FlipOutY(AnimationTiming), TiltIn(TiltInConfig), DrawIn(AnimationTiming), StrokeReveal(AnimationTiming), Typewriter(AnimationTiming), WipeLeft(AnimationTiming), WipeRight(AnimationTiming), Float3d(AnimationTiming), CharScaleIn(CharAnimationTiming), CharFadeIn(CharAnimationTiming), CharWave(CharAnimationTiming), CharBounce(CharAnimationTiming), CharRotateIn(CharAnimationTiming), CharSlideUp(CharAnimationTiming), CharBlurIn(CharAnimationTiming), Glow(GlowConfig), Shimmer(ShimmerConfig), Wiggle(WiggleConfig), Orbit(OrbitConfig), Keyframes(KeyframesConfig), MotionBlur(MotionBlurConfig), Trail(TrailConfig), MotionPath(MotionPathConfig),
}
Expand description

A single animation effect. Discriminated by "type" in JSON. Each preset name is a valid type, plus special types: glow, wiggle, keyframes, motion_blur.

Examples:

{ "name": "fade_in_up", "delay": 0.3, "duration": 0.6 }
{ "name": "glow", "color": "#F68F2B", "radius": 16, "intensity": 1.2 }
{ "name": "wiggle", "property": "translate_y", "amplitude": 5, "frequency": 2 }

Variants§

§

FadeIn(AnimationTiming)

§

FadeInUp(AnimationTiming)

§

FadeInDown(AnimationTiming)

§

FadeInLeft(AnimationTiming)

§

FadeInRight(AnimationTiming)

§

SlideInLeft(AnimationTiming)

§

SlideInRight(AnimationTiming)

§

SlideInUp(AnimationTiming)

§

SlideInDown(AnimationTiming)

§

ScaleIn(AnimationTiming)

§

BounceIn(AnimationTiming)

§

BlurIn(AnimationTiming)

§

RotateIn(AnimationTiming)

§

ElasticIn(AnimationTiming)

§

PopIn(AnimationTiming)

Scale up from nothing with a back-out overshoot, then a short elastic pulse before settling — the notification-badge arrival, where the second beat is what draws the eye after the first has placed the element. AnimationTiming.overshoot sets the pulse amplitude (default 0.18 = 118%); 0 reduces it to a plain back-out scale-in.

§

FadeOut(AnimationTiming)

§

FadeOutUp(AnimationTiming)

§

FadeOutDown(AnimationTiming)

§

SlideOutLeft(AnimationTiming)

§

SlideOutRight(AnimationTiming)

§

SlideOutUp(AnimationTiming)

§

SlideOutDown(AnimationTiming)

§

ScaleOut(AnimationTiming)

§

BounceOut(AnimationTiming)

§

BlurOut(AnimationTiming)

§

RotateOut(AnimationTiming)

§

Pulse(AnimationTiming)

§

Float(AnimationTiming)

§

Shake(AnimationTiming)

§

Spin(AnimationTiming)

§

FlipInX(AnimationTiming)

§

FlipInY(AnimationTiming)

§

FlipOutX(AnimationTiming)

§

FlipOutY(AnimationTiming)

§

TiltIn(TiltInConfig)

§

DrawIn(AnimationTiming)

§

StrokeReveal(AnimationTiming)

§

Typewriter(AnimationTiming)

§

WipeLeft(AnimationTiming)

§

WipeRight(AnimationTiming)

§

Float3d(AnimationTiming)

§

CharScaleIn(CharAnimationTiming)

§

CharFadeIn(CharAnimationTiming)

§

CharWave(CharAnimationTiming)

§

CharBounce(CharAnimationTiming)

§

CharRotateIn(CharAnimationTiming)

§

CharSlideUp(CharAnimationTiming)

§

CharBlurIn(CharAnimationTiming)

Each word (or char) arrives blurred and settles sharp, combined with a slight upward translate and an opacity ramp — one continuous per-unit animation driven by the same progress value, not three independently-timed effects. CharAnimationTiming.blur sets the starting blur sigma in px (default engine::animator::DEFAULT_CHAR_BLUR_SIGMA, tuned for 100px+ display type).

Resolved through engine::animator::extract_effectsResolvedCharAnimation like its five siblings, so it picks up container-level stagger shifting and timeline-embedded copies. (It used to be read directly off style.animation inside rustmotion_components::text::Text::paint and therefore missed both.)

§

Glow(GlowConfig)

§

Shimmer(ShimmerConfig)

A band of light sweeping across the element’s own painted pixels. See ShimmerConfig.

§

Wiggle(WiggleConfig)

§

Orbit(OrbitConfig)

§

Keyframes(KeyframesConfig)

§

MotionBlur(MotionBlurConfig)

§

Trail(TrailConfig)

Temporal trail effect: paints copies of the component at prior times with decaying opacity, creating a persistence-of-vision ghost trail.

§

MotionPath(MotionPathConfig)

Move the component along an SVG path, and — when orient is set — rotate it to face the path’s tangent direction. See MotionPathConfig’s doc comment for the path syntax, the coordinate space path points are interpreted in, and how degenerate paths (empty, single-point, zero-length) are handled.

Implementations§

Source§

impl AnimationEffect

Source

pub fn shift_delay(&mut self, by: f64)

Shift the effect’s start delay by by seconds. Used by timeline steps, whose animations run relative to the step’s at. Continuous effects without a delay concept (glow, wiggle, orbit, motion blur) are unaffected.

Source

pub fn as_preset(&self) -> Option<(AnimationPreset, &AnimationTiming)>

If this is a preset variant, return the corresponding AnimationPreset and timing.

Trait Implementations§

Source§

impl Clone for AnimationEffect

Source§

fn clone(&self) -> AnimationEffect

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnimationEffect

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AnimationEffect

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for AnimationEffect

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for AnimationEffect

Source§

fn eq(&self, other: &AnimationEffect) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AnimationEffect

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AnimationEffect

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.