Skip to content

Commit

Permalink
New responsive version
Browse files Browse the repository at this point in the history
  • Loading branch information
Im-Rises committed Sep 17, 2023
1 parent c639596 commit 1be7a78
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 140 deletions.
180 changes: 171 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"preview": "vite preview"
},
"dependencies": {
"nbody-simulator-react-barnes-hut-react-p5": "0.5.7",
"nbody-simulator-react-barnes-hut-react-p5": "0.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.67.0"
Expand Down
20 changes: 13 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ function App() {
const [particleMass, setParticleMass] = useState(1);

return (
<>
<h1>Barnes-Hut N-Body simulation</h1>
<NbodySimulatorBarnesHut particlesCount={count} widthHeight={500} showQuadtree={false} maxDepth={maxDepth}
theta={theta} G={G} softening={softening} capacity={capacity}
particleMass={particleMass}
backgroundColor={new Color(100, 100, 100)}/>
<div className={'app-panel'}>
<h1 className={'title-app'}>Barnes-Hut N-Body simulation</h1>
<div className={'nbody-simulator-canvas-holder'}>
<NbodySimulatorBarnesHut particlesCount={count} widthHeight={500} showQuadtree={false}
maxDepth={maxDepth}
theta={theta} G={G} softening={softening} capacity={capacity}
particleMass={particleMass}
backgroundColor={new Color(100, 100, 100)}
divStyle={"width:100%; height:50vh; align-items:center; justify-content:center; display:flex;"}
canvasStyle={"object-fit:contain; max-width:90%; max-height:90%;"}
/>
</div>
<div className={'input-simulation-holder'}>
<div>
<label htmlFor={'input-particles-count'}>Particles count : </label>
Expand Down Expand Up @@ -91,7 +97,7 @@ function App() {
}}/>
</div>
</div>
</>
</div>
)
}

Expand Down
Loading

0 comments on commit 1be7a78

Please sign in to comment.