gajus / swing

A swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder.
Other
2.64k stars 248 forks source link

Initialize with all cards not in deck, so they can be thrown in instead of thrown out #116

Open mdmcginn opened 7 years ago

mdmcginn commented 7 years ago

How might I begin with all cards "thrown out" (not in the deck), so they can be thrown in instead of thrown out? For example, the instructions might be "Throw all the red cards onto the stack".

I tried this: [].forEach.call(document.querySelectorAll('.stack li'), function (targetElement) { stack.createCard(targetElement);

    targetElement.classList.remove('in-deck');
    card.throwOut(Direction.LEFT, 400);
});