Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- glc.size(540, 400);
- glc.setDuration(3);
- // glc.setFPS(20);
- glc.setMode("single");
- // glc.setEasing(false);
- // glc.setMaxColors(256);
- glc.styles.backgroundColor = "#1C99FF";
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- //credit to stackexchange
- function pointDirection(x1, y1, x2, y2) {
- return Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI;
- }
- list.addRect({
- x: width,
- y: height-50,
- w: 40,
- h: 104,
- fill: true
- })
- list.addOval({
- x: width-15,
- y: height-50,
- rx: 20,
- ry: 50,
- fill: true,
- fillStyle: color.rgb(85,38,0),
- stroke: true,
- strokeWeight: 10,
- strokeStyle: "brown"
- })
- for (var i = 0; i < 50; i++) {
- var y1 = Math.random()*height-50,
- w = Math.random()*150+30,
- h = Math.random()*40+130,
- b = Math.random()*200+55;
- list.addArrow({
- x: [-50,width+50],
- y: [y1,height-30],
- w: w,
- h: [h,5],
- rotation: pointDirection(-50,y1,width+50,height-50),
- fillStyle: color.rgb(0,0,b),
- phase: i*0.06
- })
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment