Skip to content

Commit

Permalink
Some bugs creates :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul Hidalgo Caballero committed Feb 13, 2016
1 parent 642a2d8 commit 50a3ece
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Tests/Test1/test1.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

</head>
<body>
<canvas data-neuronal="enabled" data-number-points="5" data-number-lines="5" ></canvas>
<div data-neuronal="enabled" data-number-points="1000" data-number-lines="5" data-color="#58A4DF" style="width:500px;height:500px">
<h1>Heil Hitler</h1>
</div>
</body>
</html>
17 changes: 16 additions & 1 deletion src/NeuronalSpider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,30 @@ class NeuronalSpider {
}

public initialize(): void {
this.createCanvas();
this.initializeHeader();
this.initializePoints();
this.initAnimation();
this.addListeners();
}

public createCanvas():void {
this.canvas = document.createElement("canvas");
this.configuration.targetElement.parentElement.insertBefore(this.canvas, this.configuration.targetElement);

var clientRect: ClientRect = this.configuration.targetElement.getBoundingClientRect();

this.canvas.style.position = "absolute";
this.canvas.style.top = clientRect.top.toString()+"px";
this.canvas.style.left = clientRect.left.toString()+"px";
this.canvas.width = clientRect.width;
this.canvas.style.width = clientRect.width.toString()+"px";
this.canvas.height = clientRect.height;
this.canvas.style.height = clientRect.height.toString()+"px";
}

public initializeHeader(): void {
this.points = new Array<Point>();
this.canvas = <HTMLCanvasElement>this.configuration.targetElement;
this.canvas.width = this.width = window.innerWidth;
this.canvas.height = this.height = window.innerHeight;
this.targetMouse = new Point(
Expand Down

0 comments on commit 50a3ece

Please sign in to comment.