Here’s a tutorial that a lot of you guys have been looking forward to. I posted a preview of this effect a few days back, and you guys started to demand a tutorial, so let’s get to it! We’re going to create an animated button in Photoshop!
Animated Button in Photoshop CS6
Before I begin adding shapes, let’s set up our document first. I’m starting with an 800 x 600 pixel document, which should be large enough for a simple button like this.
Now in terms of the background color, it’s going to be what I base the other elements off of. This isn’t required, but I found that it creates a nice, smooth design. I’ll use a dark grey. Once the color is set, Option+Delete or Alt+Backspace will fill your background with the foreground color.
The last thing I’m going to set up, are my guides. This will help position the circles perfectly in the center of my document. If you don’t see your rulers at the left and top of your workspace, Command/Ctrl+R will reveal them, allowing you to pull out your guides. And as long as “Snap” is turn on under the View menu, your guides should snap nicely at the horizontal and vertical center.
Good, now we’re ready to start creating. In your Tools Bar on the left, grab the Ellipse Tool, and make sure that it’s going to create a Shape, and not a Path on your Options Bar.
Now starting in the center, where the guides intersect, start dragging out your first ellipse. You’ll notice two problems. One, it’s not a perfect circle, and two, it’s not being create from the center. The first problem can be solved by holding down your Shift key while dragging out your shape. This will constrain it to a perfect circle or rectangle, depending on which tool you have active.
Second, to create the shape from the center, in addition to your Shift key, hold down Option on the Mac, or Alt on Windows. As long as these two keys are held down, you’ll have a perfect circle, being created in the center of your document.
Now that the shape is created, you want a Gradient Overlay to the shape. Go ahead and double-click on the layer that you just created in your layers panel. Once you’re here hop into the Gradient Overlay section, and click on the gradient bar to bring up the Gradient Editor. Now we can define our colors.
For the bottom color (left stop) it’s going to be a little bit lighter in the background color, and for the top color (right stop) it’s going to be slightly darker than the background.
Perfect, so now that the first shape is complete, we’re going to skip the glows for a second, and focus on the uppermost shape, which will act as a window to the glow.
To keep things simple, I can quickly duplicate the shape I just created with my Command/Ctrl J shortcut key, and once the shape has been duplicated, right clicking on the shape in the layers panel will allow me to clear the current layer styles so I can start fresh.
I’m also going to change the color of the shape, to prepare it for our Layer Styles. Double-clicking on the Shape’s thumbnail will bring up the color picker. I’m going to set it ever so slightly lighter than the background color. Once I add the Layer Styles, this will change, though. Value: 262626.
Once the new color is set, this shape needs to be scaled down a touch. Enter free–transform mode with your Command/Ctrl+T shortcut, then scale the shape down, making sure to hold down your Shift key to constrain it.
Good, now we need to create the window that will allow us to see the glow. We’re going to do this using a custom shape to cut out a hole in the shape that we just duplicated.
In your Tools Bar, grab your Custom Shape Tool. It’s hiding with the other shape tools.
Now on your Options Bar, click on the Shape Picker, and scroll down until you see the Circle Thin Frame shape.
If you haven’t loaded in all of the shapes that come with Photoshop yet, click on the icon at the top right of this panel, choose All.
When the window pops up, choose either Append, or OK. Append will add the shapes to the end of your current shapes, and OK will replace them.
So once your shape is chosen, we’re going to want to subtract this shape from the current shape. You can do this by either selecting Subtract Front Shape from the Options Bar, or simply hold down your Alt/Option key before you start to create the shape.
Once you start creating the shape from the center, make sure to also hold down your Shift key to constrain it to a perfect circle. Leave a bit of room around the edge of the shape.
Of course, what’s a shape without Layer Styles!? I’m only going to add two; a Bevel and Emboss, and a Drop Shadow. Both will help give this shape some depth.
Now we get to the fun stuff, the glows! This design will contain two glows. One that will act as a reflection on the back shape, and a stronger glow that will appear in the window. Let’s create the reflected glow first.
Selecting the back most shape again, and quickly duplicate it one more time with Command/Ctrl + J, and clear it’s Layer Styles, just like you did earlier.
This time, when I jump into the Layer Styles dialogue, I want to be sure to set the Fill Opacity at 0%. This will hide the contents of the shape, but allow us to see any Layer Styles that we may apply, like Gradient Overlay.
This gradient is going to be a bit different than the one we added earlier. First,set the Style at Radial.
When the Gradient Editor is up, the left color is going to be the main color of the glow, which in this case, will be a nice baby blue: 00a8ff. Now the right color will set at black, and will be 0% transparent. This can be done by clicking the stop that’s above the gradient bar, and then decreasing the Opacity to 0%.
Right now, you’re probably thinking, “Uh, where’s the gradient?” Well, right now, it’s hiding behind the topmost shape. Some of you may not know this, but gradients can be moved. If you place your cursor overtop of your document, you can click and drag that gradient anywhere you want. Place it at the top right corner.
You can also control the scale of the gradient is you don’t want it as large. Closing the Gradient Editor, you can scale the gradient down to around 75%, and move it to it’s final location.
Good, now we can move on to the main glow, which will appear in the window. Again, to keep things simple, go ahead and create a duplicate of the glow that you just worked on, again, with your Command/Ctrl J shortcut. Once it’s been duplicated, enter free–transform mode with Command/Ctrl+T, and scale this glow down, until it’s the size of the shape on top.
You should see it’s path as you’re transforming it. Just like when creating a shape, holding down your Shift and Alt/Option key will scale it from the center, while keeping it a perfect circle. Return/Enter will accept the transformation.
Now we can alter the gradient a touch. Once you’re back in the Gradient Editor, start by setting the right stop back at 100% opacity, and then change the color of the right stop to a dark blue, 00193e. This will give a very subtle glow to the inside of the window. Now add one more stop, around 30%. (If you click right under the gradient bar, you’ll be able to add an additional color stop, and move it into place). Once it’s in place, set the color to a lighter baby blue. 76cdff.
Right now, it’s probably not looking that great. Accept the new gradient, and change the Blend Mode of the Gradient Overlay to Color Dodge. And just like the last gradient, you can move it into place if you wish.
Phew! The design is complete, it’s now time to animate! Before I start the animation part, this technique will only work on Photoshop CS6. CS5 doesn’t have the ability to animate transformations. Sorry. 🙂
Alright, so there are two layers we’re going to be animating: The reflected glow, and the glow that appears in the window.
Now because of the Blend Mode changes, we’re going to be animating each of these layers individually. If we were to merge both as a Smart Object, the Blend Modes would get lost, leaving us with a pretty ugly result. Instead, we’re going to convert each glow to a Smart Object, which will allow us to animate transformations.
To do this, right–click on the first glow you created (bottom glow) in the Layers Panel, and select the Convert to Smart Object option.
Now do the same for the next glow. You’ll notice, if you had changed the Blend Mode on any of the glows, converting to a Smart Object disregards the change, but you can simply change the overall Blend Mode back to Color Dodge to fix that issue. This is why we are converting each layer individually.
Now it’s time to animate! To open your Timeline, you can either double click on the tab at the bottom of your workspace, or find it under the Window menu at the top.
Once the Timeline is visible, you will most likely need to Create a Video Timeline. This will list all of your layers, and reflect the currently selected layer from your Layers Panel.
Let’s start with the glow on the bottom. When that layer is selected, you’ll want to expand the layer in the Timeline, to reveal the different elements that can be animated.
We’re going to want to animate a Transform, which includes rotation. You’ll want to click on the stopwatch icon beside Transform to create the first keyframe.
Once once the first keyframe has been created, scrub to the right a bit. This will be the halfway point where we’re going to make the first rotation.
Enter free–transform mode with your Command/Ctrl+T shortcut, and then on the Options Bar at the top, you can simply enter 180 for the degrees, which is the most you can rotate a layer at once.
Once your accept the transformation, the first animation will be made. Another keyframe will be automatically created. You can see it in action by scrubbing back to the first frame, and pressing your spacebar. Don’t worry if you see any loss in quality. Once the animation has been rendered, it’ll be nice and sharp!
Now the same can be done for the second half of the rotation. Scrub over a bit further than the last time, enter free-transform mode, enter 180 in the degrees field again, and accept the transformation.
Perfect! This glow is complete. Do the exact same thing for the top glow.
To set the duration of the animation, at the far right corner of the Timeline, you’ll find the Work Area end point, which you can drag to the last keyframe that you created.
And finally, if you want your animation to loop, rather than just play once, under the Timeline menu at the top right, you can choose to loop the playback.
And that’ll do it! Once your animation is complete, you can either render it out as a video with the Render option at the bottom of your Timeline, or you can save it as a Gif for use on the web.
Under the File menu, you’ll find the Save for Web option. Once you select Gif, at the bottom, you can choose wether it plays back once, or forever. Don’t worry if the preview looks choppy. Once it’s saved, you’ll have a nice, smooth animation.
Try it out yourself!