Module 9: Animating a UI Transition
Let's animate with a purpose. In this module, you'll create a multi-part animation that simulates a real user interaction, like swiping through cards in an app.
Inspiration: Professional UI/UX Animations
This video showcases the kind of fluid, engaging UI animations that can be created in Blender. We'll build a simpler version of these concepts in our project.
Project: Animate a Card Swipe 💳
Follow these steps to create a satisfying swipe animation.
Step 1: Create a Stack of Cards
- Create a thin, flat, rounded rectangle to be your top card (a beveled, scaled cube works perfectly).
- Duplicate it (Shift + D) twice. For each duplicate, move it slightly down and back, and scale it down a little, to create a stack of three cards.
- Go to the Material Properties and assign a different, vibrant color to each of the three cards so you can tell them apart.
Step 2: Animate the Top Card Swiping Away
- Select the top card. On the timeline, go to Frame 10.
- Press I and insert a keyframe for Location & Rotation.
- Go to Frame 30. Move the card (G) far off to the left of the screen. Rotate it slightly (R) to give it a "flick" effect.
- Press I and insert another Location & Rotation keyframe.
Step 3: Animate the Next Card Moving Into Place
- Select the middle card. On Frame 10, press I and insert a keyframe for Location & Scale (at its starting position).
- Go to Frame 30. Now, move this card up and forward to the exact spot where the top card used to be. Scale it up to match the original size of the top card.
- Press I and insert another Location & Scale keyframe.
- Repeat this process for the bottom card, having it move into the middle card's position.
Step 4: Fine-Tuning with the Dope Sheet
The timing might feel too robotic. We can easily fix this by offsetting the keyframes.
- Change your Timeline editor into the Dope Sheet. You can do this from the editor type dropdown in the top-left corner of the timeline panel (it looks like a clock).
- In the Dope Sheet, you can see the keyframes for all objects. Select the keyframes for the second and third cards (drag a box around them).
- Press G to grab and slide them a few frames to the right. By starting their animation a little later, the whole transition will feel more natural and less simultaneous.
- Play the animation (Spacebar) to see the difference!