Name | Type |
---|---|
Args |
void |
-
BaseAnimationHandle
▸ play(...opts
): BaseAnimationHandle
<Args
>
A wrapper of Web Animations API's play. It's similar to GSAP's play()
.
Name | Type |
---|---|
...opts |
Args extends void ? [PlayOptions?] : [PlayOptionsWithArgs <Args >] |
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:44
▸ reverse(): BaseAnimationHandle
<Args
>
A wrapper of Web Animations API's reverse. It's similar to GSAP's reverse()
.
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:50
▸ cancel(): BaseAnimationHandle
<Args
>
A wrapper of Web Animations API's cancel. It's similar to GSAP's kill()
.
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:54
▸ finish(): BaseAnimationHandle
<Args
>
A wrapper of Web Animations API's finish.
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:58
▸ pause(): BaseAnimationHandle
<Args
>
A wrapper of Web Animations API's pause. It's similar to GSAP's pause()
.
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:62
▸ setTime(time
): BaseAnimationHandle
<Args
>
A setter of Web Animations API's currentTime. It's similar to GSAP's seek()
.
If you pass function, you can get endTime from its argument.
Name | Type |
---|---|
time |
number | (endTime : number ) => number |
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:68
▸ setPlaybackRate(rate
): BaseAnimationHandle
<Args
>
A wrapper of Web Animations API's updatePlaybackRate. It's similar to GSAP's timeScale()
.
If you pass function, you can get current playbackRate from its argument.
Name | Type |
---|---|
rate |
number | (prevRate : number ) => number |
BaseAnimationHandle
<Args
>
src/react/hooks/useAnimation.ts:76
▸ waitFor(event
): Promise
<BaseAnimationHandle
<Args
>>
A getter of Promise that will be resolved in specified timing.
finished
: resolved when animation is finished and its playback direction is normal.reverseFinished
: resolved when animation is finished and its playback direction is reversed.
Name | Type |
---|---|
event |
WaitingAnimationEventName |
Promise
<BaseAnimationHandle
<Args
>>