Skip to content

Instantly share code, notes, and snippets.

@empireshades
Created December 8, 2015 15:47
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 empireshades/ae03fd1327efdba95912 to your computer and use it in GitHub Desktop.
Save empireshades/ae03fd1327efdba95912 to your computer and use it in GitHub Desktop.
function onGLC(glc) {
glc.loop();
// glc.playOnce();
// glc.size(400, 400);
glc.setDuration(2);
glc.setFPS(28);
// glc.setMode("single");
// glc.setEasing(false);
glc.setMaxColors(22);
var list = glc.renderList,
width = glc.w,
height = glc.h;
// your code goes here:
var phasex = 0;
var phasey = 0;
var size = 50;
for(var x = -size/2; x < width; x += size) {
for(var y = -size/2; y < height; y += (size/2)) {
var alpha = .25;
list.addLine({
translationX: x,
translationY: y,
x0: 0,
y0: [0,size/2],
x1: size,
y1: [0,size/2],
lineWidth: 1,
stroke: true,
strokeStyle: "#222222",
phase: phasex += .25,
shadowColor: "#101010",
shadowOffsetX: 3,
shadowOffsetY: 3,
shadowBlur: 3,
});
list.addPath({
translationX: x,
translationY: y,
path: [
[
size,
0,
size,
size/2,
size,
size,
],
[
size+(size/2),
size,
size+(size/2),
size/2,
size + Math.floor((Math.random() * (size/2)) + 1),
0,
],
],
lineWidth: 3,
stroke: true,
strokeStyle: ["#dd5555","#993333"],
phase: phasey += .3,
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment