Quantcast
Viewing all articles
Browse latest Browse all 117

CSS3 Animations – Part 3

So today we’re once again visiting the @keyframes rule to animate some fun stuff on the screen – today a sale parachute. Why? Well, why not!

Here is the CSS3 animation We’ll be covering.

For those who are new to this blog and CSS3 animations in general I suggest you start with the CSS3 Animations article for a basic grounding of what’s going on here.

As usual I won’t be going into great detail with the code – I’ll let you take a look at each line to see what’s going on. Basically we’ve got a div with an image in it and come css controlling the animation through a series of position and angle transitions.

Here’s the HTML

Here’s the CCS

What does that all mean?

In short the image goes through a transition from the top left of the page (where it is only a few pixels wide and high) to the middle of the page where it is full-size. Every 10% of the full transition there is a rotation of 20 degrees either side – giving it the swinging effect. Pretty cool!

The animation is set to run over 20 seconds and only to run once (-webkit-animation-iteration-count:1;). Since we want the parachute to stay in the end position I added this (-webkit-animation-fill-mode: forwards;).

Whilst this is only a quick demo with CSS3 animations you can immediately see the opportunities for strong CTA’s and attention grabbing special offers for your website. All we need now is for all browsers and devices to be able to handle it! Almost there…

The post CSS3 Animations – Part 3 appeared first on Liquid Web Design Company London.


Viewing all articles
Browse latest Browse all 117

Trending Articles