From 568e1b0c3ab4ee121cad218782f2181be044d2eb Mon Sep 17 00:00:00 2001 From: Aaron Chan <42254254+aaronchan32@users.noreply.github.com> Date: Sat, 6 Apr 2024 16:47:21 -0700 Subject: [PATCH] fix: add random rotation to all asteroids --- src/components/Asteroid/Asteroid.scss | 1 - src/components/Asteroid/Asteroid.tsx | 9 +-------- src/components/Asteroid/asteroidLogic.ts | 3 ++- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/Asteroid/Asteroid.scss b/src/components/Asteroid/Asteroid.scss index 1d70976..7da9be1 100644 --- a/src/components/Asteroid/Asteroid.scss +++ b/src/components/Asteroid/Asteroid.scss @@ -29,6 +29,5 @@ position: absolute; top: -26px; left: -15px; - width: 5rem; } } diff --git a/src/components/Asteroid/Asteroid.tsx b/src/components/Asteroid/Asteroid.tsx index 824dd0a..1aa3be9 100644 --- a/src/components/Asteroid/Asteroid.tsx +++ b/src/components/Asteroid/Asteroid.tsx @@ -169,14 +169,7 @@ export default function Asteroid({ homeRef }: AsteroidProps) { style={{ scale: index === 0 ? 1 : scale }} > - {index === 0 && ( -

- Click Me ! -

- )} + {index === 0 &&

Click Me !

} ) ) diff --git a/src/components/Asteroid/asteroidLogic.ts b/src/components/Asteroid/asteroidLogic.ts index 4418822..7c250e8 100644 --- a/src/components/Asteroid/asteroidLogic.ts +++ b/src/components/Asteroid/asteroidLogic.ts @@ -90,7 +90,8 @@ export default function asteroidLogic({ window.innerHeight * 0.75 + Math.random() * (window.innerHeight * 0.25), window.innerHeight - 35 - ) + ), + rotate: Math.random() * 360 }; } };