Function animateEvents
- animate
Events (fn, store?): ((node: Element, data: {
from: DOMRect;
to: DOMRect;
}, ...rest: any) => AnimationConfig) Parameters
- fn: ((node: Element, data: {
from: DOMRect;
to: DOMRect;
}, ...rest: any) => AnimationConfig)A Svelte animation function.
- (node, data, ...rest): AnimationConfig
Parameters
Returns AnimationConfig
Optional
store: MinimalWritable<boolean>An optional boolean minimal writable store that is set to true when animation is active.
Returns ((node: Element, data: {
from: DOMRect;
to: DOMRect;
}, ...rest: any) => AnimationConfig)Wrapped animation function.
- (node, data, ...rest): AnimationConfig
Parameters
Returns AnimationConfig
- fn: ((node: Element, data: {
Svelte doesn't provide any events for the animate directive.
The provided function below wraps a Svelte animate directive function generating bubbling events for start & end of animation.
These events are
animate:start
andanimate:end
.This is useful for instance if you are animating several nodes in a scrollable container where the overflow parameter needs to be set to
none
while animating such that the scrollbar is not activated by the animation.Optionally you may also provide a boolean writable store that will be set to true when animation is active. In some cases this leads to an easier implementation for gating on animation state.