How to Build 3D Scroll Animations in Webflow
This instructional video serves as a comprehensive Webflow Master Class designed to guide developers through creating a sophisticated, 3D "while scrolling" animation entirely without code. The core value lies in its detailed breakdown of a complex layout where elements—specifically cards—stack dynamically using sticky positioning and 3D perspective. By leveraging a section height of 600VH to control animation speed and utilizing a sticky main container, the tutorial demonstrates how to transform a standard static layout into an engaging, immersive narrative experience ideal for showcasing client testimonials or process steps.
The technical instruction focuses heavily on the mathematics and logic behind seamless animation timelines. Viewers will learn how to calculate precise offsets and distribute the animation duration across multiple elements to ensure fluid movement. The guide moves beyond simple movements by teaching how to manipulate the Z-axis and "children perspective" properties to create depth, making cards appear to move farther away from the screen as they stack. Additionally, the video covers the integration of Webflow components to streamline the design process, allowing for rapid content updates without breaking the animation structure.
By the conclusion of this tutorial, the viewer will have achieved a fully responsive, high-performance interaction that works flawlessly across all device sizes. The instructor emphasizes a "mobile-first" mindset by using viewport height (VH) units for sizing and spacing, ensuring the animation adapts natively without extensive media queries. Furthermore, learners will master the technique of layering different interaction types, combining "while scrolling" triggers with "scroll into view" effects to maximize user engagement and visual polish.
Key Takeaways
- The Power of Sticky Positioning: The foundation of this animation relies on setting the main container’s height to 100VH and its position to Sticky with a top offset of zero. This ensures the content remains locked to the viewport while the user scrolls through the extended section height (e.g., 600VH), which dictates the animation's duration and speed.
- Creating 3D Depth without Code: To achieve a premium 3D effect where elements recede into the background, you must set the "children perspective" property (e.g., 3,000 pixels) on the parent container. This creates a vanishing point, allowing the subsequent Z-axis transforms (moving cards backward) to be visually perceptible to the user.
- Precision Timeline Calculation: A smooth animation requires dividing the scroll percentage logically among the elements. In this example involving six cards, the timeline is split based on visibility; the first card’s movement is shorter (starting half-visible), resulting in a calculated keyframe sequence (e.g., 9%, 27%, 45%) to ensure consistent pacing.
- Responsive Architecture via VH Units: To guarantee the animation looks astonishing on every device—from desktops to tablets—the setup utilizes VH (Viewport Height) units for critical dimensions, including padding, font sizes, and element heights. This approach ensures the layout scales proportionally to the viewport automatically, prioritizing user experience.
- Layering Interaction Types: You can significantly enhance the user experience by combining interaction triggers. The tutorial demonstrates running a primary "while scrolling" animation (for the card stacking) alongside a secondary "scroll into view" interaction (for internal text effects), adding dynamism to the content as it enters the screen.
Timestamps
- 02:06 – Set the section height to 600 VH to determine the overall speed and duration of the animation.
- 02:55 – Set the main container height to 100 VH so the experience takes up the entire viewport.
- 03:14 – Set the main container position to Sticky with a top offset of zero to lock content during the scroll.
- 04:52 – Set the heading wrapper height to 25 VH to ensure responsiveness regardless of font size.
- 05:40 – Define the heading font size using the formula Min(10 VH, 9 VW) to fit different viewport aspects.
- 07:15 – Set "children perspective" to 3,000 pixels on the card list element to enable 3D depth on the Z-axis.
- 08:27 – Set the card wrapper position to Absolute to stack all cards directly on top of each other.
- 10:44 – Set pointer events to None on the card overlay to allow text selection underneath.
- 13:55 – Calculate the animation end offset (16.6%) by dividing 100 VH by the section height (600 VH).
- 14:21 – Set animation smoothing to 75% (or custom preference) for fluid movement.
- 17:15 – Set the initial Y movement to 32.5 VH (calculated as half of the available 65 VH space) to make the first card appear half-visible.
- 17:30 – Create the first keyframe at 8% with a Y value of 0 VH to complete the first movement.
- 20:19 – Adjust the timeline distribution: allocate 9% for the first movement and 18% for all subsequent card movements.
- 22:24 – Add Z-axis transforms (e.g., -4 VH, -8 VH) to visible cards to simulate them moving farther away from the screen.
- 26:07 – Animate the card overlay background color/opacity (starting at 0%) to progressively darken cards as they move backward.
- 30:14 – Set the offset to 55% for the secondary "Scroll into View" interaction to time the text animation correctly.
- 30:39 – Set the animation trigger to the class section card item so it applies automatically to all list items.
Building a 3D While-Scrolling Animation in Webflow
A Technical Step-by-Step Guide
This guide outlines the process of creating a responsive, code-free 3D card stacking animation. Follow these steps to replicate the setup and interaction logic exactly as demonstrated.
Phase 1: Structural Setup & Layout
1. Configure the Section Height
- Time: 02:06
- How: Select your main Section element and set the Height to 600 VH.
- Why: The section height determines the duration and speed of the scroll animation. A taller section (600 VH) forces a longer scroll, making the animation slower and smoother.
2. Set Up the Main Container (Sticky)
- Time: 02:55 - 03:14
- How:
- Set the Height to 100 VH.
- Set Position to Sticky.
- Set the Top offset to 0px.
- Why: This ensures the content locks to the viewport while the user scrolls through the 600 VH section. Without
sticky: top 0, the content would simply scroll away immediately.
3. Establish Responsive Heading Typography
- Time: 05:40
- How: Select your Heading element. Set the font size using a custom calculation:
Min(10 VH, 9 VW). - Why: This logic ensures the text scales based on the viewport aspect ratio. It selects the smaller value between 10% of the viewport height or 9% of the width, preventing the heading from overlapping the cards on different devices.
4. Enable 3D Space (Children Perspective)
- Time: 07:15
- How: Select the Card List element (the parent of your cards). In the Transform settings, set Children Perspective to 3,000px.
- Why: This creates a vanishing point. Without this setting, Z-axis transforms (moving elements "backward") will look flat. This enables the 3D depth effect.
5. Position the Cards for Stacking
- Time: 08:27
- How: Select the Card Wrapper. Set Position to Absolute.
- Why: Absolute positioning allows all cards to stack directly on top of one another initially, which is required before we animate them moving into place.
Phase 2: Building the "While Scrolling" Interaction
6. Initialize the Interaction & Offsets
- Time: 13:55
- How:
- Add a "While Scrolling in View" trigger to the Section.
- Set Animation Smoothing to 75%.
- Set the End Animation Offset to 16.6%.
- Why: The 16.6% offset is calculated by dividing the viewport height (100) by the section height (600). This ensures the animation finishes exactly when the section is fully scrolled.
7. Create the Initial Movement (The First Card)
- Time: 17:15
- How: Create a move action for the first card.
- Start: Move Y by 32.5 VH.
- End (at 8% keyframe): Move Y to 0 VH.
- Why: The value 32.5 VH is derived from half the available hidden space (65 VH). This makes the first card appear "half-visible" initially rather than completely hidden.
8. Define the Timeline Distribution
- Time: 20:19
- How: Distribute the keyframes for the remaining cards. Allocate 9% duration for the first movement and 18% for all subsequent movements.
- Sequence: 9%, 27%, 45%, 63%, 81%, 99%.
- Why: The first movement is shorter because the card starts half-visible. Adjusting the timeline ensures equal visual pacing for every card.
Phase 3: Adding 3D Depth & Polish
9. Animate Depth (Z-Axis Transforms)
- Time: 22:24
- How: As new cards enter, animate the previous cards moving backward.
- Step 1: Add a Z-axis transform of -4 VH and a Y-axis transform of -1 VH.
- Step 2: Increase incrementally (e.g., -8 VH, -12 VH) at each subsequent keyframe.
- Why: Moving cards along the Z-axis (negative values) pushes them "into" the screen, creating the illusion that they are receding behind the new content.
10. Darken Backgrounds for Contrast
- Time: 26:07
- How: Target the Card Overlay element (a div inside the card). Animate its background color opacity from 0% to 5% (black) progressively across the timeline steps.
- Why: This lighting effect reinforces the depth perception, making cards look like they are physically further away in a shadowed space.
Phase 4: Secondary Interaction (Scroll Into View)
11. Add Content Entry Animations
- Time: 30:14 - 30:39
- How:
- Create a separate "Scroll Into View" trigger applied to the class section card item.
- Set the offset to 55%.
- Why: This animates the internal text/content of the card independently of the stacking behavior. The offset ensures the text animates only when the card is well-positioned within the viewport.
FAQs
How do I control the speed of a "while scrolling" animation in Webflow?
You control the playback speed by adjusting the height of the parent section wrapping your sticky content. Increasing this height (e.g., to 600 VH) forces the user to scroll further to complete the section, effectively slowing down the animation's duration relative to the scroll interaction.
How do I create a 3D stacking card effect without code?
Set your main container to position: sticky with top: 0 and apply a children perspective value (e.g., 3,000px) to the card wrapper to enable depth. Set individual cards to position: absolute to overlap them, then animate their Z-axis transform negatively (e.g., -4 VH) on a scroll timeline to simulate receding depth.
How do I calculate the correct end offset for a sticky scroll interaction?
To ensure the animation finishes exactly when the section is fully scrolled, divide 100 VH by your section’s total height (e.g., 100 / 600 = 0.166). Convert this decimal to a percentage (16.6%) and enter it into the "End Animation Offset" field in the interaction settings.
Why are my Z-axis transforms not showing depth in Webflow?
For 3D movements to be visually perceptible, you must define the children perspective property on the parent element containing the animated items. Without setting this value (e.g., to 3,000 pixels), the browser lacks a vanishing point, rendering Z-axis translations flat rather than three-dimensional.