Chapter 15. Transforms

 

This chapter covers

  • Manipulating elements using transforms for performant transitions and animations
  • Adding a “bounce” effect to a transition
  • The browser’s rendering pipeline
  • Looking at 3D transforms and perspective

In this chapter, we’ll explore the transform property, which you can use to change or distort the shape or position of an element on the page. This can involve rotating, scaling, or skewing the element in two or three dimensions. Transforms are most commonly used in conjunction with transitions or animations, which is why I’ve sandwiched this chapter between those two topics. In these last two chapters, you’ll build a page that makes heavy use of transitions, transforms, and animations.

First, I’ll walk you through applying transforms to a static element. This’ll give you a grasp on how they work in isolation before we add them into some transitions. Then you’ll build a small but complex menu with multiple transforms and transition effects. Finally, we’ll take a look at working in 3D and utilizing perspective. This will carry over into the next chapter, where we’ll use 3D transforms in conjunction with animation.

15.1. Rotate, translate, scale, and skew

A basic transform rule looks something like this:

transform: rotate(90deg);

15.2. Transforms in motion

 
 
 

15.3. Animation performance

 
 
 
 

15.4. Three-dimensional (3D) transforms

 
 
 
 

Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest