gpui_transitions.
This crate provides an API for interpolating between values in gpui.
Transitions can be constructed via window.use_transition or window.use_keyed_transition. It's very similar to the use_state API.
let my_transition = window
.use_keyed_transition,
);
They can also be constructed more granularly via Transition::new:
let my_transition = new;
To get the value of a transition you can use evaluate:
let value = my_transition.evaluate;
If the transition is not finished when evaluate is called then an animation frame will be requested.
Updating the transition's goal is identical to updating state:
my_transition.update;
Examples can be found here.