Transcript for:
Creating Sun and Moon Toggle in Figma

Hey guys, today I'm going to be making the sun and moon toggle with a hover effect in Figma. Let's jump into it. I'm going to open a new document.

I'm going to make a frame. Let's make the frame 369 by 145. I'm going to round my corners to 200. I'm gonna zoom in, draw a circle, O, on your keyboard. Let's change this to 120 by 120, and then put it to the side inside your frame. All right, let's name this frame sun, and we'll name the ellipse sun as well.

I already have my colors preset so I'm going to just pick some from there. So we'll take our frame, make the background blue, grab the ellipse and make it yellow. I want this to look three-dimensional so we're going to add some highlights.

So let's go to effects, inner shadow, and let's add a white highlight. Adjust the opacity. You can actually make it more yellow. And we'll put it more on this side. Let's also give it a shadow on the inside.

So an inner shadow coming from the bottom. I think that looks good. We'll actually make this a little more yellow. Now let's add some rays behind. So I'm going to take my ellipse and put it into a frame.

Option command G. I'm going to name this sun and moon. Now I'm going to add some rays behind. So let's choose our circle tool again.

Pull it out of your frame and then underneath. Make it white. Adjust the opacity to 10. Make sure it's centered. Command D to duplicate.

Make it bigger. I'm pressing Option and Shift to pull from the middle. Command D again.

Duplicate. Same thing. Option Shift to drag out.

I'm going to grab these. Put them into a group. Command G. Let's name this Ray. Now let's make our clouds. So I'm going to grab the ellipse tool, O on your keyboard.

I'm going to change these to a white color, but more of a blue white like that. And you can adjust your circles any way you want to, just make sure they stay inside of your frame. So I'm option dragging making my circles inside the frame, making sure they're inside.

Once you have something that looks sort of like clouds, and they're all in the frame, grab them all, shift and click on all of them. And let's unify the selection, Union Selection, let's name this clouds. front i'm gonna put it behind my sun and moon frame i have one on top though make sure that's in there Alright, that looks good.

I'm actually going to move this down a little. Now that looks good. Alright, let's duplicate this command D.

Push it up. Let's change this to Cloud Back. Put it underneath. Change the opacity to 60. And adjust your cloud pieces. So they come out a little bit further.

And this is totally up to you however this looks. You can adjust them, make them bigger. Alright, I think that looks good.

Okay, let's add some inner shadows on this frame. So I'm going to close it, option L. Go to your effects. Let's do an inner shadow.

I want to keep this black because it's going to go on a different background as well. So I'm going to blur it out, adjust your settings. Let's do one for the bottom as well.

Inner shadow coming up from the bottom. Give this one more blur. We also want it to look beveled, so I'm going to grab the whole frame. We're going to add some drop shadows.

This one's going to be a highlight though. Pushing the white and we're going to drag the opacity up. Let's do it one more time and we'll add the top. Let's push this to the top.

That looks good. Now it looks like it's beveled. We're going to add a shadow on our sun. So go to effects, drop shadow, adjust your settings.

You can make this totally custom to you as well, however you feel it looks best. I'm just going to add another one to add some depth and that looks pretty good to me. Now we're going to add the moon.

I'm going to grab my sun. Press option drag, drag it over, put it back into my frame. Let's name this moon.

I'm going to adjust the colors. I'm going to use this gray color. We're going to adjust the shadows as well to make this darker.

Grab this one and make this lighter so no yellow. I'm going to add moon spots, so press O on your keyboard for circle. You can make these however you want. Grab all of them, command click, change the color to gray, a darker gray.

We're going to add an effect of an inner shadow. And we'll adjust it down to about, say, 1. Command-G to put these into a group. Name the spot. Put it in.

Grab your moon. Make it a group. We'll name this moon.

You can adjust these however you like. Grab your sun and moon frame and click content and change the corner roundness to 200. So grab your frame, click on your moon, change the x value to 0, grab this layer and your rays, move it over to the side by sliding your x value. Let's take our clouds front and back and push them down on the Y value.

Let's change this to a darker color and let's add some stars. So we're going to go up to plugins, icon duck, star. Find a star that you like.

We're going to go with this one. I'm going to drag this out of my frame, close this, double click. I just want one of them, so I'm going to grab it.

Shift, click off this one. Command X to cut, delete these. Command V to paste, and make it white.

Let's put it in my design, and I'm going to scatter these around. So, Option-Drag to copy. I'm going to do different sizes. Alright, once you have your stars the way you like, grab them all.

Grab this one, shift, click all those. We're going to clip them into a group, command G. We'll name it stars. Move your group under the sun and moon frame.

And that is our moon's frame. Alright, let's move it back to the sun. So, I'm going to grab my stars and both of my cloud layers.

Using the Y value, bring them back up. Then, I'm going to shift sun and moon and the rays back over by using the X value. Then I'm going to move the moon with the X value off, change the background back to the light blue.

Let's option L to close our layer, option drag to make a duplicate. And we're going to make our hover for the sun. So we'll say sun, hover.

And all I want to do is... Scoot the sun and the rays out just a little bit. Alright, let's move the sun one out.

We'll put it underneath. We'll name it moon. Hover.

Take your sun and your rays. Move them with the X value. over to the side, move your clouds front and back and your stars down with the y value, change your frame to a darker color, and then set your moon x value to zero.

Duplicate this, put it underneath, Remove what it says hover. Go back up to your moon hover. Take the Sun and the Moon and the rays. Nudge them over a little bit.

Option L to close all of your layers. Grab everything. Put them into a component set. Go to your prototype panel.

Command click on the Sun. Drag it down to this frame. We'll say while hovering.

It's going to ease out at 300 milliseconds. I'm going to command click the sun and the other sun and drag it down to the moon and go on click smart animate gentle at 2000. Same thing with the moon. Command click on the moon. make sure it's on this layer drag up while hovering ease out 300 we'll grab this one shift command click to grab both push it all the way up to the sun on click smart animate gentle 2000 add a frame Change the background.

Go up to your assets and drag in your component. And then play your animation. If you guys like this tutorial, please give this video a like. And if you want to see more stuff, please subscribe.

Thanks guys!