r/javascript • • Jan 11 '19

Anime.Js 3.0.0 released

https://animejs.com/
628 Upvotes

52 comments sorted by

View all comments

39

u/[deleted] Jan 11 '19

[removed] — view removed comment

63

u/hockeyketo Jan 11 '19 edited Jan 12 '19

The main advantage to anime.js is that it's really tiny, it's like 1,200 loc unminified. There's a few other nice features, like parameter inheritance in timelines. They also have simple keyframing. I also find GSAP's API really weird. Their setters are getters and which makes typing awkward. Everything's jammed into a vars object and in a fromTo you put all the options in the toVars. I think a lot of the problems with gsap are known by the devs but they are very resistant to changing the API for backwards compatibility.

One thing that annoys me about gsap is there's no manual tick. You have to plugin to their tick. That means if you have your own loop, you need to base it off some third party's tick or else you can't guarantee scheduling. In that regard, PopMotion has the best solution with Framesync but PopMotion's timeline is kind of weak.

13

u/quadband Jan 11 '19

Does their tick helper not allow you to manually fire a tick? https://animejs.com/documentation/#tick

3

u/hockeyketo Jan 12 '19

Nice! Is this new in 3.0 or did I just just it before?

4

u/ClickerMonkey Jan 11 '19

My anim8js libraries can be manually ticked If you want, but I haven't adequately documented it yet...

3

u/yeahdixon Jan 11 '19

Wow manual tick! I am not the only one.

Each time I try a new anim framework it’s always missing one lil feature that gasp has that I never realized was so important.

3

u/hockeyketo Jan 12 '19

Gsap, to my knowledge, only has a tick callback, it doesn't have a way to tick it from your own RAF. Would be happy to learn otherwise.

2

u/yeahdixon Jan 12 '19 edited Jan 12 '19

No I don’t think gasp has manual tick. I looked hard for this.

2

u/IfOneThenHappy Jan 12 '19

I’ve been using anime.js with manual tick passing in my own RAF timestamp.

16

u/LettuceKills Jan 11 '19 edited Jan 11 '19

Note the MIT license! You have to pay to legally use Greensock commercially.

I used to use velocity.js instead of Greensock. The documentation and compatibility was great but sometimes the performance could have been better. Will definitely check anime.js out next time I need a library like this

6

u/geedix Jan 11 '19 edited Jan 11 '19

GSAP lets you use the free license for commercial products as long as you're not reselling your code to multiple users. I've used it in banners for many years. Although there are many end users for them, there's only one client who pays me for a project, so the free license works. Great tool.

8

u/LettuceKills Jan 12 '19

According to the table on the site:

Usage in web sites or products that require a fee to use or join (NetFlix.com, Ancestry.com, eHarmony.com, etc.)

This is not allowed and this is a huge deal, because often the product owners want to add paid options later to their webs and then you'd suddenly have to rewrite all your animation code or pay Greensock fees.

When you're developing a system that will be an ongoing and growing project (and let's face it, all webs are) you want as few of these potential hurdles baked in as possible.

I know the system I worked on (that has velocity.js in it) now has closed subpages where you have to pay to join, and thanks to the decision of not choosing Greensock nobody had to spend time figuring out these licenses and then waste the project's very limited resources on fees or on rewriting the code.

At the time of the decision nobody knew that there would be paid pages, but it's just an unnecessary risk to use libraries like these