Animations

Animating vector paths in Framer (Animation Lesson 18)

Animating vector paths in Framer (Animation Lesson 18)

Animating vector paths in Framer (Animation Lesson 18)

Joseph

·

14:36

·

18K views

·

About this lesson

Vector path animations can bring icons, logos, and illustrations to life, revealing each shape with smooth, hand-drawn motion.

And we can pull it of in just a few clicks using the Stroke effect in Framer. In this lesson, we’ll use the Stroke Effect to animate a few icons with engaging motion that feels thoughtful and refined.

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=0s Intro

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=24s Set up

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=131s Animate the signature with Stroke (defaults and preview)

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=246s Reverse the draw using Offset

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=299s Loop modes: repeat, mirror, continuous

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=351s Transition settings

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=377s Fingerprint icon animation

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=489s Lotus icon animation

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=566s Reverse path direction

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=742s Pulse icon animation

https://www.youtube.com/watch?v=MOmvYoUFQWU&t=850s Wrap up

Sign up: https://framer.link/yt

Follow: https://framer.link/yt-x

Learn: https://framer.link/yt-academy

0:00Vector path animations can bring icons,0:03logos [music]0:03and illustrations to life, revealing0:06each shape with a smooth hand-drawn0:08motion. And we can pull it off in just a0:10few clicks with the stroke effect in0:13[music] Framer. In this lesson, we'll0:15use the stroke effect to animate a few0:16icons with engaging motion that feels0:19thoughtful and refined.0:22>> [music]0:24>> The stroke effect is something special0:26and it'll only show up if we're editing0:28layers within a vector set. So, we've0:31got to start by creating a vector set.0:34And on the second page of our project0:36file here, we have this stroke effect0:38page with a few example icons that I've0:40prepared ahead of time. And each one of0:42these is just a group that has a bunch0:45of vector layers in it. So, these are0:48essentially just icons drawn directly on0:50the canvas, but we need to turn them0:52into a vector set. And really, they all0:54belong in the same vector set. So, I'm0:57going to hold the shift key and select0:59each and every one of these icons cuz1:01they're all kind of part of a family.1:03And for good measure, I'm also going to1:05throw in this little icon here cuz we're1:07going to play with animating that even1:09though it's a different size. I'm going1:10to hold shift, click it, and add it to1:12the same vector set. So now to create a1:14vector set from all these, I'm going to1:16rightclick on any one of these selected1:18groups. And I'm going to choose create1:20vector set. And instantly we're brought1:22into a dedicated canvas view where we1:24can edit this vector set, which is what1:26we want to do. But first, I'm going to1:28get rid of the fill here, which would be1:30helpful if we were editing dark gray1:32icons and we didn't want to edit them on1:33a dark gray background. But these have1:35sufficient contrast on a dark1:37background, even without a fill. Now, if1:39you're not familiar with vector sets in1:41the first place, much like a component,1:42they are an asset that's found on the1:44assets panel, and they can be dragged1:46directly onto the canvas. And if we go1:48back to our main page here, where we1:51created the vector set from, each and1:53every one of those icons, which was1:55previously just a group, has been1:57replaced with an instance of that vector1:59set. And if we look over here on the2:01properties panel, we can see that we2:03have access to all of the icons within2:05that set. And we can click to swap them2:08out. But let's head back into the vector2:10set and do some editing. I'm just going2:11to double click on any one of these2:13icons to get back into that canvas view2:16for the vector set. And now that we're2:17editing the contents of a vector set,2:19we've just unlocked a whole new effect2:22which we can apply if we select any one2:24of these vector layers. So, let's get in2:26here and animate this signature icon as2:29our first example. Within this group, I2:31have a signature vector layer, and2:33that's what I want to have selected here2:35because that's the path that I want to2:36animate first. And then we'll just head2:38over to effects on the properties panel.2:40And there's our new effect that only2:42appears because we're here within a2:43vector set editing a vector layer. I'm2:46going to click to add the stroke effect.2:48And here we get a popover with a few2:50properties to play with. But before I2:52even mess with anything, I'm going to2:53press command P on my Mac to go into2:55preview mode. And you can see that even2:57just with the defaults, we get that2:59stroke effect where the path appears to3:01be drawn onto the screen from beginning3:03to end. With our current settings, it3:05only plays once, but I'm clicking the3:07reload button in the top left corner to3:09make it play over and over again just so3:10you can get a good look at it before we3:12move forward. But if we go back to the3:14design canvas and I open the effect3:16popover again, these first two3:18properties, length and gap, give us a3:20little hint about what's going on behind3:22the scenes. This is really just a dashed3:25line where we have a gap and a dash and3:28a gap and a dash. The gap is currently3:30the whole length of the path and gets3:33pushed over to reveal the dash that's3:36right behind it. So, let's take a look3:38at what this looks like if I reduce the3:40length and the gap all the way down to3:4210% of the length of the path that we're3:45animating. I'm going to press command P3:46again to go into preview mode. And now3:48you can see it is a dashed line. And3:50when we shorten those dashes, it becomes3:52really obvious that it's been a dashed3:54line all along. So, I'm going to go back3:57and I'm going to set this to the3:59original 100% and 100%. And then down4:03below we have one more property here4:05called offset that really comes in handy4:08if you shorten the length but also comes4:10in handy if you want to kind of reverse4:12this whole animation. So if I set this4:14offset to 100%. I'm saying move the4:17whole animation down by 100% of the4:20length of this path. So before where we4:22had the gap and then the path and then4:24the gap. If we move that whole thing4:26down, we have the path and then the gap4:28and then the path and then the gap. So4:30rather than starting with the gap and4:32then revealing the path, we're going to4:33start with the path and then reveal the4:35gap. So I'll press command P again. And4:37there we go. Starts with the path and4:39then it appears to get drawn away by4:41going from the path to the gap. If the4:44whole dashed line thing seems a little4:46confusing, it's okay. You don't really4:48have to understand it. You can just4:50fiddle with the settings until you get4:51the result you're looking for visually.4:53But when you understand how it works, it4:54becomes a little bit more predictable.4:56So, back to the canvas and back to the4:58properties one more time. We also have5:00the option of looping this animation.5:02And right now, it's just playing once5:04because loop is set to no. But if we5:06switch this to yes, we actually get5:08three different loop modes. We get5:10repeat, which plays the animation, then5:12abruptly returns to the beginning and5:13plays it again and repeats and repeats5:15and repeats over and over again. Then we5:18have mirror, which is kind of like a5:19pingpong effect where it'll play5:21forward, then play backward, then play5:23forward, then play backward. And then we5:25have continuous, which will play forward5:28and then play forward again from where5:30it left off. So, it's just going to push5:32forward and forward and forward. So,5:34there's not going to be a hard reset to5:35the beginning like there is with repeat.5:38But for this particular animation, I5:40don't want it to loop. I'm going to set5:41this to no. And we'll actually use the5:42loop property for a different example.5:45But for this one, I'm going to set the5:46offset back to zero. Just go with those5:48defaults. And then here under5:50transition, we get the usual animation5:52settings where we can decide if we want5:54this to ease in or ease in and out or be5:57linear, which is really practical if5:59you've got a continuous animation.6:01Continuous with no easing just seems to6:04go on at a steady pace forever. But for6:06this one, I'm cool with ease in and out.6:08I'm cool with the default time of 26:10seconds, and everything's looking good6:11to me. But now, let's get a little more6:13fancy with it. Let's do an example where6:15we layer some things up on top of one6:17another. So again, I'll go back to the6:18canvas and let's head over to this6:21fingerprint icon, which is an6:22opportunity for a kind of Touch ID style6:24animation. I don't really need this6:26bounds layer, which was propping up the6:28size of this when it was just a group on6:30the canvas. Now that it's in a vector6:32set, it's in a frame that has a fixed6:34size. So I don't really need that bounds6:35layer anymore. But I do want to6:37duplicate the whole fingerprint cuz what6:39I'm going for here is sort of a faded6:41out fingerprint that gets filled in over6:43time. So, I'm going to duplicate this6:46fingerprint group. And now we've got one6:48on top, one on the bottom. And the one6:50on the top, I'm actually going to rename6:51fingerprint animated. And then the one6:54on the bottom, I'm going to reduce the6:56opacity down to, let's say, 20%. I'll6:59press the number two on the keyboard.7:01You can't see it because the fingerprint7:03that's at 100% opacity is on top of it.7:06But if I press command semicolon on my7:08Mac, that's one of my favorite7:09shortcuts, I can toggle the visibility7:11of the group that's on top. So you can7:12see I've got a faded one underneath and7:14then I've got the full opacity on top.7:16And it's the full opacity one that I7:18want to animate all these paths. So with7:21the group selected, I can just press the7:22return key on the keyboard and it will7:24select all the child layers. And I can7:26come over here, add the effect, choose7:29the stroke effect, and I think even with7:31these defaults, we're going to be pretty7:33close to being good to go. Instead of7:35easing in and out, I think I'm just7:37going to have it ease out instead. So7:39that way these lines start to draw in at7:42full speed and then slow down and come7:44to rest gradually at the end. So I think7:46we're good. Let's preview it. I'm going7:47to press command P again to go into7:49preview mode. And there we go. We've got7:51that very, very faint instance of the7:53icon. And then we've got the full7:55opacity icon being drawn in for that7:58Touch ID effect. So you can see how even8:00stacking an animation on top of a static8:02layer can make things a bit more8:04interesting. But now, let's stack up8:06several animations and see what we can8:08do with that. For this next one, we're8:10going to come over here to that lotus8:12flower icon. But it is going to be kind8:15of small when I go to preview it. So,8:17I'm going to increase the size of this.8:19I'm going to press K to bring up the8:20scale tool. And I'm going to scale this8:22by a factor of two. I want to double the8:24height and width of this to make it nice8:26and easy to see when we preview it. So,8:28now the idea for this icon is I do want8:31this white path to animate in. But as it8:33animates in, I want some colors to be8:36animated ahead of the white. I want teal8:39and green and then the white to finish8:42it off. So, what we're going to do is8:44duplicate this. But first, I'm going to8:46establish our base animation on all of8:49these paths. So, again, I'm hitting8:50return to select all these paths. I'm8:52going to add the effect. Click stroke.8:55And similar to the previous example, I'm8:57going to switch from ease in and out to8:59just ease out. And I'm also going to9:02have this go a little bit faster. I'm9:03going to go down to, let's say, 1.29:05seconds instead of two seconds. But9:08otherwise, I'm going with the defaults.9:09I'm animating 100% of the length, and9:11I'm keeping the gap at 100. So, we don't9:13see anything until the path starts to9:15come in. Cool. So, I'm going to preview9:17this. And there we go. We've got our9:19slick little animation where the lotus9:21flower is being drawn. But all of these9:23paths are emanating from the bottom9:25except for one. You'll notice this one's9:27actually going backward. I'll play it9:29again a few times and you can see it's9:30kind of starting at the top and drawing9:32its way down where the others are9:34starting at the bottom and drawing their9:36way up. So, I do want to show you how to9:38fix that. Very, very easy fix. We'll go9:40back to the canvas. We'll select the9:42offending path by itself, which is this9:44one right here. And I'm just going to9:46rightclick and I'm going to choose9:48reverse path direction, which visually9:51didn't change anything. But if we go and9:53preview this again, there we go. Now all9:56the paths are being drawn from the9:58bottom up to the top. That looks much10:00better. So now let's layer up those10:02colors I was talking about. We'll go10:03back and I'm going to duplicate the10:05lotus flower group by pressing command D10:08a couple of times. And I'll collapse10:10these so we can see that I've got two10:12duplicates. I've got the bottom, the10:14middle, and the top. The top's going to10:16be the white one. That's going to be the10:18last thing to animate in. But the one10:20below it, I'm actually going to rename10:22this color two so I don't get confused.10:25And then the bottom one I'm going to10:27rename color one. And with the group10:29selected, I can actually come over here10:31and edit the color of all of the strokes10:34within it. But you'll notice this says10:35mixed. And the reason for that is10:37because if I expand all these, I didn't10:39delete those bounds rectangles, which10:42again we don't need anymore. So, with10:44those gone, now if I select this group,10:46you'll see these all have that white10:48stroke in common. So, again, I said I10:51wanted to set this one to kind of a teal10:53color. So, I'll go and choose that. And10:56since we've got things stacked on top,10:57we can't see it. So, again, I'll use10:59that shortcut command and semicolon to11:02hide these so we can see the teal one11:04that I'm working on down below here. And11:07that color seems fine to me. So, I'll go11:09to the second color. I will unhide that11:12with command semicolon. And this one I11:15want to make green. So I'm going to set11:17this to a semi vibrant green. Something11:20that kind of harmonizes with that teal.11:22And then last, we've got our white layer11:24that's on top. And that one's already11:26white. That one's fine. But now, if we11:28were to play this back, we've got the11:29same animation stacked up three times.11:32So you're only going to see the one11:33that's on top. So this is where a little11:35bit of delay is going to solve11:36everything. So I'll select the second11:38group. And we can't edit the effect with11:40the group selected. So, I'll press11:42return to select all the paths within11:44it. And then we'll come over here. We'll11:46come to transition because this is where11:48we get to add the delay. And I'm just11:50going to add a delay of 2 seconds. Just11:52a nice small delay just to give the11:55layers below it a little bit of a head11:57start. And then I'm going to do kind of11:59the same thing here. I'll select the12:01white layers and I'll give them an even12:03more significant delay. Go back into the12:05transition settings. And for these I'll12:07do a delay of 4 seconds. Right. So,12:10we've got the teal layers that are going12:12to come in with no delay. Then, we've12:14got the green layers that are going to12:15come in a little bit later. And then12:17we've got the white layers that are12:18going to come in even a little bit later12:20still. So, now I think we're ready to12:22preview it. I'll press command P. And12:24there we go. We've got the teal leading12:26the way. We've got the green right12:28behind it. And we've got the white to12:30finish it off. That one's my favorite.12:32But we'll do one last example. I'm going12:34to go back to the canvas and let's do12:36this little pulsa icon. So that way we12:38can play with a continuous looping12:40effect. Similar to the Touch ID icon,12:42I'm going to duplicate this. And again,12:44we don't need these bounds layers. I12:46want a static version of this icon12:48faintly in the background. And then I12:49want the bright green to be animated on12:52top of that. So again, very similar to12:53the Touch ID. So with this group12:56selected, I'll press the number two on12:57the keyboard to quickly set it to 20%12:59opacity. And let's hide the one on top13:02so we can see what that looks like. Nice13:04and dark. And I'll make this visible13:06again. Select the path and let's add the13:08effect. We'll choose stroke. And this13:11time I want the length of the path to be13:12a bit shorter. So I'm going to go down13:14to 25%. And then I'll press command P to13:17see what that looks like. Okay, I'm13:19happy with the length. And you'll notice13:21I have to click reload in order to get13:23this to play again. So it's not looping13:25just yet. Let's do that next. Head back13:27to the popover. I'm going to set loop to13:30yes. And I'm going to set this to13:32continuous. So that way it keeps moving13:34forward infinitely. But if we preview13:37this again, it kind of speeds up and13:39then slows down and then speeds up and13:41then slows down. We don't want that. We13:43want this to be truly continuous. So we13:46don't want the easing to be ramping the13:48speed up and then back down. So instead13:50of easing in and out, we're going to13:52switch this to linear so that the speed13:54is completely constant all the time. And13:56I'll preview this one last time. And13:59there we go. We've got our little dash,14:01which is 25% the length of the total14:03path. And that's moving along14:04continuously with no easing so that the14:07speed stays completely constant. And14:09there you have it. Animating vector14:11paths with stroke effects can add a ton14:14of polish in unexpected places with just14:17a few clicks. Go subtle with it. Be14:20flashy with it. You do you. That's it14:22for this one. I'll see you in the next14:24one.

Watch on YouTube ↗

More in this topic

Framer Update: Logo Shaders2:05
Framer Update: Logo Shaders
Framer Update12K views · 1 month ago
Framer Update: Holo Shader1:46
Framer Update: Holo Shader
Framer Update6K views · 2 months ago
Shader: Chromatic Aberration1:56
Shader: Chromatic Aberration
Framer Update7K views · 2 months ago
Framer Shaders2:28
Framer Shaders
Announcement23K views · 2 months ago
Framer Update: Flow Effect in Layout Templates2:12
Framer Update: Flow Effect in Layout Templates
Framer Update10K views · 3 months ago
Building an Expanding Article Stack in Framer13:14
Building an Expanding Article Stack in Framer
Animations4K views · 4 months ago
Scaling a clipped image on hover in Framer5:41
Scaling a clipped image on hover in Framer
Animations7K views · 5 months ago
Making elements revolve in Framer3:38
Making elements revolve in Framer
Animations5K views · 5 months ago

Create a free website with Framer, the website builder loved by startups, designers and agencies.