summaryrefslogtreecommitdiff
path: root/scripts/cards/card.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-08-18 02:17:23 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-08-18 02:17:23 -0400
commit46aae06bd699b3ca396f7f5c750e1fb9fc9ff4bc (patch)
tree92a7c7179a568d0095c2fff3c14d20437c1acd8b /scripts/cards/card.js
parent4efae60183feb616c3dec7698a6a2fe4351b71c7 (diff)
Add transform to drags
Diffstat (limited to 'scripts/cards/card.js')
-rw-r--r--scripts/cards/card.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/cards/card.js b/scripts/cards/card.js
index 53e9861..352f2b3 100644
--- a/scripts/cards/card.js
+++ b/scripts/cards/card.js
@@ -7,7 +7,7 @@ const CardPos = ["top", "topl", "topr", "mid", "midt", "midb", "bot", "botl", "b
// Every card should have a deck.
// Use deck.appendCard, deck.prependCard, or deck.addCardAt to make a card visible
class Card {
- constructor (id, data)
+ constructor (id, deck, data)
{
this.e = document.createElement("card");
this.generateElements(data);
@@ -16,6 +16,7 @@ class Card {
this.e.card = this;
this.id = id;
+ this.deck = deck;
}
// Generate a card with basic text only
@@ -125,6 +126,8 @@ class Card {
{
this.e.style.setProperty("--left", "0px");
this.e.style.setProperty("--top", "0px");
+ this.e.style.setProperty("--irot", "0");
+ this.e.style.setProperty("--iscale", "1");
}
resetPosInstant()
@@ -136,6 +139,6 @@ class Card {
}
getDeck() {
- return this.e.parentElement.deck;
+ return this.deck;
}
}