Skip to content

Instantly share code, notes, and snippets.

@dasDaniel
Created May 4, 2018 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasDaniel/4d8241dcc78acdd75ae2b78229c33af7 to your computer and use it in GitHub Desktop.
Save dasDaniel/4d8241dcc78acdd75ae2b78229c33af7 to your computer and use it in GitHub Desktop.
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(1.5);
glc.setFPS(30);
glc.setMode('single');
glc.setEasing(false);
glc.styles.backgroundColor = "#000000";
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
var num = 7;
var segments = 120;
for (var i = 0; i < num; i++) {
let n = i / num;
for (var j = 0; j < segments; j++) {
let s = j / segments;
list.addCircle({
x: t => {
let a = ((t / segments) + s) * 6.283
let w = width * 0.4
return Math.cos(a * 9) + Math.sin(a * 7) * w + width / 2
},
y: t => {
let a = ((t / segments) + s) * 6.283
let w = width * 0.4
return Math.cos(a * 7) * Math.sin(a * 9) * w + height / 2
},
radius: t => {
let a = ((t / segments) + s) * 6.283
return Math.sin(a * 1.5) * 2 + Math.cos(a * 3) * 2 + 1
},
stroke: false,
fill: true,
fillStyle: t => {
let a = ((t / segments) + s) * 6.283
return color.rgba(180 + Math.sin(a * 3) * 130, 60 - Math.cos(a * 6) * 55, 220, 0.9)
},
phase: n
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment