1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| let paper = Raphael('view', 400, 200);
let circle1 = paper.circle(50, 50, 30).attr({fill: 'white'});
let anim1 = Raphael.animation({fill: 'red'}, 500);
anim1 = anim1.repeat(Infinity);
anim1 = anim1.delay(1000); circle1.animate(anim1);
let circle2 = paper.circle(150, 50, 30).attr({fill: 'white'}); circle2.click(function (event, x, y) { if (circle2.attr("fill") === 'white') { circle2.animate({fill: 'red'}, 500, "liner", function () { console.log("Animation end callback"); }); } else { circle2.animate({fill: 'white'}, 500); } });
let circle3 = paper.circle(250, 50, 1).attr({fill: 'white'}); let anim3 = Raphael.animation({r: 30}, 1000).repeat(Infinity); circle3.animate(anim3);
let circle4 = paper.circle(320, 50, 30).attr({fill: 'white'}); let anim4 = Raphael.animation({cx: 370}, 1000).repeat(Infinity); circle4.animate(anim4);
let anim5 = Raphael.animation({cy: 190}, 1000, "linear"); paper.circle(10, 110, 10).attr({fill: 'white'}).animate(anim5);
let anim6 = Raphael.animation({cy: 190}, 1000, "<"); paper.circle(30, 110, 10).attr({fill: 'white'}).animate(anim6);
let anim7 = Raphael.animation({cy: 190}, 1000, ">"); paper.circle(50, 110, 10).attr({fill: 'white'}).animate(anim7);
let anim8 = Raphael.animation({cy: 190}, 1000, "<>"); paper.circle(70, 110, 10).attr({fill: 'white'}).animate(anim8);
let anim9 = Raphael.animation({cy: 190}, 1000, "backIn"); paper.circle(90, 110, 10).attr({fill: 'white'}).animate(anim9);
let anim10 = Raphael.animation({cy: 190}, 1000, "backOut"); paper.circle(110, 110, 10).attr({fill: 'white'}).animate(anim10);
let anim11 = Raphael.animation({cy: 190}, 1000, "elastic"); paper.circle(130, 110, 10).attr({fill: 'white'}).animate(anim11);
let anim12 = Raphael.animation({cy: 190}, 1000, "bounce"); paper.circle(150, 110, 10).attr({fill: 'white'}).animate(anim12);
paper.circle(170, 110, 10).attr({fill: 'white'}).animate({cy: 190}, 1000).animate({fill: 'red'}, 1000);
let anim13 = Raphael.animation({transform: 't100,0r90s2,1'}, 1000).repeat(Infinity); paper.circle(190, 110, 10).attr({fill: 'white'}).animate(anim13);
|