An interactive gravity simulation built with React, TypeScript, and Vite. This project demonstrates particle physics interactions with gravitational forces in a web browser.
- Real-time gravity simulation
- Interactive particle creation
- Customizable gravity points with different masses
- Draggable gravity sources
- Debug visualization of forces and velocities
- Configurable physics parameters
- Particle trails
- Fullscreen mode
- React 18
- TypeScript
- Vite
- Ant Design
- Framer Motion
- Custom Physics Engine
- Paper.js
- Node.js (v16 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/react-gravity.git
cd react-gravity
- Install dependencies:
npm install
# or
yarn
- Start the development server:
npm run dev
# or
yarn dev
- Open your browser and navigate to
http://localhost:5173
- Click anywhere on the screen to create particles
- Drag the gravity points to influence particle movement
- Use the settings panel to adjust physics parameters
- Toggle debug visualizations for forces and velocities
- Use the star palette to create new gravity points
npm run build
# or
yarn build
The built files will be in the dist
directory.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.