Home Reference Source
import AnimationController from '~/controllers/AnimationController.js'
public class | source

AnimationController

Extends:

ViewController → AnimationController

Manages an animated element

Constructor Summary

Public Constructor
public

constructor(element: HTMLElement, animations: Animation[])

Creates an animation controller.

Method Summary

Public Methods
public

Starts the animation.

public

Starts the opposite animation.

Inherited Summary

From class ViewController
public static

forClass(className: string, predicate: Function, root: HTMLElement)

Creates a view controller directly for all members of a class.

public static

of(elem: string | Element): ViewController

Returns a canolical VC of an element if it exists

Public Constructors

public constructor(element: HTMLElement, animations: Animation[]) source

Creates an animation controller. Do note that some animations require elements to be in the DOM at the time otherwise their width/height calculations would be incorrect.

Override:

ViewController#constructor

Params:

NameTypeAttributeDescription
element HTMLElement

element to animate

animations Animation[]

See Animation

Public Methods

public triggerAnimation() source

Starts the animation. Do note that calculation for some animations is done here so it may be needed to expand

public untriggerAnimation() source

Starts the opposite animation. e.g. hide