eriknau

25Days-17

Dec 17th, 2015
93
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(200, 300);
  4.     glc.setDuration(4);
  5.     glc.setFPS(20);
  6.     // glc.setMode("single");
  7.     // glc.setEasing(false);
  8.     glc.setMaxColors(200);
  9.     glc.setQuality(1);
  10.         glc.styles.backgroundColor = "rgba(30,30,30,1)";
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h,
  14.         color = glc.color;
  15.  
  16.         for (var i = 0; i < height; i++) {
  17.             list.addLine({
  18.                 x0: Math.random()*-width,
  19.                 // x0: 0,
  20.                 y0: [i,i*2],
  21.                 x1:Math.random()*width+width,
  22.                 // x1: width,
  23.                 y1: [i*2,i],
  24.                 strokeStyle: color.rgb(50,0,50+i),
  25.                 lineWidth: 2,
  26.                 phase: i*0.009
  27.             })
  28.         };
  29.         var gradient1 = color.createRadialGradient( -18, -22, 0, -36, -44, 85 );
  30.         gradient1.addColorStop( 0, '#f8f' );
  31.         gradient1.addColorStop( 0.6, '#33b' );
  32.         gradient1.addColorStop( 0.9, '#111' );
  33.         gradient1.addColorStop( 1, '#000' );
  34.         var gradient2 = color.createRadialGradient( -18, -22, 0, -36, -44, 85 );
  35.         gradient2.addColorStop( 0, '#525' );
  36.         gradient2.addColorStop( 0.6, '#338' );
  37.         gradient2.addColorStop( 0.9, '#111' );
  38.         gradient2.addColorStop( 1, '#000' );
  39.         list.addCircle({
  40.             x: function(t) {
  41.                return width/2 + Math.sin(t * Math.PI * 3.5) * 80;
  42.                 },
  43.            y: [height+30,0],
  44.            radius: [30,10],
  45.            // fillStyle: [color.rgba(0,0,255,1),color.rgba(0,0,255,0.1)]
  46.            fillStyle: [gradient1,gradient2]
  47.         })
  48. }
Advertisement
Add Comment
Please, Sign In to add comment