Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KeyframeGenerator

Hierarchy

Index

Constructors

Methods

Constructors

constructor

Methods

abort

  • abort(): void
  • Stop all animations that were created with applyTo.

    Returns void

applyTo

  • applyTo(el: HTMLElement | HTMLElement[], options?: ApplyToOptions): Promise<void>
  • Apply this animation to an HTML element or array of HTML elements. Embeds a style element in the HTML document with the animations and keyframes, and then sets the CSS of the given HTML elements to use those animations.

    Parameters

    • el: HTMLElement | HTMLElement[]
    • Default value options: ApplyToOptions = {}

    Returns Promise<void>

    Promise that resolves once the animation is completed and the animation style removed. Infinite animations never resolve.

get

  • get<ReturnType>(type?: ReturnType, options?: KeyframeOptions): KeyframeReturnTypeMap[ReturnType]
  • Retrieve keyframes to embed as CSS or as an array of Animation Keyframe objects to use with Web Animation API.

    Type parameters

    Parameters

    Returns KeyframeReturnTypeMap[ReturnType]

    CSS or array of objects depending on the type given

Static isSupported

  • isSupported(): boolean
  • Returns boolean

    Does the browser have CSS support for animations?