summaryrefslogtreecommitdiff
path: root/scripts/cards/card.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-08-11 01:09:44 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-08-11 01:09:44 -0400
commit2e67661f0016874b7afbfeeb773401b94d5cefcd (patch)
tree2d29b2559a783cd986c4d5fcead47843e01d8270 /scripts/cards/card.js
parent5f7ffa76984da87c7b67be24f392a6ff50f5a8a2 (diff)
Fix dragging for scaled cards
Diffstat (limited to 'scripts/cards/card.js')
-rw-r--r--scripts/cards/card.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/cards/card.js b/scripts/cards/card.js
index 17d8994..53e9861 100644
--- a/scripts/cards/card.js
+++ b/scripts/cards/card.js
@@ -11,8 +11,8 @@ class Card {
{
this.e = document.createElement("card");
this.generateElements(data);
- this.e.style.left = "0px";
- this.e.style.top = "0px";
+ this.e.style.setProperty("--left", "0px");
+ this.e.style.setProperty("--top", "0px");
this.e.card = this;
this.id = id;
@@ -123,8 +123,16 @@ class Card {
resetPos()
{
- this.e.style.left = "0px";
- this.e.style.top = "0px";
+ this.e.style.setProperty("--left", "0px");
+ this.e.style.setProperty("--top", "0px");
+ }
+
+ resetPosInstant()
+ {
+ this.e.className = "instant";
+ this.e.style.setProperty("--left", "0px");
+ this.e.style.setProperty("--top", "0px");
+ this.e.className = "";
}
getDeck() {