|
|
|
@ -12,10 +12,13 @@
@@ -12,10 +12,13 @@
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
|
console.log('ready'); |
|
|
|
|
var el = document.getElementById('download-svg'); |
|
|
|
|
console.log(el); |
|
|
|
|
el.addEventListener('click', function() { |
|
|
|
|
draw(); |
|
|
|
|
|
|
|
|
|
document.getElementById('redraw').addEventListener('click', function() { |
|
|
|
|
draw(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
document.getElementById('download-svg').addEventListener('click', function() { |
|
|
|
|
var svgdata = 'data:image/svg+xml;utf8,' + encodeURIComponent(paper.project.exportSVG({asString: true})); |
|
|
|
|
var a = document.createElement('a'); |
|
|
|
|
a.download = 'baumgen.svg'; |
|
|
|
@ -28,6 +31,7 @@ document.addEventListener('DOMContentLoaded', function() {
@@ -28,6 +31,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
|
|
|
|
|
</head> |
|
|
|
|
<body> |
|
|
|
|
<button id="redraw">redraw</button> |
|
|
|
|
<button id="download-svg">download svg</button> |
|
|
|
|
<canvas id="canvas" resize></canvas> |
|
|
|
|
</body> |
|
|
|
|