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