Advertisement
xeromino

burst

Nov 25th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     // glc.playOnce();
  4.     glc.size(540, 540);
  5.     glc.setDuration(2);
  6.     glc.setFPS(30);
  7.     glc.setMode("single");
  8.     glc.styles.backgroundColor = "white";
  9.     // glc.setEasing(false);
  10.    
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h,
  14.         color = glc.color;
  15.    
  16.     var rad = 150, num = 20, TWO_PI = Math.PI*2;
  17.    
  18.     var gradient = color.createRadialGradient(0, 0, 0, 0, 0, rad);
  19.     gradient.addColorStop(1, "#304352");
  20.     gradient.addColorStop(0, "#d7d2cc");
  21.  
  22.     // your code goes here:
  23.     for (var i=0; i<num; i++) {
  24.         var start = 360.0/num*i,
  25.             end = 360.0/num*(i+1);
  26.         var px = width/2 + Math.cos(TWO_PI/num*(i+0.5))*width*.8,
  27.             py = height/2 + Math.sin(TWO_PI/num*(i+0.5))*height*.8;
  28.         list.addCircle({
  29.             x: [width/2,px],
  30.             y: [height/2,py],
  31.             radius: rad,
  32.             rotation: [0,90],
  33.             startAngle: start,
  34.             endAngle: end,
  35.             drawFromCenter: true,
  36.             fillStyle: gradient,
  37.  
  38.         });
  39.     }
  40.    
  41.     list.addCircle({
  42.         x: width/2,
  43.         y: height/2,
  44.         radius: [0,rad],
  45.         fillStyle: gradient
  46.    
  47.     });
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement