Options
All
  • Public
  • Public/Protected
  • All
Menu

Extends Animate stop method, so, it automatically removes the target elements from the dom

Hierarchy

Index

Constructors

constructor

Properties

animations

animations: WeakMap<KeyframeEffect, Animation> = ...

A WeakMap of Animations

computedKeyframes

computedKeyframes: WeakMap<HTMLElement, TypeKeyFrameOptionsType> = ...

The keyframes for individual animations

A WeakMap that stores all the fully calculated keyframes for individual Animation instances.

Note: the computedKeyframes are changed to their proper Animation instance options, so, some of the names are different, and options that can't be computed are not present. E.g. translateX, skew, etc..., they've all been turned into the transform property.*

computedOptions

computedOptions: WeakMap<HTMLElement, TypeComputedOptions> = ...

The options for individual animations

A WeakMap that stores all the fully calculated options for individual Animation instances.

Note: the computedOptions are changed to their proper Animation instance options, so, some of the names are different, and options that can't be computed are not present. E.g. fillMode in the animation options is now just fill in the computedOptions.*

Note: keyframes are not included, both the array form and the object form; the options, speed, extend, padEndDelay, and autoplay animation options are not included

emitter

emitter: EventEmitter = ...

An event emitter

keyframeEffects

keyframeEffects: WeakMap<HTMLElement, KeyframeEffect> = ...

A WeakMap of KeyFrameEffects

mainAnimation

mainAnimation: Animation

Stores an animation that runs on the total duration of all the Animation instances, and as such it's the main Animation.

mainElement

mainElement: HTMLElement

The Element the mainAnimation runs on

mainkeyframeEffect

mainkeyframeEffect: KeyframeEffect

The Keyframe Effect for the mainAnimation

maxSpeed

maxSpeed: number = ...

The smallest speed out of all Animation's

minDelay

minDelay: number = ...

The smallest delay out of all Animation's

options

options: IAnimationOptions = {}

Stores the options for the current animation

Read more about the DefaultAnimationOptions

promise

promise: Promise<Animate[]>

Returns a promise that is fulfilled when the mainAnimation is finished

properties

properties: object = {}

The properties to animate

targetIndexes

targetIndexes: WeakMap<Node, number> = ...

The indexs of target Elements in Animate

targets

targets: Manager<number, Node> = ...

The list of Elements to Animate

totalDuration

totalDuration: number = -Infinity

The total duration of all Animation's

Protected visibilityPlayState

visibilityPlayState: TypePlayStates

Store the last remebered playstate before page was hidden

Static RUNNING

RUNNING: Set<Animate> = ...

Stores all currently running instances of the Animate Class that are actively using requestAnimationFrame to check progress, it's meant to ensure you don't have multiple instances of the Animate Class creating multiple requestAnimationFrames at the same time this can cause performance hiccups

Static animationFrame

animationFrame: number

Stores request frame calls

Static pauseOnPageHidden

pauseOnPageHidden: Boolean = true

Tells all animate instances to pause when the page is hidden

Accessors

[toStringTag]

  • get [toStringTag](): string
  • The Symbol.toStringTag well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the Object.prototype.toString() method.

    Returns string

Methods

add

  • add(target: HTMLElement): void
  • Adds a target to the Animate instance, and update the animation options with the change

    Note: KeyframeEffect support is really low, so, I am suggest that you avoid using the add method, until browser support for KeyframeEffect.updateTiming(...) and KeyframeEffefct.setKeyframes(...) is better

    beta

    Parameters

    • target: HTMLElement

    Returns void

all

  • Calls a method that affects all animations including the mainAnimation; the method only allows the animation parameter

    Parameters

    • method: (animation?: Animation, target?: HTMLElement) => void
        • (animation?: Animation, target?: HTMLElement): void
        • Parameters

          • Optional animation: Animation
          • Optional target: HTMLElement

          Returns void

    Returns DestroyableAnimate

allAnimations

  • allAnimations(method: (animation?: Animation, target?: HTMLElement) => void): DestroyableAnimate
  • Calls a method that affects all animations excluding the mainAnimation; the method only allows the animation parameter

    Parameters

    • method: (animation?: Animation, target?: HTMLElement) => void
        • (animation?: Animation, target?: HTMLElement): void
        • Parameters

          • Optional animation: Animation
          • Optional target: HTMLElement

          Returns void

    Returns DestroyableAnimate

Protected beginEvent

  • beginEvent(): void

cancel

catch

  • catch(onRejected: (reason?: any) => any): Animate
  • Catches error that occur in the this.promise Promise

    Parameters

    • onRejected: (reason?: any) => any
        • (reason?: any): any
        • Parameters

          • Optional reason: any

          Returns any

    Returns Animate

Protected createAnimations

  • createAnimations(param: { arrOfComputedOptions: any; oldCSSProperties: any; oncancel: any; onfinish: any; padEndDelay: any; timeline?: any }, len: number): void
  • Creates animations out of an array of computed options

    Parameters

    • param: { arrOfComputedOptions: any; oldCSSProperties: any; oncancel: any; onfinish: any; padEndDelay: any; timeline?: any }
      • arrOfComputedOptions: any
      • oldCSSProperties: any
      • oncancel: any
      • onfinish: any
      • padEndDelay: any
      • Optional timeline?: any
    • len: number

    Returns void

Protected createArrayOfComputedOptions

emit

finally

  • finally(onFinally: () => any): Animate

finish

getAnimation

  • getAnimation(target: HTMLElement): Animation

getCurrentTime

  • getCurrentTime(): number

getPlayState

getProgress

  • getProgress(): number

getSpeed

  • getSpeed(): number

getTiming

is

loop

  • loop(): void

newPromise

off

  • off(events: string | object | string[] | TypeAnimationEvents[], callback?: object | TypeListenerCallback, scope?: object): Animate

on

  • on(events: string | object | string[] | TypeAnimationEvents[], callback?: object | TypeListenerCallback, scope?: object): Animate

Protected onVisibilityChange

  • onVisibilityChange(): void

pause

play

remove

  • remove(target: HTMLElement): void
  • Removes a target from an Animate instance, and update the animation options with the change

    Note: KeyframeEffect support is really low, so, I am suggest that you avoid using the remove method, until browser support for KeyframeEffect.updateTiming(...) and KeyframeEffefct.setKeyframes(...) is better

    beta

    Parameters

    • target: HTMLElement

    Returns void

removeTarget

  • removeTarget(target: HTMLElement): void
  • Removes a target from an Animate instance

    Note: it doesn't update the current running options, you need to use the Animate.prototype.remove(...) method if you want to also update the running options

    Parameters

    • target: HTMLElement

    Returns void

reset

reverse

setCurrentTime

  • setCurrentTime(time: number): Animate

setProgress

  • setProgress(percent: number): Animate

setSpeed

  • setSpeed(speed?: number): Animate

stop

  • stop(): void

stopLoop

  • stopLoop(): void

then

  • then(onFulfilled?: (value?: any) => any, onRejected?: (reason?: any) => any): Animate
  • Fulfills the this.promise Promise

    Parameters

    • Optional onFulfilled: (value?: any) => any
        • (value?: any): any
        • Parameters

          • Optional value: any

          Returns any

    • Optional onRejected: (reason?: any) => any
        • (reason?: any): any
        • Parameters

          • Optional reason: any

          Returns any

    Returns Animate

toJSON

updateOptions

  • Update the options for all targets

    Note: KeyframeEffect support is really low, so, I am suggest that you avoid using the updateOptions method, until browser support for KeyframeEffect.updateTiming(...) and KeyframeEffefct.setKeyframes(...) is better

    beta

    Parameters

    Returns void

Static cancelFrame

  • cancelFrame(): void

Static requestFrame

  • requestFrame(): void

Generated using TypeDoc