Shuffle decks on click

This commit is contained in:
Adam Goldsmith 2017-09-20 18:12:41 -04:00
parent c7e4774fba
commit 0d724988d5

View File

@ -15,6 +15,12 @@ window.addEventListener('load', () => {
deckName = document.querySelector('#card-container').getAttribute("data-deckName");
xhr.open("GET", "/deck/" + deckName + "/deck.json");
xhr.send();
document.querySelectorAll('.card-pile').forEach(e => {
e.addEventListener('click', event => {
shuffle(piles[event.target.getAttribute('data-pile')]);
});
});
});
let cardInteract = interact('.card')