HTML Canvas Clock
home
Run
screen_rotation
fullscreen
cloud_download
navigate_next
<!DOCTYPE html> <html> <body> <canvas id="clock-canvas" width="700" height="700" style="background-color:red"> </canvas> <script> var clockCanvas = document.getElementById("clock-canvas"); var ctx = clockCanvas.getContext("2d"); var radius = clockCanvas.height / 2; ctx.translate(radius, radius); radius = radius * 0.90 drawMyClock(); function drawMyClock() { ctx.arc(0, 0, radius, 0 , 2*Math.PI); ctx.fillStyle = "white"; ctx.fill(); } </script> </body> </html>
<!DOCTYPE html> <html> <body> <canvas id="clock-canvas" width="700" height="700" style="background-color:red"> </canvas> <script> var clockCanvas = document.getElementById("clock-canvas"); var ctx = clockCanvas.getContext("2d"); var radius = clockCanvas.height / 2; ctx.translate(radius, radius); radius = radius * 0.90 drawMyClock(); function drawMyClock() { ctx.arc(0, 0, radius, 0 , 2*Math.PI); ctx.fillStyle = "white"; ctx.fill(); } </script> </body> </html>
Copyrights@tutorialsplane.com