Last active
March 6, 2017 01:47
-
-
Save mariorcardoso/15f7dcdcea47a880b9af9f677e0a139b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Rectangle } from './rectangle' | |
import { Square } from './square' | |
import { Circle } from './circle' | |
import { CanvasLibrary } from './canvas_library' | |
$(document).ready(function() { | |
const canvas = new CanvasLibrary(); | |
const layer = canvas.get_layer(); | |
const stage = canvas.get_stage(); | |
let rectangle, square, circle; | |
for(let n = 0; n < 15; n++) { | |
let size = Math.random()*120; | |
rectangle = new Rectangle(size, size*2, '#79CF8D'); | |
square = new Square(size, '#56A6ED'); | |
circle = new Circle(size/2, '#A93036'); | |
rectangle.draw(layer, stage) | |
square.draw(layer, stage) | |
circle.draw(layer, stage) | |
} | |
stage.draw(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment