diff --git a/mr/index-flex/flex.css b/mr/index-flex/flex.css index 0c1d73b..31f456a 100644 --- a/mr/index-flex/flex.css +++ b/mr/index-flex/flex.css @@ -12,6 +12,7 @@ background-color: red; padding:10px; align-self: stretch; + z-index: 1000; } .mrFlexBall { @@ -19,4 +20,5 @@ height: 50px; border-radius: 50%; background-color: blue; + z-index: 1000; } diff --git a/mr/index-flex/flex.js b/mr/index-flex/flex.js index 66c3e43..0e1be88 100644 --- a/mr/index-flex/flex.js +++ b/mr/index-flex/flex.js @@ -47,8 +47,8 @@ class Flex { const BALL_SIZE = 50; - let ballPosX = 100; - let ballPosY = 500; + let ballPosX = window.visualViewport.width / 2 - BALL_SIZE / 2; + let ballPosY = window.visualViewport.height - BALL_SIZE - 100; let collidableElements = document.querySelectorAll("img"); console.log(collidableElements);