Drupal

A quick look at CSS3 animations

CSS3 animations are finally becoming a useful tool in the front end developer's kit!


CSS3 animations are finally becoming a useful tool in the front end developer's kit! Browser support is progressing, however there is no IE support yet (surprised?) and Opera currently doesn't support animations, but may in the future.

Despite the plethora of vendor prefixes to keep track of, one can really pull off some interesting animations; transforms and transitions anyone?

Check out the live demo at http://dabblet.com/gist/1867896/

The full demo is available over on dabblet.com if you want to play with the code, or grab a copy from github.

I know... I could have easily used images for the graphical elements and it's really an exorbitant amount of css to accomplish the goal, but where is the fun in that? There is also cpu/gpu use to take into account, but this little example isn't too heavy in that respect.

A couple of neat things about the animation:

  • Everything is html/css. No images. Yep, lots of divs/css, but no images. (Thanks Graeme Blackwood for the original css Druplicon, and Red Team Design for the css HTML5 logo)
  • @keyframes are super fun! Using percentages for steps, one can work through (I would guess) some very complex animations.
  • I did use a little JavaScript library, Lea Verou's -prefix-free to allow me to write plain css, without having to keep track of vendor prefixes. One could also use Prefixr afterwards to fill in the prefixes.

If you're using a modern browser and want to see a CSS3 transition in the wild, resize your browser! Our site uses transition: all 0.5s ease; to dress up the responsive layout transition.

Similar posts

Get notified on new marketing insights

Be the first to know about new B2B SaaS Marketing insights to build or refine your marketing function with the tools and knowledge of today’s industry.