KQ-1365 · DECK/SHUFFLE
Deck Shuffle
Every letter is a little playing card dealt face down; the deal riffles across the line, each card lifting on the snap spring and turning over and over in 3D through seeded random cards of its own case until the last half-turn shows its letter, the final quarter-turn handing its speed to the snap spring so it lands flat with one wobble while its lift drops on recoil and the drop shadow tightens. Pointing at a word riffles it again, a tap does on touch, and a keyboard handle riffles the whole line with Enter or one word at a time with Left and Right.
Waylight Card Room · Friday
Shuffle up and deal.
Enter shuffles the whole line; Left and Right shuffle one word at a time.Doors at eight. House rules, no stakes.
dealing · cards turning
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/deck-shuffle
Props
- children
- string
- default —
- The line, as a string. Wins over text.
- text
- string
- default —
- The line, when it is not given as children.
- as
- "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div"
- default "p"
- The element that carries the line.
- riffles
- number
- default 4
- How many random cards each letter turns through before its own, 1 to 8.
- spread
- number
- default 500
- How long the riffle takes to spread from the first letter to the last, ms.
- speed
- number
- default 9
- Card turns a second while riffling.
- glyphs
- string
- default ""
- The deck the random cards are drawn from; empty draws letters of the same case.
- seed
- number
- default 0
- Seed for the cards drawn and the deal's tilt.
- cards
- boolean
- default true
- Draw each letter on a card tile; false flips bare letters.
- tilt
- number
- default 1.5
- Largest hand-dealt tilt of a card, degrees.
- lift
- number
- default 0.14
- How high a card lifts off the table while it riffles, em.
- face
- string
- default "var(--popover)"
- The card face, any CSS colour.
- back
- string
- default "var(--accent-bright)"
- The card back's pattern, any CSS colour.
- interactive
- boolean
- default true
- Pointing at a word, tapping it or the keys riffle it again.
- trigger
- "mount" | "inView" | "hover" | "manual"
- default "inView"
- When the deal plays.
- once
- boolean
- default true
- Play once, or again each time it re-enters view or is hovered.
- delay
- number
- default 0
- Wait before the deal, ms.
- play
- boolean
- default false
- With trigger "manual": true deals, false turns every card face down.
- sound
- boolean
- default false
- A soft card-on-felt sound as each card the visitor riffled lands.
- onComplete
- () => void
- default —
- The deal has landed, every card face up.
- className
- string
- default —
- Classes for the root; card sizes are in em of its font size.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | — | The line, as a string. Wins over text. |
| text | string | — | The line, when it is not given as children. |
| as | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "p" | The element that carries the line. |
| riffles | number | 4 | How many random cards each letter turns through before its own, 1 to 8. |
| spread | number | 500 | How long the riffle takes to spread from the first letter to the last, ms. |
| speed | number | 9 | Card turns a second while riffling. |
| glyphs | string | "" | The deck the random cards are drawn from; empty draws letters of the same case. |
| seed | number | 0 | Seed for the cards drawn and the deal's tilt. |
| cards | boolean | true | Draw each letter on a card tile; false flips bare letters. |
| tilt | number | 1.5 | Largest hand-dealt tilt of a card, degrees. |
| lift | number | 0.14 | How high a card lifts off the table while it riffles, em. |
| face | string | "var(--popover)" | The card face, any CSS colour. |
| back | string | "var(--accent-bright)" | The card back's pattern, any CSS colour. |
| interactive | boolean | true | Pointing at a word, tapping it or the keys riffle it again. |
| trigger | "mount" | "inView" | "hover" | "manual" | "inView" | When the deal plays. |
| once | boolean | true | Play once, or again each time it re-enters view or is hovered. |
| delay | number | 0 | Wait before the deal, ms. |
| play | boolean | false | With trigger "manual": true deals, false turns every card face down. |
| sound | boolean | false | A soft card-on-felt sound as each card the visitor riffled lands. |
| onComplete | () => void | — | The deal has landed, every card face up. |
| className | string | — | Classes for the root; card sizes are in em of its font size. |