Skip to content

Instantly share code, notes, and snippets.

@ayhansipahi
Created April 7, 2015 08:07
Show Gist options
  • Save ayhansipahi/c128ae18cc507f69e87a to your computer and use it in GitHub Desktop.
Save ayhansipahi/c128ae18cc507f69e87a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="400" height="400" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
setInterval(function(){
var d = new Date().getSeconds();
console.log(d);
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.moveTo(150, 150);
ctx.bezierCurveTo(130, 130, 200,200, Math.sin(d*3)*100+150, Math.cos(d*3)*100+150);
ctx.stroke();
},1000);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment