summaryrefslogtreecommitdiff
path: root/scripts/cards/deck.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-08-25 16:10:17 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-08-25 16:10:17 -0400
commit1fd40d997854e0f23c22ef7d06c0a0a0e5140d89 (patch)
treed91c71668b6b6d561b8181343e09b6e3d3459a2e /scripts/cards/deck.js
parent9ec343c02d6eb9a9a9f58fef826d71abb84b6384 (diff)
Touch support
Diffstat (limited to 'scripts/cards/deck.js')
-rw-r--r--scripts/cards/deck.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js
index f42c896..4f7109d 100644
--- a/scripts/cards/deck.js
+++ b/scripts/cards/deck.js
@@ -25,7 +25,10 @@ class Deck {
// vertical
// up (strip-vu)
// down (strip-vd)
- this.inf = options.mode == "infdraw";
+ this.inf = options.mode == "inf";
+ if (this.inf) {
+ options.mode = "stack";
+ }
// Select mode - controls what other cards are selected when one card is selected
// above - selectes cards above the selected one
@@ -73,8 +76,13 @@ class Deck {
appendCard(card)
{
if(this.inf) {
- return false;
+ if (this.base == null) {
+ this.base = card.getData();
+ } else {
+
+ }
}
+
this.cards.push(card);
this.e.appendChild(card.e);
card.deck = this.getID();
@@ -166,7 +174,11 @@ class Deck {
updateCount ()
{
- this.e.style.setProperty("--ccount", this.cards.length - 1);
+ if (this.cards.length <= 0) {
+ this.e.style.setProperty("--ccount", 0);
+ } else {
+ this.e.style.setProperty("--ccount", this.cards.length - 1);
+ }
let cb = this.e.getBoundingClientRect();