This is a simple React application with TypeScript built using Vite, allowing users to create draggable shapes and draw lines between them.
You can view the deployed app at https://heavy-drag-n-drop.netlify.app/.
- Double-click to create a circle with a random size (between 30px and 80px) and color.
- Right-click on a circle to toggle between a circle and a square shape. Squares are not draggable.
- Click on two circles to create a line between them.
- Drag circles to move them around. Lines adjust their position accordingly.
- Lines move along with the connected circles. Squares and lines between squares are not draggable.
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd drag-and-drop-shapes
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5173/
. -
Double-click to create shapes, right-click to toggle between circle and square, and click on two circles to draw lines between them. Drag shapes to move them around.
- React
- TypeScript
- Vite
- HTML5
- CSS3