WorkletAnimation Class
A worklet animation (https://drafts.css-houdini.org/css-animation-worklet-1/#worklet-animation-desc): an animation whose current time does not determine the local time of its effects. An animator, an instance of a class registered in the animation worklet of the document (CSS.animationWorklet, Document.AnimationWorklet), gets the current time of the animation at each frame and sets the local times of the effects.
public sealed class WorkletAnimation : AnimationRemarks
The animator instance exists while the animation is not idle. An effect has no local time (it is not in effect) until the animator sets it, and keeps the last one the animator set: a worklet animation that is finished still applies its effects.
See also
- Inheritance
AnimationWorkletAnimation
Constructors
| Name | Description |
|---|---|
| WorkletAnimation(string, AnimationEffect?) | Creates a worklet animation of an effect on the default timeline of the document of the current global object (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-workletanimation-workletanimation). |
| WorkletAnimation(string, AnimationEffect?, AnimationTimeline?) | Creates a worklet animation of an effect on a timeline (null for no timeline). |
| WorkletAnimation(string, AnimationEffect?, AnimationTimeline?, object?) | Creates a worklet animation of an effect on a timeline, with the options given to the constructor of the animator (a value of the script engine, structured cloned). |
| WorkletAnimation(string, IReadOnlyList<AnimationEffect>) | Creates a worklet animation of a group of effects, whose local times the animator sets individually, on the default timeline of the document of the current global object. |
| WorkletAnimation(string, IReadOnlyList<AnimationEffect>, AnimationTimeline?) | Creates a worklet animation of a group of effects on a timeline (null for no timeline). |
| WorkletAnimation(string, IReadOnlyList<AnimationEffect>, AnimationTimeline?, object?) | Creates a worklet animation of a group of effects on a timeline, with the options given to the constructor of the animator. |
WorkletAnimation overloads
WorkletAnimation(string, AnimationEffect?)
WorkletAnimation.csCreates a worklet animation of an effect on the default timeline of the document of the current global object (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-workletanimation-workletanimation).
public WorkletAnimation(string animatorName, AnimationEffect? effects = null)Parameters
animatorNamestring- The name of an animator registered in the animation worklet of the document.
effectsAnimationEffect?- The effect, or null.
Exceptions
TypeErrorException- No animator of the name is registered, or its registration is invalid.
See also
WorkletAnimation(string, AnimationEffect?, AnimationTimeline?)
WorkletAnimation.csCreates a worklet animation of an effect on a timeline (null for no timeline).
public WorkletAnimation(string animatorName, AnimationEffect? effects, AnimationTimeline? timeline)WorkletAnimation(string, AnimationEffect?, AnimationTimeline?, object?)
WorkletAnimation.csCreates a worklet animation of an effect on a timeline, with the options given to the constructor of the animator (a value of the script engine, structured cloned).
public WorkletAnimation(string animatorName, AnimationEffect? effects, AnimationTimeline? timeline, object? options)Parameters
animatorNamestringeffectsAnimationEffect?timelineAnimationTimeline?optionsobject?
Exceptions
DomException- A
DataCloneErrorwhen the options cannot be cloned.
See also
WorkletAnimation(string, IReadOnlyList<AnimationEffect>)
WorkletAnimation.csCreates a worklet animation of a group of effects, whose local times the animator sets individually, on the default timeline of the document of the current global object.
public WorkletAnimation(string animatorName, IReadOnlyList<AnimationEffect> effects)WorkletAnimation(string, IReadOnlyList<AnimationEffect>, AnimationTimeline?)
WorkletAnimation.csCreates a worklet animation of a group of effects on a timeline (null for no timeline).
public WorkletAnimation(string animatorName, IReadOnlyList<AnimationEffect> effects, AnimationTimeline? timeline)Parameters
animatorNamestringeffectsIReadOnlyList<AnimationEffect>timelineAnimationTimeline?
See also
WorkletAnimation(string, IReadOnlyList<AnimationEffect>, AnimationTimeline?, object?)
WorkletAnimation.csCreates a worklet animation of a group of effects on a timeline, with the options given to the constructor of the animator.
public WorkletAnimation(string animatorName, IReadOnlyList<AnimationEffect> effects, AnimationTimeline? timeline, object? options)Parameters
animatorNamestringeffectsIReadOnlyList<AnimationEffect>timelineAnimationTimeline?optionsobject?
See also
Properties
| Name | Description |
|---|---|
| AnimatorName | Gets the name of the animator of the animation (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-workletanimation-animatorname). |
AnimatorName
WorkletAnimation.csGets the name of the animator of the animation (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-workletanimation-animatorname).
public string AnimatorName { get; }