Advertisement
eriknau

25days-12

Dec 12th, 2015
102
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(2);
  5.     glc.setFPS(18);
  6.     glc.setMode("single");
  7.     // glc.setEasing(false);
  8.     glc.setMaxColors(40);
  9.    var r = 100, g = 0, b = 0;
  10.     glc.styles.backgroundColor = "rgba("+r+","+g+","+b+",0.2)";
  11.     // glc.styles.backgroundColor = "black";
  12.     var list = glc.renderList,
  13.         width = glc.w,
  14.         height = glc.h,
  15.         color = glc.color;
  16.     var rad = 92, sideLen = 80, shapeHt = 69;
  17.         rad*=2;
  18.         sideLen*=2;
  19.         shapeHt*=2;
  20.     for (var i = 0; i < height+50; i+=shapeHt) {
  21.         for (var j = 0; j < width+50; j+=sideLen) {
  22.             if(i % (shapeHt*2) === 0) {
  23.                 var xpos = j+(sideLen/2);
  24.             } else {
  25.                 var xpos = j;
  26.             }
  27.  
  28.             list.addPoly({
  29.                 sides: 6,
  30.                 x: xpos+40,
  31.                 y: i+60,
  32.                 fill: false,
  33.                 stroke: true,
  34.                 strokeStyle: "white",
  35.                 lineWidth: 2,
  36.                 radius: rad,
  37.                 rotation: [30,-30],
  38.                 phase: i*0.06
  39.             })
  40.         };
  41.     };
  42.     for (var i = 0; i < height+50; i+=shapeHt) {
  43.         for (var j = 0; j < width+50; j+=sideLen) {
  44.             if(i % (shapeHt*2) === 0) {
  45.                 var xpos = j+(sideLen/2);
  46.             } else {
  47.                 var xpos = j;
  48.             }
  49.  
  50.             list.addPoly({
  51.                 sides: 6,
  52.                 x: xpos+40,
  53.                 y: i+60,
  54.                 fill: false,
  55.                 stroke: true,
  56.                 strokeStyle: "white",
  57.                 lineWidth: 2,
  58.                 radius: rad,
  59.                 rotation: [-30,30],
  60.                 phase: i*0.06
  61.  
  62.             })
  63.         };
  64.     };
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement