diff --git a/package-lock.json b/package-lock.json index 3e8e3f2..30b8513 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,8 @@ "framer-motion": "^11.11.11", "lodash": "^4.17.21", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "react-icons": "^5.3.0" }, "devDependencies": { "@chromatic-com/storybook": "^3.2.2", @@ -7591,6 +7592,15 @@ "react": "^18.3.1" } }, + "node_modules/react-icons": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.3.0.tgz", + "integrity": "sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==", + "license": "MIT", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -14359,6 +14369,12 @@ "scheduler": "^0.23.2" } }, + "react-icons": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.3.0.tgz", + "integrity": "sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==", + "requires": {} + }, "react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", diff --git a/package.json b/package.json index 71ec5cc..6fa0f95 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "framer-motion": "^11.11.11", "lodash": "^4.17.21", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "react-icons": "^5.3.0" }, "devDependencies": { "@chromatic-com/storybook": "^3.2.2", diff --git a/src/components/GravitySimulator/GravitySimulator.tsx b/src/components/GravitySimulator/GravitySimulator.tsx index ec876b8..3d690f5 100644 --- a/src/components/GravitySimulator/GravitySimulator.tsx +++ b/src/components/GravitySimulator/GravitySimulator.tsx @@ -17,6 +17,9 @@ import { SimulatorSettings } from "../SimulatorSettings/SimulatorSettings"; import { useSettings } from "../../hooks/useSettings"; import { throttle } from "lodash"; import "../../styles/global.scss"; +import { MdFullscreen, MdFullscreenExit } from "react-icons/md"; +import { BiReset } from "react-icons/bi"; +import { motion } from "framer-motion"; interface ParticleMechanics { position: Point2D; @@ -367,65 +370,46 @@ export const GravitySimulator: React.FC = ({
- - - + {isFullscreen ? ( + + ) : ( + + )} +
= ({ onClick={handleButtonClick} className="floating-panel floating-button" style={{ + position: "absolute", bottom: 20, right: 20, }} diff --git a/src/styles/theme.scss b/src/styles/theme.scss index 359a173..93cb17f 100644 --- a/src/styles/theme.scss +++ b/src/styles/theme.scss @@ -11,7 +11,6 @@ .floating-button { width: 40px; height: 40px; - position: absolute; border-radius: 10px; cursor: pointer; display: flex;