diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-08-11 01:09:44 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-08-11 01:09:44 -0400 |
commit | 2e67661f0016874b7afbfeeb773401b94d5cefcd (patch) | |
tree | 2d29b2559a783cd986c4d5fcead47843e01d8270 /scripts/cards/card.js | |
parent | 5f7ffa76984da87c7b67be24f392a6ff50f5a8a2 (diff) |
Fix dragging for scaled cards
Diffstat (limited to 'scripts/cards/card.js')
-rw-r--r-- | scripts/cards/card.js | 16 |
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() { |