maxwellito / vivus

JavaScript library to make drawing animation on SVG
MIT License
15.25k stars 1.13k forks source link

No "ease-in-out" timing function? #246

Open tsawitzki opened 2 years ago

tsawitzki commented 2 years ago

Hello and thanks for this great little plugin!

Is there no way do declare a Vivus.EASE_IN_OUT to use the native ease-in-out timing-function? If I enter it, it falls back to linear (as Vivus can't interpret it obviously).

As Vivus Instant has it, I wonder why the JS translation can't refer to that native function?

maxwellito commented 2 years ago

Hello!

Vivus and Vivus-instant run differently. Vivus is in JavaScript, this is why you have to provide a JS function. Vivus-instant generates CSS code to run the animation. This is why you cannot use the native CSS ease transition with Vivus

tsawitzki commented 2 years ago

ok, thanks for the information! is there no way to implement it in JS for a further release? 99% of animations I do rely on this behaviour …

maxwellito commented 2 years ago

I'm afraid this won't be implemented. Vivus (JavaScript library) offers controls to set the progress of an animation and speed which would be more complex to implement in CSS. I recommend you to translate the 'ease' animation function in JS.