Theses are the CSS properties to be animated as Keyframes
Read more on MDN
Determines if the animation should automatically play immediately after being instantiated.
The composite property of a KeyframeEffect resolves how an element's animation impacts its underlying property values.
To understand these values, take the example of a keyframeEffect value of blur(2) working on an underlying property value of blur(3).
replace - The keyframeEffect overrides the underlying value it is combined with: blur(2) replaces blur(3).add - The keyframeEffect is added to the underlying value with which it is combined (aka additive): blur(2) blur(3).accumulate - The keyframeEffect is accumulated on to the underlying value: blur(5).Read more on MDN
I recommend reading web.dev's article on web-animations.
Determines the delay of your animation in milliseconds. By passing it a callback, you can define a different delay for each element. The callback takes the index of each element, the target dom element, and the total number of target elements as its argument and returns a number.
Determines the direction of the animation;
reverse runs the animation backwards,alternate switches direction after each iteration if the animation loops.alternate-reverse starts the animation at what would be the end of the animation if the direction werenormal but then when the animation reaches the beginning of the animation it alternates going back to the position it started at.Determines the duration of your animation in milliseconds. By passing it a callback, you can define a different duration for each element. The callback takes the index of each element, the target dom element, and the total number of target elements as its argument and returns a number.
Determines the acceleration curve of your animation. Based on the easings of easings.net
Read More about easings on MDN
| constant | accelerate | decelerate | accelerate-decelerate |
|---|---|---|---|
| linear | ease-in / in | ease-out / out | ease-in-out / in-out |
| ease | in-sine | out-sine | in-out-sine |
| steps | in-quad | out-quad | in-out-quad |
| step-start | in-cubic | out-cubic | in-out-cubic |
| step-end | in-quart | out-quart | in-out-quart |
| in-quint | out-quint | in-out-quint | |
| in-expo | out-expo | in-out-expo | |
| in-circ | out-circ | in-out-circ | |
| in-back | out-back | in-out-back |
You can create your own custom cubic-bezier easing curves. Similar to css you type cubic-bezier(...) with 4 numbers representing the shape of the bezier curve, for example, cubic-bezier(0.47, 0, 0.745, 0.715) this is the bezier curve for in-sine.
Note: the easing property supports the original values and functions for easing as well, for example, steps(1), and etc... are supported.
Note: you can also use camelCase when defining easing functions, e.g. inOutCubic to represent in-out-cubic
Similar to delay but it indicates the number of milliseconds to delay after the full animation has played not before.
Note: endDelay will delay the onfinish method and event, but will not reserve the current state of the CSS animation, if you need to use endDelay you may need to use the fillMode property to reserve the changes to the animation target.
The properties of the extend animation option are not interperted or computed, they are given directly to the Web Animation API, as way to access features that haven't been implemented in @okikio/animate, for example, iterationStart.
extend is supposed to future proof the library if new features are added to the Web Animation API that you want to use, but that has not been implemented yet.
Note: it doesn't allow for declaring actual animation keyframes; it's just for animation timing options, and it overrides all other animation timing options that accomplish the same goal, e.g. loop & iterations, if iterations is a property of extend then iterations will override loop.
Defines how an element should look after the animation.
Allows you to manually set keyframes using a keyframe array
Read more on MDN
Determines if the animation should repeat, and how many times it should repeat.
Contols the starting point of certain parts of an animation
Another way to input options for an animation, it's also used to chain animations.
This ensures all animations match up to the total duration, and don't finish too early, if animations finish too early when the .play() method is called specific animations that are finished will restart while the rest of the animations will continue playing.
Note: you cannot use the padEndDelay option and set a value for endDelay, the endDelay value will replace the padded endDelay
Determines the animation playback rate. Useful in the authoring process to speed up some parts of a long sequence (value above 1) or slow down a specific animation to observe it (value between 0 to 1).
Note: negative numbers reverse the animation.
Determines the DOM elements to animate. You can pass it a CSS selector, DOM elements, or an Array of DOM Elements and/or CSS Selectors.
Alias of target
{@link AnimationOptions.target | target }
Represents the timeline of animation. It exists to pass timeline features to Animations (default is DocumentTimeline).
As of right now it doesn't contain any features but in the future when other timelines like the ScrollTimeline, read the Google Developer article for examples and demos of ScrollTimeLine
Adds an offset ammount to the delay, for creating a timeline similar to animejs
Occurs when the animation for one of the targets is cancelled, meaning when animating many targets that are cancelled at different times this will run multiple times. The arguments it takes is slightly different from the rest of the animation options.
The animation argument represents the animation for the current target.
the current target element
the index of the current target element in Animate.prototype.targets
the total number of target elements
the animation of the current target element
Warning: the order of the callback's arguments are in a different order, with the target element first, and the index second.
Occurs when the animation for one of the targets completes, meaning when animating many targets that finish at different times this will run multiple times. The arguments it takes is slightly different from the rest of the animation options.
The animation argument represents the animation for the current target.
the current target element
the index of the current target element in Animate.prototype.targets
the total number of target elements
the animation of the current target element
Warning: the order of the callback's arguments are in a different order, with the target element first, and the index second.
Generated using TypeDoc
Animation options control how an animation is produced, it shouldn't be too different for those who have used
animejs, orjquery's animate method.An animation option is an object with keys and values that are computed and passed to the
Animateclass to create animations that match the specified options.