- No third-part libraries for physics are used.
- A rectangular canvas field is initially filled with a random set of balls of a different size and color.
- The user can push a ball if he/she holds the left button of a mouse and touches the ball.
- The pushed ball elastically collides with the other balls on the canvas and with the borders of the canvas losing its velocity.
- The user can change a color of the ball with a context menu if he/she right-clicks a mouse on this ball.
React
•TypeScript
•Tailwind
Canvas
git clone https://github.com/mirzaianov/test-balls-canvas.git
cd test-balls-canvas
npm i
npm run dev
Vite will start frontend server on http://localhost:5173/
https://todo-mirzaianov.vercel.app/
You can use the code, but I ask you do not copy this site without giving me credit.