finnfiddle / potion

React components for declaratively composing animated, interactive visualizations.
https://potion.js.org/
MIT License
184 stars 5 forks source link

Animation help for speed and looping #7

Closed Gittekken closed 6 years ago

Gittekken commented 6 years ago

Hi, new to animation and I was wondering how to go about adjusting the speed of the animation. seems like there is only one set speed. Is there a parameter to adjust how fast the animation is going? Also how were you able to loop the animations like in the gallery part of your website? I would like to loop the animation a certain amount of times.

Thanks Ken

finnfiddle commented 6 years ago

@Gittekken it's not documented yet but you can pass springStiffness and springDamping props to all layouts that get oassed on to the react motion spring internally. See here for an idea of how to configure. With regards to looping you just need to pass new data to your layout - eg via the data prop and it will update. For example use a setTimeout to generate new data every X seconds and pass this to your layout. Make sense?