constelation / monorepo

Mono repo for constelation's Components, functions, and CONSTANTS
https://constelation.github.io/monorepo/
MIT License
12 stars 3 forks source link

abstract tweening, scrollToY takes target element #91

Closed bendman closed 7 years ago

bendman commented 7 years ago

There were a few ways to go about this, but I decided to start with generalizing the tweening of values, then making the minimal change to allow scrollToY to take the scrolling element as an argument.

Another approach would be to add an animated scrollTo on ScrollView components, but that wouldn't help with non-constelation nodes.

It also might be valuable to export the abstracted tweenValue function, but I don't think that necessarily belongs in a dom module.

Also... since the easing isn't as predictable as a time-clamped version, it might be useful to allow a finalCallback or pass a isDone boolean to the callback when the tweening is done. The first option is arguably cleaner but having two function arguments that do similar things might be odd.

closes #90

kylpo commented 7 years ago

Yeah, adding a scrollTo to ScrollView is definitely on the roadmap. This'll be great in the meantime!

kylpo commented 7 years ago

published as 14.4.0, @bendman

bendman commented 7 years ago

Thanks!