A web application that allows you to draw shapes on a canvas and automatically generates the corresponding JavaScript canvas code.
Check out the live demo at astrocrash.net/canvasdoodle
- Interactive Drawing Tools:
- Rectangle
- Circle
- Line
- Arc
- Styling Options:
- Stroke color
- Fill color (with option to disable)
- Line thickness
- Background color (with transparent option)
- Canvas Management:
- Resize drawing canvas
- Undo functionality
- Clear canvas
- Code Generation:
- Real-time JavaScript canvas code generation
- Copy code to clipboard
- Preview:
- Adjustable target dimensions
- Preview canvas
- Node.js
-
Clone the repository:
git clone <repository-url> cd canvasdoodle -
Install dependencies:
npm install -
Start the server:
npm start -
Open your browser and navigate to:
http://localhost:3000
- Select a drawing tool (Rectangle, Circle, Line, or Arc)
- Customize your shape with the available styling options
- Draw on the canvas by clicking and dragging
- View the generated JavaScript code in the right panel
- Adjust the target dimensions to see how your drawing would look at different sizes
- Copy the generated code to use in your own projects
index.html- Main HTML structurestyles.css- CSS stylingscript.js- Main JavaScript functionality for drawing and code generationserver.js- Simple Node.js server
This project is licensed under the ISC License.