Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

A quick look at CSS3 animations

Parent Feed: 

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.

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web