Skip to main content

Motion

Struct Motion 

Source
pub struct Motion {
    pub ms: u64,
    pub scale: f32,
    pub curve: Curve,
}
Expand description

The duration, scale and curve v3 declares for one overlay’s transition.

v3 does not animate every overlay the same way, which is what reading the guide rather than the stylesheets had suggested. Each surface names its own duration-*, ease-* and zoom-*, and a modal panel even shrinks in from 105% rather than growing from 90%. The constants below are transcribed one per group, and anim_audit.py checks them against the CSS.

Fields§

§ms: u64

Duration in milliseconds.

§scale: f32

The scale the animation starts at (entering) or ends at (exiting). 1.0 means no scaling — a fade alone.

§curve: Curve

Easing curve.

Implementations§

Source§

impl Motion

Source

pub const PANEL_IN: Motion

duration-250 ease-out-quad zoom-in-105 — Modal and AlertDialog panels, which settle down onto the page.

Source

pub const PANEL_OUT: Motion

duration-100 ease-out-quad zoom-out-95.

Source

pub const BACKDROP_IN: Motion

duration-150 ease-out fade-in-0 — the backdrop behind a panel, which only fades.

Source

pub const BACKDROP_OUT: Motion

duration-100 ease-out fade-out-0.

Source

pub const POPOVER_IN: Motion

duration-150 ease-smooth zoom-in-90 — Popover, Dropdown, Tooltip.

Source

pub const LIST_IN: Motion

duration-150 ease-smooth zoom-in-95 — Select, ComboBox, the date and colour pickers, which start closer to full size.

Source

pub const LIST_OUT: Motion

duration-100 ease-smooth zoom-out-95 — the exit both share.

Source

pub const DISCLOSURE: Motion

.disclosure__content is a transition, not an animate-in: height 200ms ease-out-quad, opacity 200ms ease-out. The collapsible panel helper measures its natural child extent and drives both properties at these curves.

Source

pub const FIELD_ERROR_HEIGHT: Motion

field-error.css expands the error row over 350ms with the smooth curve, independently of its shorter 150ms opacity transition.

Source

pub const FIELD_ERROR_OPACITY: Motion

Opacity transition of the field error row: 150ms with the Out curve.

Source

pub const DRAWER_IN: Motion

translate 250ms cubic-bezier(0.32, 0.72, 0, 1) — the drawer’s slide, which drawer.css gives its own --drawer-enter-* tokens.

Source

pub const DRAWER_OUT: Motion

--drawer-exit-duration: 200ms, same curve.

Source

pub const DRAWER_BACKDROP_IN: Motion

Drawer-specific backdrop fade from drawer.css: it follows the panel’s fluid enter curve instead of the shared modal backdrop token.

Source

pub const DRAWER_BACKDROP_OUT: Motion

Drawer-specific backdrop exit from drawer.css.

Source

pub const FLUID_IN: Motion

duration-250 ease-out-fluid zoom-in-95 — Autocomplete alone.

Source

pub const FLUID_OUT: Motion

duration-100 ease-out-quad zoom-out-95.

Source

pub const TOAST_IN: Motion

350ms ease-out-fluid — Toast’s placement-aware card translation and fade when a new notification enters the queue.

Source

pub const TOAST_OUT: Motion

350ms ease-out-fluid — the frontmost Toast card leaves toward the placement edge while its opacity settles to zero.

Source

pub const TOAST_STACK_OUT: Motion

200ms ease-out-fluid and scale(.96) — a non-frontmost Toast card retires in an expanded/collapsed stack without leaving its slot.

Trait Implementations§

Source§

impl Clone for Motion

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 Copy for Motion

Source§

impl Debug for Motion

Source§

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

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DynClone for T
where T: Clone,

Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more