ProtectedcardsProtectedcounterProtectedelementthe stock element (should be an empty HTML Element)
ProtectedemptyProtectedfanProtectedfloatingProtectedfloatingProtectedheightProtectedholderProtectedlastProtectedmanagerthe card manager
ProtectedmaxYProtectedminOptionalonCalled when a card is added to the stock. Returns the added card.
card: the added card
OptionalonCalled when a card is clicked. Returns the clicked card.
card: the clicked card (can be selected or unselected)
OptionalonCalled when card count change. Returns the clicked card.
card: the clicked card (can be selected or unselected)
OptionalonCalled when a card is removed from the stock. Returns the removed card.
card: the removed card
OptionalonCalled when selection change. Returns the selection.
selection: the selected cards of the stock
lastChange: the last change on selection card (can be selected or unselected)
ProtectedselectableProtectedselectedProtectedselectionProtectedsettingsthe optional stock settings
Protected OptionalsortAdd a card to the stock.
the card to add
Optionalsettings: AddCardSettingsa AddCardSettings object
the promise when the animation is done (true if it was animated, false if it wasn't)
ProtectedaddOptionalsettings: AddCardSettingsAdd an array of cards to the stock.
the cards to add
Optionalsettings: AddCardSettingsa AddCardSettings object
if number, the number of milliseconds between each card. if true, chain animations
ProtectedaddOptionalsettings: AddCardSettingsProtectedaddOptionalsettings: AddCardSettingsProtectedanimationThe element to animate. The element is added to the destination stock before the animation starts.
The HTMLElement to attach the card to.
ProtectedbindProtectedcanChecks if the card can be added. By default, only if it isn't already present in the stock.
the card to add
Optionalsettings: AddCardSettingsthe addCard settings
if the card can be added
ProtectedcardProtectedcardUpdates the cards number, if the counter is visible.
ProtectedcardTriggered after card order is changed, when setting a new sort function.
Notify the stock that a card is removed.
the card to remove
Optionalsettings: RemoveCardSettingsa RemoveCardSettings object
Flips the card.
the card informations
Optionalsettings: FlipCardSettingsthe filtering to apply on card click events. Use setting from manager if unset.
Returns the card count in the deck (what the player think there is, for decks, the real number of cards for all visible card stocks).
the number of card in the stock
the cards on the stock
ProtectedgetGet the y and angle of a card.
the style to apply to last play cards. Use style from manager if unset.
ProtectedgetProtectedgetthe style to apply to selectable cards. Use style from manager if unset.
the style to apply to selected cards. Use style from manager if unset.
the selected cards
the style to apply to selectable cards. Use style from manager if unset.
if the stock is empty
Removes the stock and unregister it on the manager.
Remove all cards from the stock.
Optionalsettings: RemoveCardSettingsa RemoveCardSettings object
Remove a card from the stock.
the card to remove
Optionalsettings: RemoveCardSettingsa RemoveCardSettings object
Remove a set of card from the stock.
the cards to remove
Optionalsettings: RemoveCardSettingsa RemoveCardSettings object
Remove the mark of the last play cards.
OptionalcardClass: stringSelect all cards
Set selected state to a card.
the card to select
Set the card to its front (visible) or back (not visible) side.
the card informations
Optionalsettings: FlipCardSettingsMark the last play cards. Remove the other last play card classes.
the cards to mark as last played
Optionalcolor: stringthe color to use to mark the last played card, usually the player color
OptionalcardClass: stringa class applied on this type of cards, to limit removal to these type of cards.
ProtectedsetSet the selectable class for each card.
OptionalselectableCards: T[]the selectable cards. If unset, all cards are marked selectable. Default unset.
Set if the stock is selectable, and if yes if it can be multiple. If set to 'none', it will unselect all selected cards.
the selection mode
OptionalselectableCards: T[]the selectable cards (all if unset). Calls setSelectableCards method
ProtectedsetChanges the sort function of the stock.
Optionalsort: SortFunction<T>the new sort function. If defined, the stock will be sorted with this new function.
Returns if a card should be placed on this stock (with the autoPlace setting).
Unselect all cards
Set unselected state to a card.
the card to unselect
ProtectedupdateUpdates the y and angle of each card to keep it fan-shaped.
ProtectedwatchCreate an IntersectionObserver, detecting if the holder is below the screen frame. If it's the case, the hand is made floating, else it's reattached to the holder.
Protectedwatch
A stock representing the player hand.
If the stock is not visible because it is under the viewport, it will be floating at the bottom of the viewport.