summaryrefslogtreecommitdiff
path: root/scripts/cards/card.js
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-09-29 01:53:49 -0400
committerKyle Gunger <corechg@gmail.com>2020-09-29 01:53:49 -0400
commit673d16d8f2fb9d7b7df5f6fcadfbc665f329887c (patch)
treea75381de6b9d2441310599de71fd7ea5d143b153 /scripts/cards/card.js
parent04010b3b1f6ba6fc44d2cd0cd6a8a39446cd7b1d (diff)
More drag updates
Diffstat (limited to 'scripts/cards/card.js')
-rw-r--r--scripts/cards/card.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/cards/card.js b/scripts/cards/card.js
index 750d124..884e0d9 100644
--- a/scripts/cards/card.js
+++ b/scripts/cards/card.js
@@ -7,12 +7,16 @@ const CardPos = ["top", "topl", "topr", "mid", "midt", "midb", "bot", "botl", "b
// Every card should have a deck.
// Use deck.appendCard or deck.prependCard to make a card visible
class Card {
- constructor (data)
+ constructor (id, data)
{
this.e = document.createElement("card");
this.generateElements(data);
this.e.style.left = "0px";
this.e.style.top = "0px";
+
+ this.getID = function() {
+ return id;
+ }
}
// Generate a card with basic text only
@@ -107,4 +111,10 @@ class Card {
{
this.e.style.setProperty("--cpos", p);
}
+
+ resetPos()
+ {
+ this.e.style.left = "0px";
+ this.e.style.top = "0px";
+ }
}