background preloader

The Guide To CSS Animation: Principles and Examples

The Guide To CSS Animation: Principles and Examples
Advertisement With CSS animation now supported in both Firefox and Webkit browsers, there is no better time to give it a try. Regardless of its technical form, whether traditional, computer-generated 3-D, Flash or CSS, animation always follows the same basic principles. CSS Animation Properties Before diving into the details, let’s set up the basic CSS: Animation is a new CSS property that allows for animation of most HTML elements (such as div, h1 and span) without JavaScript or Flash. Because the technology is still relatively new, prefixes for the browser vendors are required. All you need to get some CSS animation happening is to attach an animation to an element in the CSS: First, we have the animation code itself. When assigning the animation to your element, you can also use the shorthand: We can cut this down further by not entering all of the values. Those are the basics. Applying Principles of Traditional Animation This example demonstrates the features of CSS animation. Staging

An Introduction To CSS3 Keyframe Animations Advertisement By now you’ve probably heard at least something about animation in CSS3 using keyframe-based syntax. The CSS3 animations module1 in the specification has been around for a couple of years now, and it has the potential to become a big part of Web design. Using CSS3 keyframe animations, developers can create smooth, maintainable animations that perform relatively well and that don’t require reams of scripting. In this article, we’ll cover all the important parts of the syntax, and we’ll fill you in on browser support so that you’ll know when to start using it. A Simple Animated Landscape Scene For the purpose of this article, I’ve created a simple animated landscape scene to introduce the various aspects of the syntax. (NOTE: Versions of Safari prior to 5.1 have a bug that prevents the animation from finishing correctly. I’ll describe the CSS related to only one of the elements: the animated sun. The @keyframes At-Rule Here’s the @ rule we’ll be using: @keyframes sunrise { }

Cross Browser CSS Transforms – even in IE Updates: (March 7, 2013) The examples on this page were missing due to a migration issue when upgrading my blogging software. Thanks to James Wages for pointing this out.(August 11, 2012) The skew() transform no longer works in Firefox, due to not being in the CSS3 specification anymore. Developers must use the skewX() and skewY() functions instead. An example of a page using the CSS Transform property and cssSandpaper. The CSS transform property allows developers to rotate, scale, and skew blocks of HTML via CSS. When I first saw sites using transform, I looked at the underlying code and tried to produce pages using transform in all browsers. Before I start talking about the details of my solution, let’s take a look at a few examples of it in action. (The examples also work on my copy of Opera 10.5, although I have seen it fail on other installations – I will update this post when I find out why). cssSandpaper to the Rescue Browser Differences Using cssSandpaper -sand-transform Description

Les 30 sélecteurs CSS à connaître absolument tomsyweb.com Buy this domain The owner of tomsyweb.com is offering it for sale for an asking price of 345 GBP! Related Searches This page provided to the domain owner free by Sedo's Domain Parking. Disclaimer: Domain owner and Sedo maintain no relationship with third party advertisers. Quick Fun: CSS3 Filter Effects « GirlieMac! Blog I quickly played with the brand-new CSS Filter Effects on the latest WebKit Nightly! (Edited: Now also supported on Chrome Canary 18.0.976.0 +) Click the images to view in the full size. This is a default google.com screen. blur(radius) to create Gaussian blur -webkit-filter: blur(2px); The default is 0, no blur. brightness(amount) -webkit-filter: brightness(30%); The default is 100%. Updated: I am not sure when it has modified, but it seems that not the accepted value is the range between -100% (dark) and 100% (light), and the default is 0. contrast(amount) -webkit-filter: contrast(30%); grayscale(amount) -webkit-filter: grayscale(); The default is 100%. sepia(amount) invert(amount) -webkit-filter: invert(); opacity(amount) -webkit-filter: opacity(30%); The default is 100%, no transparency. Saturate(amount) -webkit-filter: saturate(50%); Saturate(amount) – the amount over 100% is also allowed. -webkit-filter: saturate(300%); hue-rotate(angle) -webkit-filter: hue-rotate(90deg); The default is 0deg. drop-shadow(

CSS3 Patterns, Explained Many of you have probably seen my CSS3 patterns gallery. It became very popular throughout the year and it showed many web developers how powerful CSS3 gradients really are. But how many really understand how these patterns are created? The biggest benefit of CSS-generated backgrounds is that they can be modified directly within the style sheet. Important note In all the examples that follow, I’ll be using gradients without a vendor prefix, for readability and brevity. The syntax described here is the one that browsers currently implement. If you are not yet familiar with CSS gradients, you can read these excellent tutorials by John Allsopp and return here later, as in the rest of the article I assume you already know the CSS gradient basics: The main idea I’m sure most of you can imagine the background this code generates: background: linear-gradient(left, white 20%, #8b0 80%); It’s a simple gradient from one color to another that looks like this: See this example live See this example live

Creative CSS3 Animation Menus Being in the mood for experimenting with CSS3, I'd like to show you some creative menu hover effects in today's tutorial. The idea is to have a simple composition of elements, an icon, a main title and a secondary title, that will be animated on hover using only CSS transitions and animations. We'll be exploring some different effects for the elements. View demo Download source Being in the mood for experimenting with CSS3, I’d like to show you some creative menu hover effects in today’s tutorial. The icons used in the demos are actually a Web Symbols typeface that we’ll include with @font-face. The Markup The HTML structure for the menu will be an unordered list where each item is a link element that consists of an icon span and a content div that will contain the main title and the secondary title: As we are using a symbol font for the icons, we write letters for the icons. The CSS The common style for all the examples will be the inclusion of the symbol typeface: Example 1 Example 2

CSS3 2D Transformations The Transformation module is a tremendous addition in CSS3, it takes the way we manipulate elements on a website to the next level. There are some experiments that really amaze me, examples such as this one. However, we are not going to build something like a CSS-only icon that can somehow transform into an Autobot, as it may be overwhelming and not quite usable in real life as well. Instead, this time, we will be stepping back and reviewing the basics of CSS3 2D Transformations to see how it works at a fundamental level. The Syntax The CSS3 Transformations module basically allows us to transform an element to a certain extent such as translating, scaling, rotating and skewing. The official syntax is transform:method(value). transform: method(value); -o-transform: method(value); -ms-transform: method(value); -moz-transform: method(value); -webkit-transform: method(value); The Value Most of the method’s value will correspond to the X-axis and Y-axis. Except for rotations. I – Translate

CSS3 Transitions, Transforms and Animation Tutorial

Related: