@johnmorrisdotca/fuda-cards 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -351,9 +351,10 @@ export class FudaCollection extends HTMLElement {
|
|
|
351
351
|
}
|
|
352
352
|
/** The card that just moved flies between the two piles, turning over sideways on the way if it lands face down. The same element, so the card is never drawn twice. An open fan sends the card from where the fan holds it. */
|
|
353
353
|
playFlip(direction, v, ms) {
|
|
354
|
+
// Either pile may be an empty dashed slot (the last card put back leaves the pile empty): the card still flies the same distance, from where the pile was.
|
|
354
355
|
const deck = v.querySelector('.deck-pile'), discard = v.querySelector('.discard-pile');
|
|
355
356
|
const moved = direction === 'off' ? discard?.querySelector('.card.top') : deck?.querySelector('.card.top');
|
|
356
|
-
if (!moved
|
|
357
|
+
if (!moved)
|
|
357
358
|
return;
|
|
358
359
|
const style = getComputedStyle(v), w = parseFloat(style.getPropertyValue('--w')) || 200, gap = parseFloat(style.getPropertyValue('--gap')) || 56, fr = parseFloat(v.style.getPropertyValue('--fr')) || 0;
|
|
359
360
|
const dx = (1 + fr) * w + gap, dy = 0;
|