Animating CSS3 Gradients

View code Play Walkthrough

Description

CSS3 gradients cannot be animated as of now. There are a variety of tricks which involve the use of background-position or pseudo elements to fake an animation for gradients. But those methods require a lot of manual fine tuning and don't yield the desired results.

A cool trick @kushsolitary suggested to me was to breakdown the gradient into a background-color containing a static color and a background-image containing a translucent gradient and then animating the background color to implement animated gradients.

Most common gradients used by web designers can be broken down into an image and a color logically. They mostly contain a single color and a translucent white-black overlay.

In this demo, I have coded 7 different types of animated gradients. The method used is same but the implementation is different in every case. The different implementations make it easier to logically derive the kind of animated gradient you want.

I have used CSS3 animations in this demo, but this approach can be used with transitions as well to create hover effects and related stuff.

Add New Comment

4 Comments

(close)
Alexandr Zibert

Alexandr Zibert

I liked it. Thanks for the great idea.

Wang Sheng

Wang Sheng

This is very cool. Exactly what Im looking for. Thanks a lot for sharing the great idea.

erik

erik

I apologize for my English typing the code in dreamweaver cs6 but the buttons do not dare leave the degrades are there but does not dare degrade me know if any webkit js or java or missing as i was reading that is not encouraged because the pages Cruising if firefox safari or chrome greetings

best razer Mouse 2015 Have

best razer Mouse 2015 Have

It reminds me in the ancient mouse hunt game that my dad had on our first computer in the 1980′s.
Side buttons about the vertical side ensure easy access and
this also helps to reduce just about any accidental actuation while pressing hard for the mouse.
Best gaming mices However some lag is inevitable and hardcore first-person shooter gamers may desire to stick with a wired device.

If you’re looking for methods to exterminate the mice present in your home, there are
two paths that you’ll be able to follow. One from the most critical peripheral devices that may have
a very substantial effect with a gamer’s standard performance may be the mouse and not simply any type
of mouse.

5x 10x 15x 20x

4 Comments

Description