Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- // glc.playOnce();
- glc.size(540, 540);
- glc.setDuration(2);
- glc.setFPS(30);
- glc.setMode("single");
- glc.styles.backgroundColor = "white";
- // glc.setEasing(false);
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- var rad = 150, num = 20, TWO_PI = Math.PI*2;
- var gradient = color.createRadialGradient(0, 0, 0, 0, 0, rad);
- gradient.addColorStop(1, "#304352");
- gradient.addColorStop(0, "#d7d2cc");
- // your code goes here:
- for (var i=0; i<num; i++) {
- var start = 360.0/num*i,
- end = 360.0/num*(i+1);
- var px = width/2 + Math.cos(TWO_PI/num*(i+0.5))*width*.8,
- py = height/2 + Math.sin(TWO_PI/num*(i+0.5))*height*.8;
- list.addCircle({
- x: [width/2,px],
- y: [height/2,py],
- radius: rad,
- rotation: [0,90],
- startAngle: start,
- endAngle: end,
- drawFromCenter: true,
- fillStyle: gradient,
- });
- }
- list.addCircle({
- x: width/2,
- y: height/2,
- radius: [0,rad],
- fillStyle: gradient
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement