Sticky stacking cards

As the name suggested, this interaction is stacking cards on top of each other while you scroll down the page.
Scroll down to check it out.

01

Creating elements and structure

First, create a container to house the card elements.

In this case, I have created 'c-cards-list' and 'w-cards-list'. 'c' represent container and 'w' represent wrapper. This is my standard structuring method to prepare the elements for complicated interactions just in case.

Similarly, create 'c-card' and 'w-card' inside the container. Style the 'w-card' element according to your preference and then add in required content.

02

Making sticky cards

To create a stacking effect, you will required to use the 'position: sticky'.

Apply 'position: sticky' to 'c-card' element and apply at least 1px for the top position.

By now, you should be able to see the cards stacking on top of each other while you scroll down the page.

03

Create layering effects for stacked cards

Great. Now you have successfully stacking the cards on top of each other. To make them looks better, we will create some layering effect.

Create combo class for each of the 'c-card' element. For example, '1', '2', '3' and etc. Then add some value in the top position. For example, for first card, you can give it 20px from the top to make some spacing. Then for the following cards, you can add 100px each. You can adjust the value based on your design and layout.

Example: First card : 20px ; Second card : 120px ; Third card : 220px ; and so forth...

04

Enhancing layering effect with interaction

To make the layering looks even much better, you can apply interaction into 'c-card' elements.

Apply 'While scrolling in view' interaction to 'c-card' elements and ensure it affects all same class. Set the smoothing value to 90%.

Insert 'Scale' interaction starts at keyframe 40% (scale value: 1) and end at 100% (scale value: 0.8). Set it to affect 'Interaction Trigger' (c-card).

Now you should be seeing the cards stacking on top of each other with nice layering and depth.

05

Congratulations!

Now, have fun and start cloning. 😍

If you encountered any issue during cloning, feel free to contact us by clicking the 'Need help?' button on the right.

You can also support our work by following us on our social media or buy us a cup of coffee.

☕☕☕

Have fun cloning!