Lexicon / Scroll-driven · 6 of 13

06 / Scroll-driven

Sticky Stacking Cards

Cards catch at the top one after another and pile over each other as you keep going.

Twenty of twenty-two

The trumps of the tarot made around 1451 for the Sforza dukes of Milan, dealt onto the table as you scroll: each catches on the pile and the next lands over it. Of the deck’s 78 cards, 74 survive. Two of its trumps, the Devil and the Tower, have never been found.

  1. The Fool: A ragged man, barefoot, with feathers in his hair and a club over his shoulder.
  2. The Magician: A man in red at a table set with small things, a wand in his hand.
  3. The Popess: A woman in a nun’s habit, wearing the papal crown, a book in her hand.
  4. The Empress: A crowned woman with a sceptre and a shield of the black eagle.
  5. The Emperor: A bearded emperor, crowned, with sceptre and orb.
  6. The Pope: A pope enthroned in the triple crown, his hand raised in blessing.
  7. The Lovers: A couple join hands beneath Cupid, blindfolded, on a pedestal.
  8. The Chariot: A crowned lady in a golden chariot drawn by two white horses.
  9. Justice: A woman with sword and scales; above her, a knight rides out.
  10. The Hermit: An old man in a blue cloak and a wide hat, holding an hourglass.
  11. The Wheel of Fortune: Fortune, blindfolded, at the hub of her wheel: one climbs, one reigns, one falls, one crawls beneath.
  12. Strength: A young man raises a club over a lion.
  13. The Hanged Man: A man hangs by one foot from a wooden frame.
  14. Death: A skeleton with a bow.
  15. Temperance: A woman pours from one jug into another.
  16. The Star: A woman in blue holds up a star.
  17. The Moon: A woman holds up the crescent moon.
  18. The Sun: A winged child flies over the hills, holding up the sun’s face.
  19. Judgement: Angels sound their trumpets and the dead rise from the tomb.
  20. The World: Two winged children hold up a walled city under the stars.
  1. The FoolA ragged man, barefoot, with feathers in his hair and a club over his shoulder.
  2. The MagicianA man in red at a table set with small things, a wand in his hand.
  3. The PopessA woman in a nun’s habit, wearing the papal crown, a book in her hand.
  4. The EmpressA crowned woman with a sceptre and a shield of the black eagle.
  5. The EmperorA bearded emperor, crowned, with sceptre and orb.
  6. The PopeA pope enthroned in the triple crown, his hand raised in blessing.
  7. The LoversA couple join hands beneath Cupid, blindfolded, on a pedestal.
  8. The ChariotA crowned lady in a golden chariot drawn by two white horses.
  9. JusticeA woman with sword and scales; above her, a knight rides out.
  10. The HermitAn old man in a blue cloak and a wide hat, holding an hourglass.
  11. The Wheel of FortuneFortune, blindfolded, at the hub of her wheel: one climbs, one reigns, one falls, one crawls beneath.
  12. StrengthA young man raises a club over a lion.
  13. The Hanged ManA man hangs by one foot from a wooden frame.
  14. DeathA skeleton with a bow.
  15. TemperanceA woman pours from one jug into another.
  16. The DevilLost
  17. The TowerLost
  18. The StarA woman in blue holds up a star.
  19. The MoonA woman holds up the crescent moon.
  20. The SunA winged child flies over the hills, holding up the sun’s face.
  21. JudgementAngels sound their trumpets and the dead rise from the tomb.
  22. The WorldTwo winged children hold up a walled city under the stars.

also called card stack · sticky stack

One property on a list. Each item sticks at the same offset so later items slide over earlier ones and the stack builds itself. No library, no measurement, no scroll listener. One property builds the pile: every card is sticky at nearly the same place, so each one that arrives stops over the last, five pixels lower, and the deck’s edge grows down the table. The deal itself is the card’s own view timeline, finished before it sticks; the glint across the gold leaf rides the same timeline.

How it is built.card { position: sticky; top: calc(var(--bar) + 6svh + var(--i) * 5px); /* each lands a little lower */ view-timeline: --land } .face { animation: deal linear both; animation-timeline: --land; animation-range: cover 0% cover 48% } /* dealt in before it sticks */

In full, on GitHub index.html showcase.css

Cards — the Visconti-Sforza tarot, the Pierpont Morgan–Bergamo deck, about 1451 (the Morgan Library & Museum, the Accademia Carrara and the Colleoni family), public domain, via Wikimedia Commons: Fool, Magician, Popess, Empress, Emperor, Pope, Lovers, Chariot, Justice, Hermit, Wheel of Fortune, Strength, Hanged Man, Death, Temperance, Star, Moon, Sun, Judgement, World. Facts — Visconti-Sforza tarot deck.