summaryrefslogtreecommitdiff
path: root/scripts/cards
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-08-18 02:35:46 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-08-18 02:35:46 -0400
commit43333e401a22fc19a7cf0c87c180b37989a7b1a5 (patch)
treed82db7fed6b19419d3be470654e6f75b035c63a0 /scripts/cards
parent4b11dd3210df8659241d5d7d555302f03d5cfc54 (diff)
Fix small formatting bug
Diffstat (limited to 'scripts/cards')
-rw-r--r--scripts/cards/deck.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js
index 3ed94ff..f42c896 100644
--- a/scripts/cards/deck.js
+++ b/scripts/cards/deck.js
@@ -63,16 +63,7 @@ class Deck {
}
updatePos()
- {
- let cb = this.e.getBoundingClientRect();
-
- if(cb.width >= window.innerWidth)
- this.e.className = "maxw";
- else if (cb.height >= window.innerHeight)
- this.e.className = "maxh";
- else
- this.e.className = "";
-
+ {
let len = this.cards.length - 1;
for(let i in this.cards)
this.cards[i].setPos(len-i);
@@ -176,6 +167,15 @@ class Deck {
updateCount ()
{
this.e.style.setProperty("--ccount", this.cards.length - 1);
+
+ let cb = this.e.getBoundingClientRect();
+
+ if(cb.width >= window.innerWidth)
+ this.e.className = "maxw";
+ else if (cb.height >= window.innerHeight)
+ this.e.className = "maxh";
+ else
+ this.e.className = "";
}
isInside(x, y)