Skip to content

Commit

Permalink
mirroring improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanrhu committed Jan 17, 2019
1 parent 3299b4c commit 635f574
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<div class="mainBox">
<div style="font-size: 25px; margin-bottom: 5px; margin-top: 10px; position: relative; display: inline-block; margin-bottom: 10px;">
nodes.js
<div style="font-size: 13px; position: absolute; right: -30px; top: 0px; display: inline-block; color: #9f9f9f;">v1.0</div>
<div style="font-size: 13px; position: absolute; right: -30px; top: 0px; display: inline-block; color: #9f9f9f;">v1.1</div>
</div>
<div style="font-size: 13px; margin-bottom: 5px;">
HTML5 Canvas nodes/particles animation with Javascript
Expand Down
8 changes: 4 additions & 4 deletions js/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ var NodesJs = (function (parameters) {
_node[1] += Math.sin(_node[2]) * t_NodesJs.speed * (dt/1000.0);

if (_node[0] < 0) {
_node[0] = cw;
_node[0] = cw + (_node[0] % cw);
}

if (_node[0] > cw) {
_node[0] = 0;
_node[0] = _node[0] % cw;
}

if (_node[1] < 0) {
_node[1] = ch;
_node[1] = ch + (_node[1] % ch);
}

if (_node[1] > ch) {
_node[1] = 0;
_node[1] = _node[1] % ch;
}

ctx.fillStyle = 'rgba(255,255,255,0.3)';
Expand Down

0 comments on commit 635f574

Please sign in to comment.