webani - v1.0.0
    Preparing search index...

    A class that represents an interpolated animation between two WebaniTransformable objects. The animation smoothly transitions from a before state to an after state. Subclasses must implement the setFrame and resolveAnimation methods.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    backwards: boolean

    Whether the animation plays in reverse.

    duration: number

    Duration of the animation in milliseconds.

    interpolationFunction: (before: number, after: number, t: number) => number

    The interpolation function used for the animation.

    Accessors

    Methods

    • Interpolates the progress of the animation based on the time t.

      Parameters

      • t: number

        The time or progress of the animation, typically between 0 and 1.

      Returns number

      A normalized value between 0 and 1 representing the progress of the animation.

    • Resolves the transforms of the before and after objects to ensure they have the same number of extra transforms. This function ensures that the animation has a consistent structure when resolving the transforms.

      Returns void

    • Cubic interpolation function.

      Parameters

      • before: number

        The start value.

      • after: number

        The end value.

      • t: number

        The progress of the interpolation.

      Returns number

      The interpolated value with cubic easing.

    • Ease-in-out interpolation function.

      Parameters

      • before: number

        The start value.

      • after: number

        The end value.

      • t: number

        The progress of the interpolation.

      Returns number

      The interpolated value with ease-in-out easing.

    • Linear interpolation function.

      Parameters

      • before: number

        The start value.

      • after: number

        The end value.

      • t: number

        The progress of the interpolation.

      Returns number

      The interpolated value.