Skip to main content

CharAnimationTiming

Struct CharAnimationTiming 

Source
pub struct CharAnimationTiming {
Show 19 fields pub delay: f64, pub duration: f64, pub stagger: f64, pub granularity: TextAnimGranularity, pub easing: EasingType, pub overshoot: Option<f64>, pub blur: Option<f64>, pub direction: TextAnimDirection, pub distance: Option<f64>, pub scale_from: Option<f64>, pub jitter: Option<f64>, pub seed: Option<u32>, pub ink_from: Option<String>, pub rotate_from: Option<f64>, pub rotate_origin: RotateOrigin, pub scale_jitter: Option<f64>, pub baseline_jitter: Option<f64>, pub reflow: bool, pub reflow_easing: EasingType,
}
Expand description

Timing configuration for char animation effect variants (used inside style.animation).

Fields§

§delay: f64

Delay before animation starts (seconds).

§duration: f64

Duration of each unit’s animation in seconds.

§stagger: f64

Delay between each unit (char or word) in seconds.

§granularity: TextAnimGranularity

Granularity: animate per character or per word.

§easing: EasingType

Easing function for each unit’s animation.

§overshoot: Option<f64>

Overshoot intensity for char_scale_in/char_bounce (0.0 = none, default 0.08 = 8%).

§blur: Option<f64>

Starting blur sigma in px for char_blur_in — the word (or char) begins blurred by this amount and settles to sharp (sigma 0) by the end of its unit animation. Unused by the other five char presets. Defaults to 14px sigma, chosen to read clearly at 100px+ display type without collapsing into a featureless blob (see render proof in issue #118).

§direction: TextAnimDirection

Which way each unit travels in from. Only char_slide_up and char_blur_in have a travel axis to redirect; the other presets ignore it. Default up — the historical behaviour.

§distance: Option<f64>

Multiplier on how far each unit travels, 1.0 being each preset’s own tuned distance (0.8em for slide_up, 0.12em for blur_in). Use ~0.5 for a tighter arrival, ~1.85 for a pronounced staircase.

§scale_from: Option<f64>

Scale each unit starts at, growing to 1.0 over its animation — combined with, not instead of, the preset’s own motion. 0.82 gives the punchy “number pops in” arrival, 0.92 a barely-perceptible settle. Unset means no scaling (the historical behaviour); the scale-based presets (char_scale_in, char_bounce) own their scale curve outright and ignore this.

§jitter: Option<f64>

Randomises each unit’s start time by up to ±jitter × stagger, so the units arrive in uneven bursts instead of a metronomic march. This is what separates a streaming-token look from a typewriter: language models don’t emit words on a clock. 0 (default) keeps the exact even spacing.

The offsets are derived from seed and the unit’s index, never from a live RNG — a frame must render identically no matter which process, thread or --frames segment computes it.

§seed: Option<u32>

Seed for jitter. Changing it reshuffles the arrival rhythm without changing its statistics.

§ink_from: Option<String>

Colour each unit starts at before settling to the text’s own colour over its animation. A dim grey here reproduces the way freshly streamed tokens read as unsettled before the eye accepts them.

§rotate_from: Option<f64>

Tilt (degrees) each unit starts at, straightening to 0 by the end of its own animation — the “staircase word reveal” where every letter settles from a lean. Composes with the preset instead of replacing it, the same rule scale_from follows; char_rotate_in already owns a rotation curve and ignores this. Unset means no tilt (the historical behaviour).

§rotate_origin: RotateOrigin

Pivot rotate_from turns each unit around. Only meaningful alongside rotate_from.

§scale_jitter: Option<f64>

Deterministic per-unit size noise: each unit is additionally born at 1.0 ± scale_jitter and converges to its own normal scale by the end of its animation, on top of whatever the preset already does — “letters born at different sizes, then aligning”. Derived from seed and the unit’s index, like jitter; unset means no size noise (the historical behaviour).

§baseline_jitter: Option<f64>

Deterministic per-unit baseline noise, as a fraction of font-size: each unit is additionally born offset by up to ±baseline_jitter × font-size from its laid-out baseline and settles onto it by the end of its animation. Derived from seed and the unit’s index, like jitter; unset means no baseline noise (the historical behaviour).

§reflow: bool

When true, a unit that hasn’t started its own animation yet contributes no width to its line, and one that’s mid-animation contributes a share eased in by reflow_easing — so the line grows as units arrive instead of reserving its final width from the first frame. Combined with text-align: center, this is what keeps a centred line centred while it’s being written instead of growing from a fixed left edge. Default false keeps the historical behaviour: every unit’s slot is reserved from frame one, only its paint (opacity/position/scale/blur) animates.

§reflow_easing: EasingType

Easing curve for the width a unit contributes to its line while reflow is on — independent from easing, which times the unit’s own visual entrance. Only meaningful alongside reflow.

Trait Implementations§

Source§

impl Clone for CharAnimationTiming

Source§

fn clone(&self) -> Self

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 CharAnimationTiming

Source§

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

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

impl Default for CharAnimationTiming

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CharAnimationTiming

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 CharAnimationTiming

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 CharAnimationTiming

Source§

fn eq(&self, other: &Self) -> 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 CharAnimationTiming

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 CharAnimationTiming

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.