Getting Started with maker.js and Glitch #491
-
|
Hi maker.js team. I am trying to use maker.js but stuck at the very first place, loading the library. I have added a script tag in my HTML:
and tried to use the require function to get a reference inside the client-side JavaScript, I assume I need to use node.js, but as i am not familiar with node.js, Here is my current attempt on glitch. Any suggestions or pointers are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Hi @didny , thanks for asking, Glitch is really cool and I hope this helps others get started too.
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! |
Beta Was this translation helpful? Give feedback.
-
|
Thank you @danmarshall for the swift response and clear instructions. Now I have managed to get maker.js to draw basic drawings! This is Awesome! Thank you for creating great library! It opened up a lot of possibilities for me. Cheers! |
Beta Was this translation helpful? Give feedback.
-
|
Sadly, Glitch has been shut down... https://blog.glitch.com/post/goodbye-glitch |
Beta Was this translation helpful? Give feedback.

Hi @didny , thanks for asking, Glitch is really cool and I hope this helps others get started too.
hello-webpagein Glitchscript.jstag<div id="drawing"></div>, we will put svg in here instead of document.write()script.jsadd the following code:You can see my project here: https://glitch.com/edit/#!/husky-pollen-pharaoh
Hope this helps. Happy coding!