eriknau

25Days-4

Dec 4th, 2015
107
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(350, 350);
  4.     glc.setDuration(4);
  5.     glc.setFPS(20);
  6.     // glc.setMode("single");
  7.     // glc.setEasing(false);
  8.     glc.setMaxColors(20);
  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.     // list.addRect({
  17.     //     x: width/2,
  18.     //     y: height/2,
  19.     //     w: width,
  20.     //     h: height,
  21.     //     fillStyle: ["red","yellow"]
  22.     // })
  23.  
  24.     var num=15;
  25.     for (var k = 0; k < 5; k++) {
  26.          for(var j=0;j<5;j++){
  27.                 var offset1 = Math.random() * 300 - 150;
  28.                 var offset2 = Math.random() * 300 - 150;
  29.                 var y = 60 + 40 * (k+1)+ verticalOffset;
  30.             for (var i=0; i<num; i++) {
  31.                 var verticalOffset = Math.random() * 30 - 15;
  32.                 var x = 60 +40 * j + 3*(i+1);
  33.                 list.addLine({
  34.                     lineWidth: 1,
  35.                     strokeStyle: ["yellow","red"],
  36.                     x0: x,
  37.                     y0: y,
  38.                     x1: [x + offset1, x + offset2],
  39.                     y1: [y + offset1, y - offset2],
  40.                     phase: i*0.01
  41.                 });
  42.             }  
  43.         };
  44.     }
  45.  }
Advertisement
Add Comment
Please, Sign In to add comment