You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
857 B

6 years ago
<html>
<head>
<script type="text/javascript" src="paper.js"></script>
<script type="text/javascript" src="baumgen.js"></script>
<style>
#canvas {
width: 1000;
height: 1000;
}
</style>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
console.log('ready');
var el = document.getElementById('download-svg');
console.log(el);
el.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';
a.href = svgdata;
document.body.appendChild(a);
a.click();
});
});
</script>
6 years ago
</head>
<body>
<button id="download-svg">download svg</button>
6 years ago
<canvas id="canvas" resize></canvas>
</body>
</html>