Book Image

Designing Next Generation Web Projects with CSS3

By : Sandro Paganotti
Book Image

Designing Next Generation Web Projects with CSS3

By: Sandro Paganotti

Overview of this book

CSS3 unveils new possibilities for frontend web developers: things that would require JavaScript, such as animation and form validation, or even third party plugins, such as 3D transformations, are now accessible using this technology."Designing Next Generation Web Projects with CSS3" contains ten web projects fully developed using cutting edge CSS3 techniques. It also covers time saving implementation tips and tricks as well as fallback, polyfills, and graceful degradation approaches.This book draws a path through CSS3; it starts with projects using well supported features across web browsers and then it moves to more sophisticated techniques such as multi polyfill implementation and creating a zooming user interface with SVG and CSS. React to HTML5 form validation, target CSS rules to specific devices, trigger animations and behavior in response to user interaction, gain confidence with helpful tools like SASS, learn how to deal with old browsers and more."Designing Next Generation Web Projects with CSS3" is a helpful collection of techniques and good practices designed to help the implementation of CSS3 properties and features.
Table of Contents (17 chapters)
Designing Next Generation Web Projects with CSS3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding some trembling


As an additional feature we can add an option to let the arrow tremble a bit when it nears 100 percent. We can achieve this behavior by adding a small animation if an extra data-trembling attribute is present:

<div data-gauge data-min="0" data-max="100" data-percent="50" data-orange-from="60" data-red-from="90" data-trembling>

Unfortunately, Compass doesn't provide CSS3 animation mixins out of the box, so we have to install a Compass plugin that can help us with that. In this case, the plugin is called compass-animation (https://github.com/ericam/compass-animation), created by Eric Meyer (http://eric.andmeyer.com/). This is how it's installed:

gem install animation –pre

Or as follows:

sudo gem install animation –-pre

And then we have to include the plugin both when calling compass watch:

compass watch . –r animation

And in the header of application.scss:

@import "animation";

Well done! Now we're ready to define a really simple animation that modifies the rotating...