Animate in on scroll
Make things animate as they scroll into view. Adding an In view behavior, every effect and its settings, changing a card’s fade to a slide, and checking it all in Preview with Replay, on the Frostline Sauna Club template.
Steps
- Open the Frostline Sauna Club template if you’d like to follow along.
- They don’t play in the editor, so the page stays put while you work. Preview shows them.
- Select something and click the lightning bolt beside it. A behavior is something an element does, and when.
- Add behavior starts with the trigger. In view plays the moment the element becomes visible on the visitor’s screen.
- Fade, Slide, Blur, Rotate and Scale. Scale grows the photo from a bit smaller up to full size.
- Where it starts and ends, Replay, Threshold, Easing and Duration, plus a little Preview button in the panel.
- This card came with a fade. Slide adds a direction and a distance.
- Templates and new sections pick up an animation from your brand kit, so a whole site can share one feel.
- Scroll down: the card slides up into place, then the lake photo grows in.
- Starts the page over so every animation plays again, without reloading.
- Select something, add a behavior, choose the effect and its settings, then check it in Preview.
Read the full transcript
Scroll down a good website and you'll often notice things arriving as you reach them. A headline eases up, a photo settles into place. In this video I'll show you how to set that up, so something animates as it scrolls into view. We're on Frostline, a template for a sauna and cold-plunge club on a lake in Maine.
One thing to know before we start. Animations don't play here in the editor, so the page stays put while you work on it. To watch them, you click Preview up here, and we'll do exactly that once they're set up.
I'll start with this photo of the lake. When you select something, a lightning bolt shows up beside it. That opens Behaviors. A behavior is something you tell an element to do, and when to do it. It might animate as you scroll, react when the mouse is over it, or take you somewhere when it's clicked. This photo doesn't have any yet.
Add behavior starts with the trigger, which is when it happens. There's a whole list, and each of these gets its own video. The one we want is In view. In view means the moment this photo becomes visible on the visitor's screen. If it's further down the page, it waits until they scroll down to it. If it's already on screen when the page opens, it plays straight away.
Next is the effect, which is what actually happens. Fade brings it in from nothing. Slide moves it into place from one side. Blur starts it soft and brings it into focus. Rotate turns it a little as it lands. And Scale grows it from a bit smaller up to full size. That's the one I'll use for the lake.
Every effect comes with a few settings. For Scale, it's where it starts and where it ends up, so here it begins at eighty percent of its size. Replay decides whether it plays once, the first time someone reaches it, or every time it comes back into view. Threshold is how much of the photo has to be showing before it starts, so it doesn't play while just a sliver is peeking in. Easing is how the speed changes along the way. Ease out starts quickly and settles gently, which feels natural for something arriving. Duration is how long it takes. I'll pick large, so it's slow and calm. And this little Preview button plays the effect on a sample square right here, so you can get a feel for it without leaving the panel.
This card already has a behavior, because the template came with one. It fades in, and I'd like it to slide up instead. Slide adds a direction, so it can come up from below, drop down from above, or come in from the left or the right. I'll go with up for this card. Distance is how far it travels on the way, and the rest of the settings are the same ones we just went through.
Templates come with some animations already, and new sections you add pick one up too. That comes from your brand kit, so a whole site can share one animation feel, like everything gently fading up as you scroll. There's a separate video on that.
Now let's watch them. I'll click Preview, which shows the page exactly the way a visitor will see it. Let's scroll down to the prices and keep an eye on the card. There it goes, sliding up into place. And a little further down is the lake. Watch it grow gently into place.
Up at the top there's Replay. It starts the page over, so every animation plays again from the beginning, without reloading anything. That's handy when you've just changed a setting and want to see the difference.
And that's In view. Select something, add a behavior, choose the effect and its settings, then check it in Preview. Headlines and numbers have a couple of animations of their own, and that's what the next video covers.