better particles courtesy of eve on the nekoweb dc
All checks were successful
/ test (push) Successful in 15s
All checks were successful
/ test (push) Successful in 15s
This commit is contained in:
parent
7beb050aca
commit
734412cc44
1 changed files with 3 additions and 2 deletions
|
@ -43,7 +43,8 @@ class Particle {
|
||||||
"%," +
|
"%," +
|
||||||
(85 + 10 * Math.random()) +
|
(85 + 10 * Math.random()) +
|
||||||
"%)";*/
|
"%)";*/
|
||||||
this.style = Math.random() < 0.5 ? "-" : Math.random() > 0.5 ? "+" : "*";
|
const characters = ["+", "⊹", ".", "-"]
|
||||||
|
this.style = characters[Math.floor(Math.random() * characters.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -54,7 +55,7 @@ class Particle {
|
||||||
|
|
||||||
renderSurfaceContext.save();
|
renderSurfaceContext.save();
|
||||||
renderSurfaceContext.fillStyle = this.color;
|
renderSurfaceContext.fillStyle = this.color;
|
||||||
renderSurfaceContext.font = Math.floor(this.id * 60) + "px Arial";
|
renderSurfaceContext.font = Math.floor(this.id * 80) + "px Arial";
|
||||||
renderSurfaceContext.translate(this.x, this.y);
|
renderSurfaceContext.translate(this.x, this.y);
|
||||||
renderSurfaceContext.rotate(2 * Math.PI * this.id);
|
renderSurfaceContext.rotate(2 * Math.PI * this.id);
|
||||||
renderSurfaceContext.fillText(this.style, -width2 / 2, 4);
|
renderSurfaceContext.fillText(this.style, -width2 / 2, 4);
|
||||||
|
|
Loading…
Reference in a new issue