igravitystudios / matchimals.fun

🦁 🃏 📱 An animal matching puzzle card game– built with turn-based game engine boardgame.io and React-Native + React-Native-Web
https://www.matchimals.com
MIT License
168 stars 32 forks source link

Scroll window to center card #14

Closed chrisheninger closed 6 years ago

chrisheninger commented 6 years ago

On initial game load, the window should scroll to put the center card in the middle of the viewport.

This will be a temporary/simple fix to #9 and other viewport/zooming related issues.

chrisheninger commented 6 years ago

Fixed in https://github.com/chrisheninger/matchimals.fun/commit/1b04547e827362cef2955dc33ef1edb91bddb68b using the https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView API (today-i-learned!)