Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Behaviour
var crossZoneBehaviour = new Proton.CrossZone(new Proton.RectZone(0, 0, canvas.width, canvas.height), "cross");
emitter.addBehaviour(crossZoneBehaviour);
this.repulsion = new Proton.Repulsion({
x: canvas.width / 2,
y: canvas.height / 2 - 100
}, 3, 300);
this.attraction = new Proton.Attraction({
x: canvas.width / 2,
y: canvas.height / 2
}, 3, 200);
emitter.addBehaviour(this.attraction, this.repulsion);
emitter.addBehaviour(new Proton.Color("random"));
emitter.addBehaviour(new Proton.RandomDrift(20, 15, 0.15));
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}
}, {
var emitter = new Proton.Emitter();
emitter.damping = 0.008;
emitter.rate = new Proton.Rate(this.props.num ? this.props.num : 250);
emitter.addInitialize(new Proton.Mass(1));
emitter.addInitialize(new Proton.Radius(4));
emitter.addInitialize(new Proton.Velocity(new Proton.Span(1.5), new Proton.Span(0, 360), "polar"));
var mouseObj = {
x: width / 2,
y: height / 2
};
var attractionBehaviour = new Proton.Attraction(mouseObj, 0, 0);
var crossZoneBehaviour = new Proton.CrossZone(new Proton.RectZone(0, 0, canvas.width, canvas.height), "cross");
emitter.addBehaviour(new Proton.Color("random"));
emitter.addBehaviour(attractionBehaviour, crossZoneBehaviour);
emitter.addBehaviour(new Proton.RandomDrift(10, 10, 0.05));
emitter.p.x = canvas.width / 2;
emitter.p.y = canvas.height / 2;
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}
}, {
)
);
emitter.addInitialize(
new Proton.Position(
new Proton.RectZone(0, 0, canvas.width, canvas.height)
)
);
const crossZoneBehaviour = new Proton.CrossZone(
new Proton.RectZone(0, 0, canvas.width, canvas.height),
"cross"
);
emitter.addBehaviour(crossZoneBehaviour);
emitter.addBehaviour(new Proton.Alpha(Proton.getSpan(0.35, 0.55)));
emitter.addBehaviour(new Proton.Color(this.getColor()));
emitter.addBehaviour(new Proton.RandomDrift(50, 50, 0.5));
emitter.emit("once");
this.proton.addEmitter(emitter);
const renderer = new Proton.CanvasRenderer(canvas);
this.proton.addRenderer(renderer);
this.crossZoneBehaviour = crossZoneBehaviour;
}
this.proton = new Proton();
var emitter = new Proton.Emitter();
emitter.rate = new Proton.Rate(this.props.num || 20);
emitter.damping = 0.008;
emitter.addInitialize(new Proton.Mass(1));
emitter.addInitialize(new Proton.Radius(30, 600));
emitter.addInitialize(new Proton.Velocity(new Proton.Span(0.5), new Proton.Span(0, 360), "polar"));
emitter.addInitialize(new Proton.Position(new Proton.RectZone(0, 0, canvas.width, canvas.height)));
var crossZoneBehaviour = new Proton.CrossZone(new Proton.RectZone(0, 0, canvas.width, canvas.height), "cross");
emitter.addBehaviour(crossZoneBehaviour);
emitter.addBehaviour(new Proton.Alpha(Proton.getSpan(0.35, 0.55)));
emitter.addBehaviour(new Proton.Color(this.getColor()));
emitter.addBehaviour(new Proton.RandomDrift(50, 50, 0.5));
emitter.emit("once");
this.proton.addEmitter(emitter);
var renderer = new Proton.CanvasRenderer(canvas);
this.proton.addRenderer(renderer);
this.crossZoneBehaviour = crossZoneBehaviour;
}
}, {
},
3,
300
);
this.attraction = new Proton.Attraction(
{
x: canvas.width / 2,
y: canvas.height / 2
},
3,
200
);
emitter.addBehaviour(this.attraction, this.repulsion);
emitter.addBehaviour(new Proton.Color("random"));
emitter.addBehaviour(new Proton.RandomDrift(20, 15, 0.15));
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}
},
3,
300
);
this.attraction = new Proton.Attraction(
{
x: canvas.width / 2,
y: canvas.height / 2
},
3,
200
);
emitter.addBehaviour(this.attraction, this.repulsion);
emitter.addBehaviour(new Proton.Color("random"));
emitter.addBehaviour(new Proton.RandomDrift(20, 15, 0.15));
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}
);
const mouseInfo = {
x: width / 2,
y: height / 2
};
const attractionBehaviour = new Proton.Attraction(mouseInfo, 0, 0);
const crossZoneBehaviour = new Proton.CrossZone(
new Proton.RectZone(0, 0, canvas.width, canvas.height),
"bound"
);
emitter.addBehaviour(new Proton.Color(this.props.color || "#bbb"));
//emitter.addBehaviour(new Proton.Alpha(new Proton.Span(0.5, 1)));
emitter.addBehaviour(attractionBehaviour, crossZoneBehaviour);
emitter.addBehaviour(new Proton.RandomDrift(15, 15, 0.05));
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}
emitter.addInitialize(new Proton.Mass(1));
emitter.addInitialize(new Proton.Radius(5, 9));
emitter.addInitialize(new Proton.Velocity(new Proton.Span(1.5), new Proton.Span(0, 360), "polar"));
emitter.addInitialize(new Proton.Position(new Proton.RectZone(0, 0, width, height)));
var mouseInfo = {
x: width / 2,
y: height / 2
};
var attractionBehaviour = new Proton.Attraction(mouseInfo, 0, 0);
var crossZoneBehaviour = new Proton.CrossZone(new Proton.RectZone(0, 0, canvas.width, canvas.height), "bound");
emitter.addBehaviour(new Proton.Color(this.props.color || "#bbb"));
//emitter.addBehaviour(new Proton.Alpha(new Proton.Span(0.5, 1)));
emitter.addBehaviour(attractionBehaviour, crossZoneBehaviour);
emitter.addBehaviour(new Proton.RandomDrift(15, 15, 0.05));
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}
}, {
"polar"
)
);
const mouseObj = {
x: width / 2,
y: height / 2
};
const attractionBehaviour = new Proton.Attraction(mouseObj, 0, 0);
const crossZoneBehaviour = new Proton.CrossZone(
new Proton.RectZone(0, 0, canvas.width, canvas.height),
"cross"
);
emitter.addBehaviour(new Proton.Color("random"));
emitter.addBehaviour(attractionBehaviour, crossZoneBehaviour);
emitter.addBehaviour(new Proton.RandomDrift(10, 10, 0.05));
emitter.p.x = canvas.width / 2;
emitter.p.y = canvas.height / 2;
emitter.emit("once");
this.proton.addEmitter(emitter);
this.proton.addRenderer(this.createRenderer(canvas));
this.crossZoneBehaviour = crossZoneBehaviour;
}