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.
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.
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...
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.
Our official integration for Ecwid platform.
Start accepting crypto payments on your Ecwid store.
Our official plugin for WordPress (WooCommerce) sites.