Class Timeline

A timeline class for managing animations with easing and precise progress control. It provides methods for playing, reversing, pausing, and resetting the timeline.

Documentation

Hierarchy (View Summary)

Constructors

Accessors

  • get isDestroyed(): boolean

    Checks if the module has been destroyed.

    Returns boolean

  • get name(): string

    The name of the module, derived from the class name

    Returns string

  • get prefix(): string

    Optional prefix for classnames used by the module

    Returns string

Methods

  • Adds a class name on an element, and keeps track of it for removal when the module is destroyed.

    Parameters

    • element: Element

      The target DOM element.

    • className: string

      The class name to toggle.

    Returns void

  • Helper function to generate classnames with the module's prefix.

    Parameters

    • ...classNames: string[]

      The class names to generate.

    Returns string

    A string of class names with the module's prefix applied.

  • Get default mutable properties.

    Returns {
        __mutableProp: true;
        duration: number;
        easing: false | number[] | TEasingFunction;
    }

    • __mutableProp: true
    • duration: number

      Timeline duration in milliseconds.

      1000
      
    • easing: false | number[] | TEasingFunction

      Easing function for timeline progression. Accepts standard easing types or an array of bezier values.

      false
      
  • Adds a callback on the module's destruction.

    Parameters

    • action: () => void

      The function to execute during destruction.

    Returns void

  • Play the timeline, advancing progress toward completion. Does nothing if the timeline is destroyed or already completed.

    Returns void

  • Reverse the timeline, moving progress toward the start. Does nothing if the timeline is destroyed or already at the start.

    Returns void