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: u64Duration in milliseconds.
scale: f32The scale the animation starts at (entering) or ends at (exiting).
1.0 means no scaling — a fade alone.
curve: CurveEasing curve.
Implementations§
Source§impl Motion
impl Motion
Sourcepub const PANEL_IN: Motion
pub const PANEL_IN: Motion
duration-250 ease-out-quad zoom-in-105 — Modal and AlertDialog
panels, which settle down onto the page.
Sourcepub const BACKDROP_IN: Motion
pub const BACKDROP_IN: Motion
duration-150 ease-out fade-in-0 — the backdrop behind a panel, which
only fades.
Sourcepub const BACKDROP_OUT: Motion
pub const BACKDROP_OUT: Motion
duration-100 ease-out fade-out-0.
Sourcepub const POPOVER_IN: Motion
pub const POPOVER_IN: Motion
duration-150 ease-smooth zoom-in-90 — Popover, Dropdown, Tooltip.
Sourcepub const LIST_IN: Motion
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.
Sourcepub const DISCLOSURE: Motion
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.
Sourcepub const FIELD_ERROR_HEIGHT: Motion
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.
Sourcepub const FIELD_ERROR_OPACITY: Motion
pub const FIELD_ERROR_OPACITY: Motion
Opacity transition of the field error row: 150ms with the Out curve.
Sourcepub const DRAWER_IN: Motion
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.
Sourcepub const DRAWER_OUT: Motion
pub const DRAWER_OUT: Motion
--drawer-exit-duration: 200ms, same curve.
Sourcepub const DRAWER_BACKDROP_IN: Motion
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.
Sourcepub const DRAWER_BACKDROP_OUT: Motion
pub const DRAWER_BACKDROP_OUT: Motion
Drawer-specific backdrop exit from drawer.css.
Sourcepub const TOAST_IN: Motion
pub const TOAST_IN: Motion
350ms ease-out-fluid — Toast’s placement-aware card translation and
fade when a new notification enters the queue.
Sourcepub const TOAST_OUT: Motion
pub const TOAST_OUT: Motion
350ms ease-out-fluid — the frontmost Toast card leaves toward the
placement edge while its opacity settles to zero.
Sourcepub const TOAST_STACK_OUT: Motion
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§
Auto Trait Implementations§
impl Freeze for Motion
impl RefUnwindSafe for Motion
impl Send for Motion
impl Sync for Motion
impl Unpin for Motion
impl UnsafeUnpin for Motion
impl UnwindSafe for Motion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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