Shuffle decks on click

This commit is contained in:
Adam Goldsmith 2017-09-20 18:12:41 -04:00
parent 345a86bfa6
commit dd94513736

View File

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