eriknau

25Days-23

Dec 23rd, 2015
171
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(300, 300);
  4.      glc.setDuration(3);
  5. //     glc.setFPS(20);
  6.      glc.setMode('single');
  7.      glc.setEasing(false);
  8.     glc.setMaxColors(50);
  9.     glc.styles.backgroundColor = "black";
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color;
  14.  
  15.     for(var i = 0; i<180; i++) {
  16.         var rotator = list.addContainer({
  17.             x: width/2,
  18.             y: height/2,
  19.             rotation: [0,360],
  20.             phase: i*0.0028
  21.         })
  22.    
  23.         list.addLine({
  24.             parent: rotator,
  25.             x0: 0,
  26.             y0: function(t) {
  27.                return 50 + Math.sin(t * Math.PI*50) * 20;
  28.            },
  29.             x1: 0,
  30.             y1: function(t) {
  31.                return 100 + Math.sin(t * Math.PI*50) * 40;
  32.            },
  33.             strokeStyle: "blue",
  34.             lineWidth: 1
  35.         })
  36.     }
  37.     for(var i = 0; i<180; i++) {
  38.         var rotator = list.addContainer({
  39.             x: width/2,
  40.             y: height/2,
  41.             rotation: [-180,180],
  42.             phase: i*0.0028
  43.         })
  44.    
  45.         list.addLine({
  46.             parent: rotator,
  47.             x0: 0,
  48.             y0: function(t) {
  49.                return 50 + Math.sin(t * Math.PI*50) * 20;
  50.            },
  51.             x1: 0,
  52.             y1: function(t) {
  53.                return 100 + Math.sin(t * Math.PI*50) * 40;
  54.            },
  55.             strokeStyle: "red",
  56.             lineWidth: 1
  57.         })
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment