Stacked Brand Cards
- group .........
- Layout, lists and widgets
- source ........
- https://ui.aryank.space/components/stacked-brand-cards
- markdown ......
- /lab/stacked-brand-cards.md
- human .........
- /lab/stacked-brand-cards
── WHAT_IT_IS ────────────────────────────────────────────────────────────────────────────────
A services section where every card but the last pins at the same line and stays there until the outro reaches it, so the deck builds up in place instead of scrolling past. While a card is pinned its inner panel is pulled upward by an amount that grows with how many cards are still to come, which is what makes the pile compress from the bottom rather than simply overlapping. The intro heading is pinned across the whole run on a separate trigger, so it holds until the final card takes the line. GSAP ScrollTrigger and Lenis.
── BEHAVIOUR ────────────────────────────────────────────────────────────────────────────────
* Every card ends at the same trigger
All the pins share one endTrigger, the outro. That is why the deck releases together instead of unstacking in the order it stacked.
* The lift scales with what is left
A card's inner panel is pulled up by (remaining cards) x 14% of the viewport, so the first card travels furthest. Equal lifts would produce a flat overlap rather than a compressed pile.
* pinSpacing is off everywhere
With pin spacing on, each pin would insert its own duration of blank scroll and the cards would never meet. Off, they share the same stretch of page, which is what puts them on top of each other.