use gpui::{Animation, AnimationExt as _};
use motion::CubicBezier;
const DRAWER: CubicBezier = CubicBezier::new(0.32, 0.72, 0.0, 1.0);
div().with_animation(
"drawer",
Animation::new(Duration::from_millis(300)).with_easing(DRAWER.easing()),
|el, t| el.opacity(t),
)- A CSS
cubic-bezier()ports with the same four numbers. The shipped curves areEASE,EASE_OUT,EASE_IN_OUT,EASE_OUT_EXPO,EASE_RESORTandEASE_TAILWIND. evalclamps its output to[0,1]. A hand-written easing must too: gpui's animation element aborts on a delta outside it.