JSFiddle - React, Tailwind, and code Playground
by chandings
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.4/raphael-min.js"></script>
<div id="clock_id"></div>
JavaScript
var hour_hand;
var minute_hand;
var second_hand;
var hours = 1;
var minutes = 1;
var seconds = 1;
var milliseconds = 0;
var pendulum;
function getRandomColor() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function draw_clock(){
canvas = Raphael("clock_id",200, 600);
//var clock = canvas.circle(100,100,95);
//clock.attr({"stroke":"#000000","stroke-width":"0"})
var color = {r:0, g:0, b:0}
for(var index = 1; index < 20; index++){
var circle = canvas.circle(100,100,((95/index) + 95/(index + 1))/2);
circle.attr({"stroke":getRandomColor(),"stroke-width":""+ ((95/index) - 95/(index + 1))*2/3})
}
//canvas.image("http://anthony.liekens.net/images/dial.jpg", 0, 0, 200, 200);
// canvas.image("http://www.polyvore.com/cgi/img-thing?.out=jpg&size=l&tid=37689959", 0, 0, 200, 200);
...