From 734412cc4498655db9e1f6be73da334762931366 Mon Sep 17 00:00:00 2001 From: sophie Date: Wed, 18 Sep 2024 14:12:02 +0300 Subject: [PATCH] better particles courtesy of eve on the nekoweb dc --- website/scripts/particles.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/scripts/particles.ts b/website/scripts/particles.ts index efff82d..1d04fed 100644 --- a/website/scripts/particles.ts +++ b/website/scripts/particles.ts @@ -43,7 +43,8 @@ class Particle { "%," + (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() { @@ -54,7 +55,7 @@ class Particle { renderSurfaceContext.save(); 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.rotate(2 * Math.PI * this.id); renderSurfaceContext.fillText(this.style, -width2 / 2, 4);