Created
June 6, 2016 07:49
-
-
Save lolocoo/bf6cb07866adb0e5fb3b12810d594c52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var time = 60000/360, init = 0, per = 2*Math.PI/360; | |
| var c=document.getElementById("myCanvas"); | |
| var ctx=c.getContext("2d"); | |
| ctx.beginPath(); | |
| ctx.arc(100,75,50,0,0*Math.PI); | |
| ctx.stroke(); | |
| function redrawCircle(){ | |
| init += per; | |
| ctx.clearRect(0,0,c.width,c.height); | |
| ctx.beginPath(); | |
| ctx.arc(100,75,50,0,init); | |
| ctx.stroke(); | |
| } | |
| setInterval(function(){ | |
| redrawCircle(); | |
| }, time); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment