From 9e06365730743905698b87a4d90295f7b662f997 Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Fri, 19 Jul 2024 21:32:20 +0200 Subject: [PATCH] Update z-index & initial ball pos --- mr/index-flex/flex.css | 2 ++ mr/index-flex/flex.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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);