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