fix: tune particle configs — smaller fire, fast circles for rain, better embers

- Fire: 1-5px (was 4-12, balloons), count 60-200, speed 4-10
- Rain: drop line shape (invisible in slim), use fast circles 200-600 at 15-30
  speed so motion reads as streaks
- Embers: 1.5-4px, count 20-80, speed 0.5-2 — clearly slower/dimmer than fire

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aaron Wood 2026-04-10 20:01:40 -04:00
parent ecbc696918
commit bcf118093b

View file

@ -1,13 +1,14 @@
import type { ISourceOptions } from "@tsparticles/engine"; import type { ISourceOptions } from "@tsparticles/engine";
/** /**
* Fire intensity 0100 count 80300, speed 28 * Fire intensity 0100 count 60200, speed 410
* Big bright particles rising upward. Emitters not used (not in slim bundle) * Small-to-medium orange/red/yellow particles rising upward fast.
* so particles respawn via outModes "out" (wrap from bottom when they exit top). * outModes "out" respawns particles at the bottom when they exit the top.
* Noticeably faster and brighter than embers.
*/ */
export function getFireConfig(intensity: number): ISourceOptions { export function getFireConfig(intensity: number): ISourceOptions {
const count = Math.round(80 + (intensity / 100) * 220); const count = Math.round(60 + (intensity / 100) * 140);
const speed = 2 + (intensity / 100) * 6; const speed = 4 + (intensity / 100) * 6;
return { return {
fullScreen: { enable: false }, fullScreen: { enable: false },
background: { opacity: 0 }, background: { opacity: 0 },
@ -16,13 +17,13 @@ export function getFireConfig(intensity: number): ISourceOptions {
color: { value: ["#ff2200", "#ff5500", "#ff8800", "#ffbb00", "#ffee00"] }, color: { value: ["#ff2200", "#ff5500", "#ff8800", "#ffbb00", "#ffee00"] },
shape: { type: "circle" }, shape: { type: "circle" },
opacity: { opacity: {
value: { min: 0.5, max: 1 }, value: { min: 0.6, max: 1 },
animation: { enable: true, speed: 2, sync: false, startValue: "random" }, animation: { enable: true, speed: 3, sync: false, startValue: "random" },
}, },
size: { value: { min: 4, max: 12 } }, size: { value: { min: 1, max: 5 } },
move: { move: {
enable: true, enable: true,
speed: { min: speed * 0.5, max: speed }, speed: { min: speed * 0.6, max: speed },
direction: "top", direction: "top",
random: true, random: true,
straight: false, straight: false,
@ -33,23 +34,22 @@ export function getFireConfig(intensity: number): ISourceOptions {
} }
/** /**
* Rain intensity 0100 count 100500, speed 1025 * Rain intensity 0100 count 200600, speed 1530
* Line-shaped particles (included in slim) falling straight down. * Fast-falling blue-white circles. At this speed the motion itself
* rotate: 10° gives a slight diagonal angle. * reads as rain streaks no elongated shape needed.
*/ */
export function getRainConfig(intensity: number): ISourceOptions { export function getRainConfig(intensity: number): ISourceOptions {
const count = Math.round(100 + (intensity / 100) * 400); const count = Math.round(200 + (intensity / 100) * 400);
const speed = 10 + (intensity / 100) * 15; const speed = 15 + (intensity / 100) * 15;
return { return {
fullScreen: { enable: false }, fullScreen: { enable: false },
background: { opacity: 0 }, background: { opacity: 0 },
particles: { particles: {
number: { value: count, density: { enable: false } }, number: { value: count, density: { enable: false } },
color: { value: "#aaccee" }, color: { value: "#aad4f5" },
shape: { type: "line" }, shape: { type: "circle" },
opacity: { value: { min: 0.4, max: 0.8 } }, opacity: { value: { min: 0.4, max: 0.75 } },
size: { value: { min: 10, max: 20 } }, size: { value: { min: 1, max: 2.5 } },
rotate: { value: 10, animation: { enable: false } },
move: { move: {
enable: true, enable: true,
speed: speed, speed: speed,
@ -62,13 +62,13 @@ export function getRainConfig(intensity: number): ISourceOptions {
} }
/** /**
* Embers intensity 0100 count 30120, speed 0.32 * Embers intensity 0100 count 2080, speed 0.52
* Small glowing dots drifting slowly upward with flickering opacity. * Slow-drifting warm amber dots with flickering opacity.
* Noticeably slower and dimmer than fire to contrast clearly. * Clearly slower and dimmer than fire different mood entirely.
*/ */
export function getEmbersConfig(intensity: number): ISourceOptions { export function getEmbersConfig(intensity: number): ISourceOptions {
const count = Math.round(30 + (intensity / 100) * 90); const count = Math.round(20 + (intensity / 100) * 60);
const speed = 0.3 + (intensity / 100) * 1.7; const speed = 0.5 + (intensity / 100) * 1.5;
return { return {
fullScreen: { enable: false }, fullScreen: { enable: false },
background: { opacity: 0 }, background: { opacity: 0 },
@ -77,10 +77,10 @@ export function getEmbersConfig(intensity: number): ISourceOptions {
color: { value: ["#ff8800", "#ffaa00", "#ffcc44", "#ff6600"] }, color: { value: ["#ff8800", "#ffaa00", "#ffcc44", "#ff6600"] },
shape: { type: "circle" }, shape: { type: "circle" },
opacity: { opacity: {
value: { min: 0.2, max: 1 }, value: { min: 0.15, max: 0.9 },
animation: { enable: true, speed: 0.7, sync: false, startValue: "random" }, animation: { enable: true, speed: 0.6, sync: false, startValue: "random" },
}, },
size: { value: { min: 2, max: 5 } }, size: { value: { min: 1.5, max: 4 } },
move: { move: {
enable: true, enable: true,
speed: speed, speed: speed,