Check out a free preview of the full Design for Developers course

The "Page Transitions" Lesson is part of the full, Design for Developers course featured in this preview video. Here's what you'd learn in this lesson:

Sarah shows examples of page transitions, from working code in the wild to concepts created by video effects.


Transcript from the "Page Transitions" Lesson

>> Sarah Drasner: Another thing that you can do once you're kind of done making prototypes is you can do things like page transitions. And so I made this demo that shows how to create these kind of smooth page transitions even with interaction on a view application. And basically, the way that it works is within middle ware and the Vue X store, Vue X is a little like redux.

I'm storing what's page it's on and then I have CSS transitions that work from page to page and I have the same things transitioned. So basically, that if I restart this, this piece is consistent across a bunch of different routes. But the nav it stays for each one of those routes.

So I did a write-up of how this is all made for Vue, and then a friend forked it to React, and then another friend forked it to Angular. So if you're working within any one of those frameworks, and you wanna try to make these kind of smooth page transitions across your applications.

If you're using one of those three applications those examples exist and are all open source for you to check out.
>> Sarah Drasner: Another way that I kinda plan these out, I thought I would show you something that's like, a work in progress. And I'm changing, I'm in the middle of changing this.

So, this is an original dribble shot that that somebody made, and I'm going to completely redo all of these pieces like we showed about the remixing before. But the first thing I do is I take the similar objects, and I keep some of them static across things, and then for some of them, I make them bigger.

Some of the pieces stay consistent, some of them drop down, some of them go away, but basically, I'm just keeping that all in one art board so I can move little pieces around. And I can see how it would change and adjust for either different screen sizes or for different views of those pages.

So that's how I made that page transitions one as well. Is I kept some pieces consistent across each of the things and just changed maybe their scale or maybe it has a rounded corner now, or something like that. So that's one that you could work with that. Lee Long if you don't know his work, does this awesome dribble shots, he's not a developer, these are all just imaginations of things, so he makes these an After Effects.

So he makes all of these an After Effects and exports them as gifs so he hasn't really made them in code or anything. But if you wanted to like practice or even just get inspired by some of this stuff that he makes, they are really cool. Rally does really great things with Motion too.

Where they just have these subtle little transitions between effects. This is real, this is on websites and stuff, so you can go check out their code as well. Everything Rally does is gorgeous, and their typography is also really well done as well. They do things like this for their site where you have these different sections and this floating ribbon between each one of them.

And if you click it kind of expands and changes. This was always on a site that was like their beta site. They kept futzing with it and they wouldn't ship it because they were being too perfectionist about it. So if you go to their site and this isn't it, you have to go to like beta.rally or something.

They just never were happy enough with it, but I think it's gorgeous. There's also, this one's not rally, I miss attributed it this is somebody else on dribble. I should change this thing, but I thought it was a really nice transition. It's a nice way, it's another time where you can use SVG or SVG filters to kind of make page transitions come to life.

Codrops, how many of you know Codrops? Just like three, not that many of you. Go to Codrops immediately, they're amazing. This is one example of 1,700 and they show you how to make all of these things in code. So all of their examples are like this good. And they're all different, and they all are just fantastic.

And a lot of them use CSS Grid, too. So if you wanna learn CSS Grid a little bit better, and some of these great effects, man, they're geniuse, check it out. Cool, if you do wanna check it out and create these kind of animations tomorrow, I have a whole course where we go into some of this stuff.

But there's this idea called flip on the web, and its a way to get really performing animations. So the way that you do that is you get the bounding client rec, which is just like the x, y, width, height coordinates of the first state of the thing. And then you get the end state and how big that is.

And then you find the space in between there. If that doesn't sound like fun to you, which it might not, David Khourshid, who you should definitely check out his work, he's also a great animator, has a thing called Flippy. It's a library that he created, so that you can create some of those effects.

It's really nice, and it doesn't need the framework. So if you're not framework person, or if you're a framework person you can use them. In Vue, we do this stuff under the hood. You can just wrap a thing in a thing called transition group, and all of that calculation happens for you, how cool is that?

That's awesome, Vue is great, [LAUGH]. If you want to use something that also does a lot of hardware acceleration for you under the hood, GreenSock or GSAP does that, and you don't have to manually hardware accelerate anything there, already doing that. They're gonna assume that you want hardware acceleration, and they have a flag where you can tell it not to be hardware accelerated if you'd ever want that.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now