boardgame icon indicating copy to clipboard operation
boardgame copied to clipboard

Some kind of visual representation of shuffling in client

Open jkomoros opened this issue 7 years ago • 6 comments

Animation wise there's not TOO much we can do becuase we don't know which card is which. But if we know the stack was shuffled we should show SOME visual cue, even if we just map random cards to each other for the purposes of that one animation.

(How hard will it be to figure out that what happened to a stack was a shuffle?)

jkomoros avatar Jun 03 '17 16:06 jkomoros

Originally captured (ish) in #348

jkomoros avatar Jun 03 '17 16:06 jkomoros

Even just an animation where the cards split even/odd to the left and right and then recombine is fine.

jkomoros avatar Jun 04 '17 17:06 jkomoros

These animations should be captured as an external transform coming from the stack

jkomoros avatar Oct 20 '18 19:10 jkomoros

Actually, the best way to do it is to have two css animations set up for the outer in a card stack: shuffle-left and shuffle-right. If the deck shuffles, then instead of transforming from last location to this one, instead apply shuffle-left (repeat-count might be multiple), then when it's done remove that class and fire transitionend. (It;'s actually animationend, which is easier: https://developer.mozilla.org/en-US/docs/Web/Events/animationend?)

Will need some way of detecting that a stack has been shuffled, e.g. with a shuffle count?

jkomoros avatar Oct 30 '18 01:10 jkomoros

Stacks grow ShuffleCount() int which increments every time Shuffle or SecretShuffle is called on them. It's included in JSON output, although in stack sanitization it's zero'd out for anything other than PolicyVisible, PolicyOrder, PolicyLen (add a column to the Sanitization Policy reference table)

jkomoros avatar Oct 31 '18 18:10 jkomoros

  • [x] ShuffleCount() int on stacks that goes up with each shuffle and is round-tripped through json.
  • [x] ShuffleCount() is zero-ed out for PolicyNonEmpty PolicyHidden (update the sanitization documentation table)
  • [x] ShuffleCount should not be omitempty
  • [ ] In debugAnimations, remove ShuffleCount manually and use the actual shuffle count (maybe not worth it, because I believe that is testing a move that happens after a shuffle)
  • [ ] If shuffleCount goes up for a stack and the Ids change, don't do any animation
  • [ ] Cards in a stack get set with a left/right property (or, we can just have a selector that is .shuffling [card: even] or whatever)
  • [ ] If the shuffleCount goes up on a stack, do the shuffle animation
  • [ ] Ensure shuffling of tokens works too

jkomoros avatar Nov 03 '18 17:11 jkomoros