Animation: Implement 'Hooks.transition' hook #121
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Today, we have a
Hooks.animation
hook here:https://github.com/revery-ui/revery/blob/master/src/UI_Hooks/Revery_UI_Hooks.re and https://github.com/revery-ui/revery/blob/master/src/UI_Hooks/Animation.re
That is used as follows:
(from https://github.com/revery-ui/revery/blob/master/examples/Hello.re)
I think it'd be convenient to have a
Hooks.transition
hook, that would work as follows:The idea is that you could use this along with some other events, for example:
This would enable a smooth transition between the opacity values, as opposed to just directly switching from 0.5 <-> 1.0. The
Hooks.transition
hook could leverageHooks.state
under the hood to keep track of the last value. If the last value is different, it could start an animation and use the animated value. Otherwise, it could just return the current value.The text was updated successfully, but these errors were encountered: