文档结构  
翻译进度:7%     翻译赏金:0 元     ¥ 我要打赏

Animation libraries.

Take your CSS animations to the next level with our Animating with CSS course by Donovan Hutchinson, the man behind CSS Animation Rocks.

Frontend web design has been through a revolution in the last decade. In 2007, most of us were still designing static magazine layouts – in 2017 we’re building ‘digital machines’ with thousands of resizing, coordinated, moving parts.

Quite simply, great UI designers need to be great animators too – with a solid working understanding of the web animation techniques.

This is the latest update to our guide to helping you choose the right animation library for each task. We’re going to run-through 9 free, well-coded animation libraries best-suited to UI design work – their strengths and weaknesses and when to choose each one.

第 1 段(可获 1.56 积分)

Keep in mind that we’re looking at each library from the perspective of a code-savvy UI designer – not as a ‘code guru’ developer. Some of these libraries are pure CSS. Others are JavaScript, but none require anything more than basic HTML/CSS understanding to be useful. Link the library – add a CSS class.

More from this author

The 2017 Top 9 Animation Libraries List

  1. Animate.css
  2. Bounce.js
  3. AnimeJS
  4. Magic Animations
  5. DynCSS
  6. CSShake
  7. Hover.CSS
  8. Velocity.js
  9. AniJS
第 2 段(可获 1.24 积分)

Animate.css

Animate.css是可用的最轻巧也易于使用的CSS动态库之一。 在你的项目中添加 Animate库和链接CSS并且在HTML元素中添加所需的CSS类一样简单。如果你愿意,你还可以使用jQuery在某个特定时间触发动画。

Animate.css

第 3 段(可获 1.14 积分)

As of mid-2017, it still one of the most popular and widely-used CSS animation libraries and its minified file is small enough (16.6kb) for inclusion in mobile websites as well. It has 41,000 stars on Github and is often packaged as a component in many larger projects.

Animate.css is still under active development after 4 years. This is one of the simplest and most robust animation libraries and we wouldn’t hesitate to use this in any project.

Bounce.js

Bounce.js is a JavaScript animation library that focusses on providing a selection of unique fun, bouncy, ‘Warner brothers-esque’ animations to your website.

第 4 段(可获 1.33 积分)

Bounce.js

Bounce.js is a neat animation library that ships with about ten animation ‘pre-sets’ – hence the small size of the library. As with animate.css, the animations are smooth and flawless. You might want to consider using this library if your needs center around ‘pop and bubble’ style animation types and could benefit from a lower file size overhead.

AnimeJS

第 5 段(可获 1.1 积分)

AnimeJS is the only newcomer to our list – but has won a great many converts in the 12 months since it’s creation. It’s incredibly versatile and powerful and wouldn’t be out of place powering HTML game animations. The only real question is ‘is it overkill for simple web apps‘?

Maybe. But as it’s also fast, small and relatively easy to learn, it’s hard to find fault with it.

AnimeJS is described as a lightweight JavaScript animation library that ‘works with any CSS Properties, individual CSS transforms, SVG or any DOM attributes, and JavaScript Objects’. It’s pretty awesome – so awesome, in fact, that the GIF capture I took below can’t do justice to how smooth and buttery the motion is.

第 6 段(可获 1.58 积分)

AnimeJS

This project is available on GitHub.

Most impressively, Anime.JS has stunning ‘documentation’ that demonstrates HTML, JavaScript code and working examples in a beautiful app environment.

Iin short, if you’re comfortable with a JavaScript animation solution, it’s hard to find reasons to ignore Anime.JS.

Magic Animations

Magic Animations has been one impressive animation libraries available. It has many different animations, many of which are quite unique to this library. As with Animate.css, you can implement Magic by simply importing the CSS file. You can also make use of the animations from jQuery. This project offers a particularly cool demo application.

第 7 段(可获 1.59 积分)

Magic Animations

Magic animations file size is moderate as compared to animate.css and it is known for its signature animations, such as the magic effects, foolish effects, and bomb effects.

If you’re looking for something a little out of the ordinary, I would definitely recommend you to give this animation library a shot in your next project. You won’t be disappointed.

DynCSS

DynCSS is an animation library that you might like to use in your website along with parallax effect. To get a clearer idea of what you can do with this library, take a look at this demo.

第 8 段(可获 1.51 积分)

DynCSS

DynCSS is a simple library that might grow in popularity in the near future, but it is currently a fairly new project, as demonstrated by its number of stars on GitHub. One of the cool features that this library offers is the rotation of elements with respect to scrolling, which Vittorio demonstrates beautifully on the DynCSS home page (which makes a perfect use case for parallax related pages).

第 9 段(可获 1.16 积分)

CSShake

CSShake delivers exactly what it says on the box – a CSS library designed specifically for shaking elements within your webpage. As you might expect, there are a quite a number of variations available for shaking your web components.

CSShake

Apple popularized the UI trope of vigorously shaking a UI element (a dialog, modal or textbox) when a user enters an incorrect response – mimicking a person shaking their head ‘no’. CSShake provides a range of interesting “shake” animations and there is no lack of variation in this library.

第 10 段(可获 1.28 积分)

Though currently, the library is more popular than DynCSS, I feel that often file-size might not be justified by the functionality it adds. While the animations are clever, I can’t think of a great many use cases where you wouldn’t still need to include a second animation library for non-shaking effects.

But perhaps I’m simply lacking imagination?

Hover.css

Hover.css is a CSS animation library designed for use with buttons and other UI elements in your website. It has really nice 2D transitions, along with a host of other well-crafted animations.

Hover.css

  • Current Version:
  • Popularity:
  • Description: “Easily apply to your own elements, modify or just use for inspiration.”
  • Library Size: 104.2 kB
  • GitHub: https://github.com/IanLunn/Hover
  • License:
第 11 段(可获 1.54 积分)

Hover.css is best suited for animating discrete page elements such as buttons, logos, SVG components or featured images more than larger, complex page animations. It has a comprehensive list of routines and this accounts for its relatively large size (however, I still feel that the size can be much more optimized). Arguably its most notable animation effects are its distinctive speech bubbles and curls.

Velocity.js

Velocity.js is another sophisticated, full-featured JavaScript animation suite including functions such as Fade & Slide, Scroll, Stop, Finish, Reverse and many others.

第 12 段(可获 1.11 积分)

It currently boasts an impressive list of big-name users, including Tumblr, WhatsApp, MailChimp, Scribd, Gap and HTC, so you know it’s been battle-tested against large userbases and weird edge cases.

Velocity JS

Velocity might not a perfect fit for some as it is a JavaScript animation engine and it is actually an animation engine using the same API as jQuery’s $.animate(). This works both with and without the presence of jQuery. That said, it’s incredibly fast and it features include color animation, transforms, loops, easing – essentially it’s the best of jQuery and CSS transitions combined.

第 13 段(可获 1.51 积分)

AniJS

Our final library is interesting for its unique approach. AniJS is an animation library that allows you to add animations to elements in a simple ‘sentence-like’ struture. Take the following format:

If click, On Square, Do wobble animated To .container-box

<div data-anijs="if: click, do: flipInY, to: .container-box"></div>

If you don’t have a long familiarity with JavaScript, this may well be a great way to step into JS-choreographed movements.


AniJS

  • Creators: anijs
  • Released: 2014
  • Most Recent Update:
  • Popularity:
  • Description: “A Library to Raise your Web Design without Coding.”
  • Library Size: 10.5 kB
  • GitHub: https://github.com/anijs/anijs
  • License:

AniJS is a library with a very reasonable size factoring in its functionality. The format it uses for implementation is quite original and different as compared to other animation libraries (which many other might find unconventional).

Nevertheless, this library is worth giving a try at least once for your projects. It may lack the overall power and polish of some of the competition but it has the potential to grow in the future.

第 14 段(可获 2.08 积分)

Which library should you choose?

There are many animation libraries out there ready and waiting to be implemented in your project. Those listed above are a few with the best combination of sophistication and stability.

If you’re looking for a simple-to-use, robust CSS solution, Animate.CSS is probably the most versatile, ‘bang-for-buck’ option available.

If you’re looking for a more complete, powerful JavaScript option, VelocityJS and Anime.JS are very hard to split. Velocity currently has the track record and larger install base, but Anime.JS is incredibly polished and exciting for such a new project. Right now, Anime.JS’s beautiful documentation might be enough to win us over.

Although using an animation library in your web application can certainly improve interactivity, overdoing it defeats the purpose and often confuses the user. Be careful and use them judiciously.

Do you use animation libraries for your projects? What are your favorite animation libraries?

Take your CSS animations to the next level with our Animating with CSS course by Donovan Hutchinson, the man behind CSS Animation Rocks.

第 15 段(可获 2.23 积分)

文章评论