Web Animations API Explained

Written by mozilla | Published 2020/04/19
Tech Story Tags: animation | css-animation | mozilla | dom | web-animations-api | mdn-documentation | beginners | hackernoon-top-story

TLDR The Web Animations API allows for synchronizing and timing changes to the presentation of a Web page. It does so by combining two models: the Timing Model and the Animation Model. API provides a common language for browsers and developers to describe animations on DOM elements. API adds some new features to document and element interfaces. API is a free software community founded in 1998 by members of Netscape. by Mozilla Contributors. API Explained: Explained. 2,333 reads and usage of the API.via the TL;DR App

The Web Animations API allows for synchronizing and timing changes to the presentation of a Web page, i.e. animation of DOM elements. It does so by combining two models: the Timing Model and the Animation Model.

Concepts and usage

The Web Animations API provides a common language for browsers and
developers to describe animations on DOM elements. To get more
information on the concepts behind the API and how to use it, read Using the Web Animations API.

Web Animations interfaces

Provides playback controls and a timeline for an animation node or source. Can take an object created with the
KeyframeEffect()
constructor.
Describes sets of animatable properties and values, called keyframes and their timing options. These can then be played using the
Animation()
constructor.
Represents the timeline of animation. This interface exists to define timeline features (inherited by
DocumentTimeline
and future timeline objects) and is not itself accessed by developers.
Actually part of CSS Animations.
Represents animation timelines, including the default document timeline (accessed using the
Document.timeline
property).
all accept an optional dictionary object of timing properties.

Extensions to other interfaces

The Web Animations API adds some new features to
document
and
element
.
Extensions to the
Document
interface
The
DocumentTimeline
object representing the default document timeline.
Returns an Array of
Animation
objects currently in effect on elements in the
document
.
Extensions to the
Element
interface

Element.animate()
A shortcut method for creating and playing an animation on an element. It returns the created
Animation
object instance.
Returns an Array of
Animation
objects currently affecting an element or which are scheduled to do so in future.

Specifications

See also


Credits


Written by mozilla | Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape.
Published by HackerNoon on 2020/04/19