Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnkunstman committed May 20, 2021
1 parent 2ee2062 commit 2ccebda
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 294 deletions.
15 changes: 7 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"use strict";
//import * as dat from 'dat.gui'
//import Chart from 'chart.js'
//
// classes
//
Expand All @@ -18,6 +16,12 @@ var World = /** @class */ (function () {
}
World.prototype.init = function () {
var body = document.getElementById("container");
var canvas = document.createElement('canvas');
canvas.id = "canvas";
canvas.width = this.width;
canvas.height = this.height;
canvas.style.border = "1px solid";
body.appendChild(canvas);
var canvasChart = document.createElement('canvas');
canvasChart.id = "chart";
canvasChart.width = 700;
Expand Down Expand Up @@ -83,12 +87,6 @@ var World = /** @class */ (function () {
}
}
});
var canvas = document.createElement('canvas');
canvas.id = "canvas";
canvas.width = this.width;
canvas.height = this.height;
canvas.style.border = "1px solid";
body.appendChild(canvas);
this.load();
};
World.prototype.load = function () {
Expand Down Expand Up @@ -327,3 +325,4 @@ slider4.onChange(function () { world.load(); });
slider5.onChange(function () { world.load(); });
slider6.onChange(function () { world.load(); });
slider7.onChange(function () { world.load(); });
console.log("ok");
17 changes: 10 additions & 7 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class World {
}
init() {
let body = document.getElementById("container")
let canvas = document.createElement('canvas')
canvas.id = "canvas"
canvas.width = this.width
canvas.height = this.height
canvas.style.border = "1px solid"
body.appendChild(canvas)
let canvasChart: any = document.createElement('canvas')
canvasChart.id = "chart"
canvasChart.width = 700
Expand Down Expand Up @@ -92,13 +98,7 @@ class World {
}]
}
}
})
let canvas = document.createElement('canvas')
canvas.id = "canvas"
canvas.width = this.width
canvas.height = this.height
canvas.style.border = "1px solid"
body.appendChild(canvas)
})
this.load()
}
load() {
Expand Down Expand Up @@ -357,3 +357,6 @@ slider4.onChange(function () { world.load() })
slider5.onChange(function () { world.load() })
slider6.onChange(function () { world.load() })
slider7.onChange(function () { world.load() })

console.log("ok");

232 changes: 0 additions & 232 deletions boid.ts

This file was deleted.

13 changes: 8 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ html,
body {
margin: 0;
}
canvas{
margin: 2vmin;
}
#container{
display: flex;
justify-content: center;
flex-wrap: wrap;
box-sizing: border-box;
box-sizing: border-box;
}
#canvas{
width: 100vmin;
height: 100vmin;
width: 96vmin;
height: 96vmin;
box-sizing: border-box;
}
#chart{
width: 100vmin;
height: 100vmin;
width: 96vmin;
height: 96vmin;
box-sizing: border-box;
}
.save-row{
Expand Down
42 changes: 0 additions & 42 deletions vector.ts

This file was deleted.

0 comments on commit 2ccebda

Please sign in to comment.