Skip to content
Discussion options

You must be logged in to vote

Hi @didny , thanks for asking, Glitch is really cool and I hope this helps others get started too.

  1. Let's skip the node.js stuff for now, and just start with hello-webpage in Glitch
  2. Add the Maker.js script tag before the script.js tag
  3. Add a div to the html page: <div id="drawing"></div>, we will put svg in here instead of document.write()
  4. In script.js add the following code:
var drawingDiv = document.getElementById("drawing");
const makerjs = require("makerjs");
const model = new makerjs.models.Star(5, 100)
drawingDiv.innerHTML = makerjs.exporter.toSVG(model);

You can see my project here: https://glitch.com/edit/#!/husky-pollen-pharaoh

Hope this helps. Happy coding!

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by danmarshall
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants