45 lines
876 B
HTML
45 lines
876 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Recursive tree</title>
|
|
<!-- <link rel="stylesheet" href="css/style.css"> -->
|
|
<style>
|
|
canvas {
|
|
background: #eee;
|
|
display: block;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
p { width: 800px; margin: 0 auto; }
|
|
ol { width: 800px; margin: 0 auto; }
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<section>
|
|
<h1 align="center">Recursive tree</h1>
|
|
<p>Reload the page to see another one.</p>
|
|
</section>
|
|
|
|
<canvas id="tree" width="1000" height="750"></canvas>
|
|
|
|
<section>
|
|
<p>Find out how this magick works at the <a href="https://gitea.djmil.dev/djmil/canva-tree">canvas-tree</a> repo.</p>
|
|
<p align="right">(c) djmil</p>
|
|
</section>
|
|
|
|
<script src="tree.js"></script>
|
|
|
|
<script>
|
|
var canvas = document.getElementById("tree");
|
|
ctx = canvas.getContext("2d");
|
|
tree(ctx, canvas.width/2, canvas.height, 200);
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|