Reference
Collections and piles: pure helpers
import { … } from "@johnmorrisdotca/fuda-cards/collection";
Exports
| Name | Kind | What it is |
|---|---|---|
CollectionCard | type | One item of a collection: an id, a name, the front's picture, optionally the back's, its kind and its metadata. |
CollectionKind | type | What an item is. |
collectionKinds | constant | The two kinds of item, card and object. |
CollectionMetadata | type | What a collector writes about a card: its set, year, number, edition, condition, grade, quantity and notes. |
CollectionView | type | The name of a display of <fuda-collection>: the view attribute's values. |
collectionViewAliases | constant | Display names that earlier versions accepted and that now open another display, so a page that sets them keeps working. |
collectionViews | constant | The ten displays, in the order the buttons show them, each with the label on its button. |
DeckLanding | type | How a card taken off a pile lands on the pile at its side: still facing up, or turned over sideways (as a person turns a card, like a page) to show its back. |
deckLandings | constant | The two ways a card can land, with the label on each button: face-up (still facing up) and face-down (turned over sideways on the way). |
fanLayout | function | Where the cards of a fan lie: each card turns eleven degrees more than the one before, up to 110 degrees from the first to the last, centred on the pile. |
FanPlace | type | Where one card of a fan lies, first card on the left when open and on top when closed. |
isCard | function | Whether an item is a card: anything that does not say it is an object. |
movePage | function | The first card of the page that is delta pages away, wrapping round at either end. |
normalizeLanding | function | The landing a value means: face-down (also upside-down and turned-over) is turned over; anything else is still facing up. |
parseCollection | function | Check a collection and make it the shape the element draws: an array of cards, or an object with a cards array. |
randomDrawIndex | function | Choose a card whose name contains the filter, avoiding the current card when another match exists. |