bounce

Function
bounce(
    s1: State,
    s2: State,
    at: float,
    dur: float,
    times: int = 2,
    easing: Optional[Dict[str, Callable[[float], float]]] = None
) -> List[KeyState]

Bounce between two states.

Parameters

s1
First state (start and end)
s2
Second state (peaks)
at
Start time
dur
Total duration
times
Number of bounces (2 = s1->s2->s1->s2->s1)
easing
Optional easing dict for transitions

Returns

List of KeyState objects

Examples

# Bounce twice between s1 and s2 over 0.2 duration
    .segment(bounce(s1, s2, at=0.3, dur=0.2, times=2))