eriknau

25Days-3

Dec 3rd, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     glc.size(400, 400);
  4.     glc.setDuration(3);
  5.     // glc.setFPS(20);
  6.     // glc.setMode("single");
  7.     // glc.setEasing(false);
  8.     glc.setMaxColors(10);
  9.     glc.styles.backgroundColor = "black";
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color;
  14.  
  15.     // your code goes here:
  16.     var num=20;
  17.     for (var k = 0; k < 7; k++) {
  18.          for(var j=0;j<7;j++){
  19.             for (var i=0; i<num; i++) {
  20.                 var offset1 = Math.random() * 300 - 150;
  21.                 var offset2 = Math.random() * 300 - 150;
  22.                 var verticalOffset = Math.random() * 30 - 15;
  23.                 var x = 40 +40 * j + 4*(i+1);
  24.                 var y = 40 + 40 * (k+1); // + verticalOffset
  25.                 list.addLine({
  26.                     lineWidth: 1,
  27.                     strokeStyle: "white",
  28.                     // var x =
  29.                     x0: x,
  30.                     y0: y,
  31.                     x1: [x + offset1, x + offset2],
  32.                     y1: [y + offset1, y - offset2]
  33.                     // phase: num*0.1
  34.                 });
  35.             }  
  36.         };
  37.     }
  38.  }
Advertisement
Add Comment
Please, Sign In to add comment