Skip to content

Commit

Permalink
examples: boid_flockers: Remove jQuery usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and tpike3 committed Jun 12, 2022
1 parent 5a2212f commit 99a71c0
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions examples/boid_flockers/boid_flockers/simple_continuous_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,14 @@ const Simple_Continuous_Module = function(canvas_width, canvas_height) {
// Create the element
// ------------------

// Create the tag:
const canvas_tag = `
<canvas
width='${canvas_width}'
height='${canvas_height}'
style='border:1px dotted'>
</canvas>
`;
;
const canvas = document.createElement("canvas");
Object.assign(canvas, {
width: canvas_width,
height: canvas_height,
style: 'border:1px dotted'
});
// Append it to body:
const canvas = $(canvas_tag)[0];
$("#elements").append(canvas);
document.getElementById("elements").appendChild(canvas);

// Create the context and the drawing controller:
const context = canvas.getContext("2d");
Expand All @@ -80,5 +76,4 @@ const Simple_Continuous_Module = function(canvas_width, canvas_height) {
this.reset = function() {
canvasDraw.resetCanvas();
};

};

0 comments on commit 99a71c0

Please sign in to comment.