From 2e67661f0016874b7afbfeeb773401b94d5cefcd Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 11 Aug 2022 01:09:44 -0400 Subject: Fix dragging for scaled cards --- scripts/cards/card.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'scripts/cards/card.js') 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() { -- cgit v1.2.3