This commit is contained in:
Taric Xin
2022-03-24 14:22:39 +08:00
parent 9ae46c9957
commit e33c956306
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,27 @@
export default class Particle {
ParticleNetworkAnimation: any;
PNA: any;
constructor() {
this.ParticleNetworkAnimation = this.PNA = function () {};
}
init() {
this.PNA.prototype.init = function (element: any) {
this.$el = document.getElementsByClassName(element);
this.container = element;
this.canvas = document.createElement('canvas');
this.sizeCanvas();
this.container.appendChild(this.canvas);
this.ctx = this.canvas.getContext('2d');
// this.particleNetwork = new ParticleNetwork(this);
this.bindUiActions();
return this;
};
}
}

View File

@ -4,7 +4,8 @@
ParticleNetworkAnimation = PNA = function() {}; ParticleNetworkAnimation = PNA = function() {};
PNA.prototype.init = function(element) { PNA.prototype.init = function(element) {
this.$el = $(element); console.log(this);
this.$el = document.getElementsByClassName(element);
this.container = element; this.container = element;
this.canvas = document.createElement('canvas'); this.canvas = document.createElement('canvas');