From 1fd40d997854e0f23c22ef7d06c0a0a0e5140d89 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 25 Aug 2022 16:10:17 -0400 Subject: Touch support --- scripts/cards/deck.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'scripts/cards/deck.js') 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(); -- cgit v1.2.3