From fd83fcdaa0e26afd318119a89a46ddcc9e971dc7 Mon Sep 17 00:00:00 2001 From: Sverre Nystad Date: Sun, 11 Aug 2024 00:29:52 +0200 Subject: [PATCH] feat: Create and add ClearGridButton to homepage --- .../clearGridButton/ClearGridButton.css | 25 ++++++++++++++++++ .../clearGridButton/ClearGridButton.tsx | 26 +++++++++++++++++++ .../components/startButton/StartButton.css | 1 - frontend/src/pages/homePage/HomePage.tsx | 7 ++++- 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 frontend/src/components/clearGridButton/ClearGridButton.css create mode 100644 frontend/src/components/clearGridButton/ClearGridButton.tsx diff --git a/frontend/src/components/clearGridButton/ClearGridButton.css b/frontend/src/components/clearGridButton/ClearGridButton.css new file mode 100644 index 0000000..bc25498 --- /dev/null +++ b/frontend/src/components/clearGridButton/ClearGridButton.css @@ -0,0 +1,25 @@ +.clear-button-container { + display: flex; + justify-content: center; + margin-top: 20px; + +} + +.clear-button { + display: flex; + align-items: center; + justify-content: center; + margin: 0 10px; + width: 60px; + height: 60px; + border-radius: 50%; + border: none; + cursor: pointer; + background-color: var(--ss-blue-grotto); + +} + +.play-icon { + width: 100%; + height: 100%; + } \ No newline at end of file diff --git a/frontend/src/components/clearGridButton/ClearGridButton.tsx b/frontend/src/components/clearGridButton/ClearGridButton.tsx new file mode 100644 index 0000000..d5365fe --- /dev/null +++ b/frontend/src/components/clearGridButton/ClearGridButton.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import { resetGrid } from "../../services/animationService"; +import "./ClearGridButton.css"; + +const ClearGridButton: React.FC = () => { + return ( +
+ +
+ ); +} + +export default ClearGridButton; \ No newline at end of file diff --git a/frontend/src/components/startButton/StartButton.css b/frontend/src/components/startButton/StartButton.css index a08460e..ac5320c 100644 --- a/frontend/src/components/startButton/StartButton.css +++ b/frontend/src/components/startButton/StartButton.css @@ -2,7 +2,6 @@ display: flex; justify-content: center; margin-top: 20px; - width: 268px; } .start-button { diff --git a/frontend/src/pages/homePage/HomePage.tsx b/frontend/src/pages/homePage/HomePage.tsx index fc515b7..b4de4aa 100644 --- a/frontend/src/pages/homePage/HomePage.tsx +++ b/frontend/src/pages/homePage/HomePage.tsx @@ -14,6 +14,7 @@ import AlgorithmStepSlider from "../../components/algorithmStepSlider/AlgorithmS import GenerateObstacleButtons from "../../components/generateObstacleButtons/GenerateObstacleButtons"; import AlgorithmsMenu from "../../components/algorithmsMenu/AlgorithmsMenu"; import AnimationSpeedSlider from "../../components/animationStepSlider/AnimationSpeedSlider"; +import ClearGridButton from "../../components/clearGridButton/ClearGridButton"; export const mapSizeSliderSignal = signal(50); export const animationSpeed = signal(1); @@ -72,7 +73,11 @@ const HomePage = () => { - +
+ + +
+ );