You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details
The event handler for each time the animation starts
Reason
In case someone wants to change the state it starts, as they can currently do when it finishes.
Currently, as per the example, setting any state before the calling play() causes issues when there is a delay or endDelay
onAnimationStart - possible handler. Maybe a higher preference to the onKeyFrame handler?
Details
This would fire on (or just before) the first frame being initiated (or the implied first frame in the case of implicit to/from keyframes)
Reason
To fire an event the second that the animation actually starts (after delays)
onAnimationFinish - possible handler. Maybe a higher preference to the onKeyFrame handler?
Details
This would fire on (or just after) the last frame being initiated (or the implied last frame in the case of implicit to/from keyframes)
Reason
To fire an event the second that the animation actually ends (before delays)
Details
This would fire on each keyframe that is hit, passing the index of the keyframe
Reason
You can fire events at certain stages of the animation process as per the details in the proposal link just above.
Also, is there a way to detect if it's actually running or just delayed? I saw the AnimationPlayState enumeration but that doesn't;t have a startDelay or endDelay state.
I only ask because if it's delayed I'd rather call cancel() but if it's running I'd rather call finish()
(Should I open a new issue)
The text was updated successfully, but these errors were encountered:
Moving to web-animations-2 because we're not going to add any major new features to level 1.
There are a few similar issues where I've pointed out some of the difficulties in doing this but it's clear we need to do something in this space eventually. I'd rather see group effects fleshed out first, however, since that will introduce a lot of constraints on the solution.
Ref: https://drafts.csswg.org/web-animations-1/#the-animation-interface
Could these proposed event handlers be added to the Animation interface?
onstart
Example/proposal: https://jsfiddle.net/glenn2223/gj7heoLv/
Details
The event handler for each time the animation starts
Reason
In case someone wants to change the state it starts, as they can currently do when it finishes.
Currently, as per the example, setting any state before the calling
play()
causes issues when there is adelay
orendDelay
onAnimationStart
- possible handler. Maybe a higher preference to theonKeyFrame
handler?Details
This would fire on (or just before) the first frame being initiated (or the implied first frame in the case of implicit to/from keyframes)
Reason
To fire an event the second that the animation actually starts (after delays)
onAnimationFinish
- possible handler. Maybe a higher preference to theonKeyFrame
handler?Details
This would fire on (or just after) the last frame being initiated (or the implied last frame in the case of implicit to/from keyframes)
Reason
To fire an event the second that the animation actually ends (before delays)
onKeyFrame (index: number)
Proposal: https://jsfiddle.net/glenn2223/uwg589Lx/
Details
This would fire on each keyframe that is hit, passing the index of the keyframe
Reason
You can fire events at certain stages of the animation process as per the details in the proposal link just above.
Also, is there a way to detect if it's actually running or just delayed? I saw the
AnimationPlayState
enumeration but that doesn't;t have astartDelay
orendDelay
state.I only ask because if it's delayed I'd rather call
cancel()
but if it's running I'd rather callfinish()
(Should I open a new issue)
The text was updated successfully, but these errors were encountered: