Advertisement
xeromino

arcs

Dec 23rd, 2015
350
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.5);
  6.     glc.setFPS(40);
  7.     glc.setMode("single");
  8.     // glc.setEasing(false);
  9.    
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color,
  14.         ox = width/2,
  15.         oy = height/2,
  16.         TWO_PI = Math.PI*2;
  17.  
  18.     // your code goes here:
  19.  
  20.     var num = 20;
  21.    
  22.     for (var i=0; i<num; i++) {
  23.         var rad = 25+i*10
  24.             offSet = Math.random()*360,
  25.             end = 45+Math.random()*90;
  26.         list.addCircle({
  27.             x:ox,
  28.             y:oy,
  29.             radius: rad,
  30.             lineWidth:25,
  31.             rotation: i%2===0?[offSet,offSet+360]:[offSet,offSet-360],
  32.             startAngle: 0,
  33.             endAngle: end,
  34.             strokeStyle: i%3===0?"white":"black",
  35.             fill: false,
  36.             stroke: true,
  37.             phase: i/num,
  38.             lineCap: "square"
  39.         });  
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement