Skip to content

Instantly share code, notes, and snippets.

@indriApollo
Last active September 2, 2019 19:57
Show Gist options
  • Save indriApollo/811fca3ce788c0dbf7c9688d862d5b47 to your computer and use it in GitHub Desktop.
Save indriApollo/811fca3ce788c0dbf7c9688d862d5b47 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="100" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
for(var x = 2; x < 300; x+=4) {
var y = 100-(Math.log(x)*17);
if(y < 1) y = 1;
ctx.rect(x, y, 1, 40-Math.log(x)*2.5);
}
ctx.stroke();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment