diff options
author | elioat <elioat@tilde.institute> | 2025-01-10 20:53:23 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2025-01-10 20:53:23 -0500 |
commit | a82654b7d043b85649a25a20c33baa42ecc35c29 (patch) | |
tree | f4598a1f3eea9bc6eef19472e8bd3b4f83888089 /html | |
parent | fc1c72a236ab3530d2ae151873accb55160ced44 (diff) | |
download | tour-a82654b7d043b85649a25a20c33baa42ecc35c29.tar.gz |
*
Diffstat (limited to 'html')
-rw-r--r-- | html/cards/script.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/html/cards/script.js b/html/cards/script.js index 3c6869c..9f11282 100644 --- a/html/cards/script.js +++ b/html/cards/script.js @@ -155,6 +155,11 @@ const handleMouseDown = e => { const clickedCard = gameState.cards.slice().reverse().find(card => isPointInCard(x, y, card)); if (clickedCard) { gameState.draggingCard = clickedCard; + + // Move the dragged card to the top of the stack + gameState.cards = gameState.cards.filter(card => card !== clickedCard); + gameState.cards.push(clickedCard); + document.addEventListener('mousemove', handleMouseMove); document.addEventListener('mouseup', handleMouseUp); } |