|
|
|
@ -22,15 +22,18 @@ class ParticleNetworkAnimation {
|
|
|
|
|
|
|
|
|
|
bindUiActions() {
|
|
|
|
|
window.addEventListener('resize', () => {
|
|
|
|
|
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
|
|
|
this.sizeCanvas();
|
|
|
|
|
this.particleNetwork.createParticles();
|
|
|
|
|
this.forceUpdate();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
sizeCanvas() {
|
|
|
|
|
this.canvas.width = this.container.offsetWidth;
|
|
|
|
|
this.canvas.height = this.container.offsetHeight;
|
|
|
|
|
}
|
|
|
|
|
forceUpdate() {
|
|
|
|
|
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
|
|
|
this.sizeCanvas();
|
|
|
|
|
this.particleNetwork.createParticles();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Particle{
|
|
|
|
|