I would like to have a partial arc around an image, and as the time goes the arc is getting smaller and smaller:
Any ideas? Thanks
Update
After seeing in the comments that people insist for introducing what effort I've made by myself in order to try to achieve that here's the code I wrote, but it was not the way I wanted it to be: HTML:
<div style="position:relative;">
<img style="position:absolute; width:100px; height:100px; border-radius:50%;left:50px;top:50px;" src="http://iv1.lisimg.com/image/522888/408full-adriana-lima.jpg" />
<canvas id="myCanvas" style="background-color:red;" width="500" height="500"></canvas>
JS:
var imgSurrounder = function () {
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(100, 100, 50, 0, 2 * Math.PI);
ctx.lineWidth = 30;
ctx.strokeStyle = "#000";
ctx.stroke();
ctx.lineWidth = 40;
var j = 0;
var i = 0;
var num = 50;
var s = 0;
var step = 2 * Math.PI / num;
var e = (i + 1) * step;
var drawStroke = function () {
//console.log(j++);
ctx.beginPath();
ctx.arc(100, 100, 50, s, e);
ctx.strokeStyle = "#fff";
ctx.stroke();
i++;
if (i === num) {
return;
}
s = e - 0.5 * step;
e = (i + 1) * step;
setTimeout(drawStroke, 1000);
}
setTimeout(drawStroke, 10);
}
},
The results was:
But you can see that it's not so clean an neat. In addition, if such profile images are spread closely to each other the rectangular canvas is not so convenient to draw in. I was feeling that I'm not doing it in the right way and that there was a better way.
But I don't know if I really should write all this stuff in the question because I'm afraid that people won't read it because it's too long and then I'll be stuck with no answer as I a few questions. Therefore I felt that it isn't relevant at all to show all my trials here in order to not make my question dirty and keep it clean and focused.
Again, if those are the rules her so of course I respect it. Thanks anyway