Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with rolling a timeline backwards with non-animating functions #1316

Open
NCarson opened this issue Apr 15, 2024 · 0 comments
Open

Issues with rolling a timeline backwards with non-animating functions #1316

NCarson opened this issue Apr 15, 2024 · 0 comments

Comments

@NCarson
Copy link

NCarson commented Apr 15, 2024

I have been trying to roll a timeline backwards with
non-animating functions included. and I have
been having trouble figuring out what event to listen to.
Examining the code the start, step, and finish events
fire going forwards but only step fires going backwards.

My use case is to attach a filter to an element. I do not
think there is any way to animate that nativly. But since
it is part of the animation, I need to have it queued in the timeline.

Anyways I found a way to do it with the during function:

draw.animate(1, at+duration, 'absolute')
    .during( (progress) => {
        let name = (progress == 1) ? 'none' : 'url(#motion-blur)'
        draw.attr({filter:name})
    })

Since the duration is 1, the function will only run once per animation cycle.
The progress will be either 0 on 1 depending on the direction
the timeline is going in.

I am not sure I call this a bug, but it seems to be under-documented.
I think it would be nice to list the arguments that runner methods
will provide in the callback, as to get more of idea of what they do.
Also, what kind of events are fired does not seem to be listed in the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant