swordbattle.io
swordbattle.io copied to clipboard
Ad is not horizontally centered in GameResults modal
The ad on the Game Results or end screen isn't always horizontally centered. I've narrowed down the issue to this part of the code added in #23 :
https://github.com/codergautam/swordbattle.io/pull/23/commits/32e0d03e271a7515645f96605b4fe3cd95a42b16#diff-f2286f8bf2376694d9c87b819c26cc746048c6c82427ac6036418b9cf48389a3R56
Sometimes Adinplay serves ads smaller than the one we requested, for example a 728x90 when requesting a 970x90 ad. We need an accurate way of determining what the size of the ad being served is, so that it can be centered properly.
Hey , Can't we use mutation observer. And center the ad horizontally.