Advertisement
xeromino

blinds

Dec 7th, 2015
508
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.styles.backgroundColor = "black";
  8.     // glc.setMode("single");
  9.     // glc.setEasing(false);
  10.    
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h,
  14.         color = glc.color,
  15.         ox = width/2,
  16.         oy = height/2,
  17.         TWO_PI = Math.PI*2;
  18.  
  19.     // your code goes here:
  20.  
  21.     var num = 25,
  22.         palette = ["#2D4059", "#EA5455", "#F07B3F", "#FFD460"];
  23.    
  24.     for (var i=0; i<num; i++) {
  25.         var edge = 150,
  26.             s = Math.floor(Math.random()*4),
  27.             y = edge + (height-edge*2)/num*i;
  28.         list.addLine({
  29.             x0: edge,
  30.             y0: y,
  31.             x1: width-edge,
  32.             y1: y,
  33.             lineWidth: [1,8],
  34.             strokeStyle: palette[s],
  35.             lineCap: "butt",
  36.             phase: i/num,
  37.         });
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement