Shuffle decks on click
This commit is contained in:
parent
c7e4774fba
commit
0d724988d5
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user