benjmcguire / simple-svg-editor

js experiment

Home Page:https://benjmcguire.github.io/simple-svg-editor/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple SVG Editor

This code defines an SVG canvas element and three buttons that allow the user to add circles, rectangles, or clear the canvas. When the user clicks the "Add Circle" button, the addCircle() function creates a new <circle> element with a random position and a blue fill color, and appends it to the canvas. When the user clicks the "Add Rectangle" button, the addRect() function creates a new <rect> element with a random position and a red fill color, and appends it to the canvas. When the user clicks the "Clear Canvas" button, the clearCanvas() function removes all child elements from the canvas. You can modify the code to add more shapes or editing functions as desired.

About

js experiment

https://benjmcguire.github.io/simple-svg-editor/


Languages

Language:HTML 100.0%