diff --git a/script.js b/script.js index 0985096..6d2b33e 100644 --- a/script.js +++ b/script.js @@ -540,18 +540,7 @@ $cfs.addEventListener("dragstart", (e) => { e.target.classList.add("dragging"); const incomingCf = e.target.dataset.cf; - const incomingIdx = Number(e.target.dataset.position); - const incomingJp = getJP(incomingCf); - - // Set data JSON - e.dataTransfer.setData( - "text/plain", - JSON.stringify({ - incomingCf, - incomingIdx, - incomingJp, - }) - ); + e.dataTransfer.setData("text/plain", incomingCf); $cfs.querySelectorAll(`[draggable]`).forEach(($scf) => { if ($scf === e.target) return; @@ -585,8 +574,7 @@ $cfs.addEventListener("drop", (e) => { e.stopPropagation(); if (!e.target.classList.contains("droppable")) return; - const data = JSON.parse(e.dataTransfer.getData("text/plain")); - const { incomingCf, incomingIdx } = data; + const incomingCf = e.dataTransfer.getData("text/plain"); const newType = calculateNewTypeAfterSwap( incomingCf, diff --git a/style.css b/style.css index 1d91da9..af3f315 100644 --- a/style.css +++ b/style.css @@ -166,16 +166,16 @@ body { translate: 0 0; } 25% { - translate: -5px 0; + translate: -10px 0; } 50% { - transform: 0 0; + translate: 0 0; } 75% { - transform: 5px 0; + translate: 10px 0; } 100% { - transform: 0 0; + translate: 0 0; } } @@ -185,7 +185,7 @@ body { .cf.droppable { opacity: 0.6; - animation: shake 0.2s ease-in-out infinite; + animation: shake 1s ease-in-out infinite; } .cf.droppable > * {