Animations

Animating transitions between pages in Framer (Animation Lesson 14)

Animating transitions between pages in Framer (Animation Lesson 14)

Animating transitions between pages in Framer (Animation Lesson 14)

Joseph

·

8:46

·

21K views

·

About this lesson

Jumping between pages doesn’t have to feel jarring. With Page Effects in Framer, we can add smooth transitions that make our sites feel more cohesive — almost more “app-like”. Your site flows from one page to the next. It’s a small touch that helps everything feel more like a product and less like a collection of separate pages. In this lesson, I’ll show you how to easy it is animate between pages in Framer.

Grab the remix link from Framer Academy: https://www.framer.com/academy/lessons/framer-animations-page-transition-effects

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

https://www.youtube.com/watch?v=1hKaTVXX188&t=42s Previewing the completed example

https://www.youtube.com/watch?v=1hKaTVXX188&t=61s Project setup and navigation component

https://www.youtube.com/watch?v=1hKaTVXX188&t=98s Introducing page effects

https://www.youtube.com/watch?v=1hKaTVXX188&t=174s Exploring effect options and presets

https://www.youtube.com/watch?v=1hKaTVXX188&t=273s Customizing animation properties

https://www.youtube.com/watch?v=1hKaTVXX188&t=343s Fixing reverse navigation with push right

https://www.youtube.com/watch?v=1hKaTVXX188&t=453s Final preview of all transitions

https://www.youtube.com/watch?v=1hKaTVXX188&t=498s Wrap up

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

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

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

0:00Jumping between pages doesn't have0:01[music] to feel jarring. With page0:04effects and framer, we can add smooth0:06transitions that make [music] our sites0:07feel more cohesive, almost more applike.0:11In this lesson, I'll show you how easy0:13it is to animate [music] between pages0:15in Frame.0:19Let's take a quick look at what it is0:21that we're trying to build here in the0:23first place. Let's look at the starting0:25point. This website has three simple0:27pages. And as we click from page to0:29page, we get an instantaneous transition0:33from one page to the next, like you'd0:35expect. That's the default behavior of0:37clicking on a link on the web. But if I0:39head over to our completed example to0:41show where we're headed here, now when I0:43click, we get this animated transition0:45where the page we're coming from gets0:47pushed away and the page we're going to0:50gets pushed into view. So quite a bit0:52more visually dynamic. I'll close the0:54tab for my completed example here and go0:56back to our start project. And you'll0:58find a link to remix this start project1:01in the description below. But here1:02again, we've got three pages, a1:04homepage, a stories page, and a page1:07called features. But I'm going to go1:08back to the homepage. And I also want to1:09show you that our nav items are actually1:12an instance of a component. And if I1:14double click on this component, you can1:15see that I have several variants. I have1:17one for each page showing the active nav1:20item that clarifies which page we're1:22currently on. And if I preview this1:24component, it's actually animated. But1:26we didn't see those animations happening1:28because as soon as we clicked on one of1:29the links, it loaded the next page. So,1:31we never got to see this animation1:32happen. We're going to come back to1:34that, but for now, I'm going to leave1:36the preview and head back to our1:38homepage. And now, it's time to make the1:40magic happen with what are called page1:43effects. And what we do is we add a page1:45effect to the page that we're1:47transitioning from. So, here we'll start1:49with our homepage. Now to add a page1:51effect in the first place, we have to1:53select the desktop breakpoint. And with1:55the breakpoint selected, we can come1:57down here to effects on the properties1:59panel. And when we click, we get two2:01different options. Now, these are both2:03for adding page effects. We can either2:05choose to add a page effect to all2:08pages. We can add the same effect to2:09every page of the entire site all at2:12once. Or we can choose to add an effect2:15that goes from this page to another2:17specific page. All pages is nice,2:19especially if you have a large site. If2:21you have tens or even hundreds of pages,2:24you can take care of the transition from2:26every page to every page by setting it2:28up just once here. So, let's actually do2:30that. I'm going to click all pages. And2:33then here in the popover, you'll see2:35that our target is indeed set to all2:37pages. But one thing I also want to2:39point out is that the all pages option2:41only shows up when you're editing the2:44homepage. If you're editing any other2:45page of the site, you won't get the all2:47pages option. So, if you're not seeing2:49it, make sure you're looking at the2:50homepage. And then we have some preset2:53animations that we can choose from. And2:54these are a lot like the animation2:56effects that we talked about earlier in2:58the course. We have things like fades.3:01We have slides. We have pushes, which is3:03what you saw in the example at the3:04beginning. And then we have some wipes3:06that actually use a mask to reveal3:08what's underneath. I'm going to go with3:10push left as our default for all of our3:12pages here. And here we see an effect3:14for this page and an effect for the next3:16page. In this case, instead of next3:18page, it actually says any page because3:20we're targeting all of the pages of the3:22site at the same time right now. But the3:24reason we have two effects is because a3:26transition has two parts. How the3:28current page exits from view and how the3:31next page enters into view. And you can3:34really think of these like the animation3:36effects that we learned about earlier in3:37the course. But instead of animating a3:39layer, we're animating an entire page.3:42the entire page within the viewport as3:44if it's one gigantic layer. And in this3:46case, we've got the page we're looking3:48at now. That's one gigantic layer. And3:50then we have the page we're3:51transitioning to, which is the second3:53gigantic layer. So in the event of push,3:56we're sliding the current page out of3:58view. And at the same time, we're4:00sliding the next page into view. So the4:02new page is pushing the old page out of4:05the way, hence the name push. And we can4:07of course click in here to make changes4:08to the animation effect that's happening4:10to the outgoing page and the incoming4:12page. We can play with opacity, scale,4:15rotation, offset. In this case, negative4:17100% which means move 100% of your own4:21width out of the way on the x-axis. In4:23this case, a negative number means move4:25to the left. A positive number would4:27mean move to the right. And similarly, a4:29y offset would let us move the page up4:31or down. We also get a special little4:33setting here called mask, which lets us4:35choose from a variety of different4:36presets to wipe away or reveal the page4:39on the screen. And you get a little4:41preview below that shows what each one4:42does and different parameters to play4:44with depending on which type you choose.4:47And then if we go back, last but not4:49least, we have our transition where we4:51can customize the easing or spring and4:53we can set a duration for the transition4:55that takes place. So, a lot of what4:57you'd expect from animation effects, but4:59with the added bonus of those masks. I'm5:01going to go back a couple of times, and5:03I'm just going to switch us to that push5:06left preset that I had chosen before.5:08And now, let's preview this. Let's see5:09what we've actually ended up with here.5:11I'm going to press command P on my Mac5:13to go into preview. And now, when I go5:15from home to stories, we should get that5:17push left effect. And boom, there it is.5:20And since we chose to apply this to all5:22pages, when I go from stories to5:24features, we get the push left again.5:27But when I go from features to stories,5:29it still pushes left. And from stories5:31to home, it still pushes left, which in5:33my opinion feels kind of backwards5:35because we've got this physically5:36plausible slide from one page to the5:39other. If you go backwards, the5:41transition should theoretically go in5:43the other direction. So, let's fix that.5:45Starting with the stories page, I'm5:47going to head to the pages panel. I'm5:49going to go to the stories page. And5:51again, we've got to select the break5:53point to add an effect. And what's cool5:56is that even though we have push left5:58set to all pages, all pages really means6:01all pages unless specified otherwise. So6:04here we're going to specify otherwise.6:06I'm going to click to add an effect. And6:08I do want the target set to home cuz I'm6:11setting the transition from the page6:12that we're on, which is stories, to the6:14homepage, which again, that's one of the6:16ones that should go the opposite6:17direction. And I'm going to switch the6:19preset here to push right instead of6:22push left. And now we should be all good6:25because the only time that we're6:26transitioning from stories to a page6:29that's the other direction is when we're6:31going from stories to home. When we go6:32from stories to features, we're still6:34pushing left. We're still going in the6:36same direction as what we set on all6:38pages. So we don't have to go and set6:40that one again manually. But let's6:41preview this. Let's make sure that it's6:43looking all good. We're on the stories6:44page. I'm going to click to go to home.6:46We should get the push. Right. There we6:48go. So, home to stories, push left,6:50stories to home, push right. And then6:53last but not least, we'll just have to6:55fix the transitions going from the6:56features page to both stories and home.7:00So, we'll have to set two effects, one7:02to target each of those two pages. And7:04we'll do that now. I'll leave preview7:05mode, head to the features page again,7:08select the breakpoint for the page, and7:10then head down here to effects and click7:12to add that first effect. It defaulted7:15to home, which is one of the targets7:16that we want to fix. And I'm going to7:18switch that from crossfade again to push7:20right. And then I'll add one more again7:23by clicking on effects. And then that7:24automatically defaulted to stories7:26because we had already set an effect for7:28the other page. And again, I'll set the7:30preset to push. Right. Now, we should be7:34really good to go. I'll press command P7:35again on my Mac to preview. We're7:37starting on the features page here. And7:39when I click over to stories, there we7:41go. Pushing in the correct direction.7:43When I go from stories to home, again,7:44we already fixed that one. From home to7:47features, all good. And then from7:48features all the way back over to home,7:51again, we're all good. But I did mention7:54earlier that this navbar component was7:56animated. And we don't get to see the7:58animation cuz it slides off the screen8:01and then comes back. In fact, the entire8:03header bar slides off the screen only to8:06get pushed back in, which doesn't make a8:08whole lot of sense. That's what we would8:09call a persistent element. It's an8:12element that was there before and is8:14there after, it should really just stay8:16put. And that's exactly what we're going8:18to fix in the next lesson. And there you8:21have it. With page effects, your site8:23flows from one page to the next. It's a8:26small touch that helps everything feel8:27more like a product and less like a8:30collection of separate pages. That's it8:32for this one. I'll see you in the next8:34one.

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.