Viewers: in countries Watching now:
With robust and ever-increasing browser support, it is now possible to take advantage of expressive CSS3 capabilities across modern browsers. In this course, Joseph Lowery explores the possibilities of the new coding options, which animate well over 50 different properties automatically or interactively, and how they open the door to enhanced user experiences. This course covers the range from simple to complex transitions, including 2D and 3D transforms, and illustrates how transitions are expedited in various web authoring tools, as well as Dreamweaver. The course also contains a start-to-finish interactive slideshow project that allows you to practice and see the transitions and transforms immediately in action.
Like show-front, show-top, and so forth. These classes are added to the parent container. In our case, that's the div with the ID of cube, whenever the corresponding thumbnail is clicked. Each class will contain the Transform properties to move the cube side to the front. Let's begin with the front face. So we'll enter in #cube.show-front. Make sure there's no space between cube and the .show-front.
As when we set up the front face for the cube, there's no rotation involved just that translation or movement along the Z axis, whereas previously, the value for the translateZ property was +136 pixels, because we're moving it back into position, we'll use -136 pixels. So let's start with our webkit-transform and the function translateZ of -136 pixels.
Okay, we can copy that line, paste it in three times and change the vendor prefixes as needed. Next, let's turn to the back. Here, and with the rest of the cube sides, we'll perform a rotation as well as a translation, and we'll keep the same values, but make them the inverse of what they were when we set up the cube. So if the values are positive, we'll make them negative, and if they're negative, positive.
And one more thing, if we rotated the cube first and then translate it, we need to do the inverse of that. Then we will need to translate it first so that it's in the proper position to rotate. All right, let's get started with, #cube.show-back. And our first transform property, -webkit-transform. Now let's enter in our translateZ property with a value of -136 pixels, and our other function, rotateX, and we're rotating this 180 degrees, put a semicolon, and this is ready to be copied and pasted, and then slightly modified.
Okay, let's move on. Let's follow the same pattern for the right and left side of the cube. I'll put in my selector for the show-right, starting with webkit-transform and the function translateZ, again, set to -136 pixels, and rotateY -90 degrees. We'll select, copy, and paste as we've done once or twice before.
And now I'm going to copy show-right, and let's paste it in and change it to show-left. The translateZ value we can keep at -136 pixels, but let's change our rotateY from -90 to +90. Finally, let's do the same thing, reversing the signs as it were for the top and bottom of our photo cube. You may face it a little bit faster and maybe a tad less monotonous.
Let's copy the show-right and show-left CSS rules, and then we'll paste them down below and change their names to show-top and show-bottom. The other thing we'll need to change in each of these rules is rotateY to rotateX. Let's save the page, and let's see if we're ready to rock or not. I'll refresh the page in my browser, and let's click through the thumbnails. Sweet! We got a real 3D cube spinning around interactively.
Obviously, this technique is somewhat limited, you can only show six thumbnails and images at a time, but you have to admit, it's a cool addition to get your designer's Toolbox.
There are currently no FAQs about CSS: Transitions and Transforms.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.