Advertisement
xeromino

candy

Nov 30th, 2015
237
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.5);
  6.     glc.setFPS(40);
  7.     glc.styles.backgroundColor = "#1E023F";
  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.  
  18.     // your code goes here:
  19.    
  20.     var palette = ["#18DD00", "#E1C829", "#2FB5F3", "#FC82C3"];
  21.     var num = 20, scal = 3;
  22.    
  23.     for (var i=0; i<num; i++) {
  24.         var //px = Math.random(1)*width,
  25.             px = width/num*i,
  26.             py = Math.random(1)*height,
  27.             lw = 4 + Math.random(1)*5,
  28.             rad = 5 + Math.random(1)*15,
  29.             p = Math.random(1),
  30.             s= Math.round(1 + Math.random(3));
  31.         list.addCircle({
  32.             x: px,
  33.             y: [py, py+height+rad*scal],
  34.             fill: false,
  35.             stroke: true,
  36.             lineWidth: lw,
  37.             radius: [rad, rad*scal],
  38.             globalAlpha: 0.85,
  39.             phase: p,
  40.             speedMult: s,
  41.             strokeStyle: palette[i%4]
  42.         });
  43.         for (var j=0; j<10; j++) {
  44.             list.addCircle({
  45.                 x: px,
  46.                 y: [py, py+height+rad*scal],
  47.                 fill: false,
  48.                 stroke: true,
  49.                 lineWidth: lw+2*j,
  50.                 globalAlpha:0.1,
  51.                 radius: [rad, rad*scal],
  52.                 phase: p,
  53.                 speedMult: s,
  54.                 strokeStyle: palette[i%4]
  55.             });
  56.         }
  57.        
  58.         list.addCircle({
  59.             x: px,
  60.             y: [py-height-rad*scal, py],
  61.             fill: false,
  62.             stroke: true,
  63.             lineWidth: lw,
  64.             radius: [rad*scal, rad],
  65.             globalAlpha: 0.8,
  66.             phase: p,
  67.             speedMult: s,
  68.             strokeStyle: palette[i%4]
  69.         });
  70.         for (var j=0; j<10; j++) {
  71.             list.addCircle({
  72.                 x: px,
  73.                 y: [py-height-rad*scal, py],
  74.                 fill: false,
  75.                 stroke: true,
  76.                 lineWidth: lw+2*j,
  77.                 globalAlpha:0.1,
  78.                 phase: p,
  79.                 speedMult: s,
  80.                 radius:[rad*scal, rad],
  81.                 strokeStyle: palette[i%4]
  82.             });
  83.         }
  84.        
  85.        
  86.        
  87.        
  88.        
  89.     }
  90.    
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement