pub enum Ease {
}Expand description
An easing curve for a Motion animation.
Serializes to the data-motion-ease attribute, which assets/init.js
maps onto Motion’s easing definitions. When no ease is set, init.js
applies a snappy expo-out curve (cubic-bezier(0.16, 1, 0.3, 1)).
use autumn_plugin_motion::{Ease, Motion};
use autumn_web::{Markup, html};
let card: Markup = Motion::scale()
.ease(Ease::Spring { stiffness: 300.0, damping: 20.0, mass: 1.0 })
.wrap(html! { p { "Boing" } });
assert!(card.into_string().contains(r#"data-motion-ease="spring(300,20,1)""#));Variants§
Linear
Constant speed.
In
Start slow, end fast (cubic-bezier(0.42, 0, 1, 1)).
Out
Start fast, end slow (cubic-bezier(0, 0, 0.58, 1)).
InOut
Slow at both ends (cubic-bezier(0.42, 0, 0.58, 1)).
CircIn
Circular ease-in.
CircOut
Circular ease-out.
CircInOut
Circular ease-in-out.
BackIn
Overshoots, then settles (ease-in flavor).
BackOut
Overshoots, then settles (ease-out flavor).
BackInOut
Overshoots, then settles (in-out flavor).
Anticipate
Starts by moving slightly backwards, then accelerates.
CubicBezier(f32, f32, f32, f32)
A custom cubic-bezier curve: (x1, y1, x2, y2).
Spring
Spring physics. stiffness is the spring strength, damping the
friction, mass the weight being moved.
Trait Implementations§
impl Copy for Ease
impl StructuralPartialEq for Ease
Auto Trait Implementations§
impl Forget for Ease
impl Freeze for Ease
impl RefUnwindSafe for Ease
impl Send for Ease
impl Sync for Ease
impl Unpin for Ease
impl UnsafeUnpin for Ease
impl UnwindSafe for Ease
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,
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> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.