crossfade

Function
crossfade(
    s_out: State,
    s_in: State,
    t_start: float,
    t_end: float,
    delay: Optional[float] = 0,
    easing_dict: Optional[Dict[str, Callable[[float], float]]] = None
) -> Tuple[List[KeyState], List[KeyState]]

Fades one element out while fading a second element in simultaneously.

Parameters

s_out
The State of the element that will fade OUT.
s_in
The State of the element that will fade IN.
t_start
The absolute time (normalized to [0, 1]) when the crossfade begins.
t_end
The absolute time (normalized to [0, 1]) when the crossfade ends.
delay
delay between fade out and fade in
easing
Optional easing dict for opacity transitions.

Returns

Tuple of (keystates_for_fading_in, keystates_for_fading_out)