cubing.js icon indicating copy to clipboard operation
cubing.js copied to clipboard

Dim other vantage(s) when dragging a vantage

Open lgarron opened this issue 4 years ago • 0 comments

Visit https://alpha.twizzle.net/explore/ and drag the right vantage while looking at the left. The horizontal movement matches, but the vertical doesn't.

We can dim (e.g. reduce opacity) the left while the right is moving (and vice-versa) to make clear which one your cursor is mapped to.

Note: It's quite possible to be dragging both at once on a touch screen device. In that case, it's okay not to dim either one. Also note that we could theoretically support more than 2 vantages for the same player. It should be easy to account for that.

Rough approach:

  • Create a prop to track whether any drag is active..
  • In each vantage:
    • Track when a drag is active.
    • When toggling between any vs. no active drags, set it in the prop. (This is probably best handled in the DragTracker by calculating when the drag info map is empty, and sending that info to the vantage via listeners.)
    • Add a listener to dim itself if there is an active drag for the model but not currently for this vantage.

lgarron avatar Jan 07 '22 02:01 lgarron