Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- glc.size(350, 350);
- glc.setDuration(3);
- glc.setFPS(20);
- glc.setMode("single");
- glc.setEasing(false);
- glc.setMaxColors(24);
- glc.styles.backgroundColor = "black";
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- var numSquares = 90,
- diameter = 100,
- squareSize = 100;
- var container = list.addContainer({
- x: width / 2,
- y: height / 2,
- });
- for (var i = 0; i < numSquares; i++) {
- newX = Math.cos(2 * Math.PI * i / numSquares) * diameter;
- newY = Math.sin(2 * Math.PI * i / numSquares) * diameter;
- newX2 = Math.cos(2 * Math.PI * (i+numSquares/2) / numSquares) * diameter;
- newY2 = Math.sin(2 * Math.PI * (i+numSquares/2) / numSquares) * diameter;
- list.addRect({
- x: newX,
- y: newY,
- fill: false,
- stroke: true,
- strokeStyle: "white",
- w: squareSize,
- h: squareSize,
- rotation: [0,90],
- lineWidth: 1.5,
- parent: container,
- })
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment