Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

#43

Use the library's realistic-look and fireworks examples for the celebration

merged · by keenan 13d ago · merged into main at 59464445 by keenan 13d ago

keenan opened this 13d ago

Follow-up to #01M5Z00VJ6215NFZ8F3KJ48FXA, whose fix is in main. That change made the burst draw at all; this one makes it look like a celebration.

120 particles at scalar: 1 from one point read as a small puff on a full-width page. The effect is now two of the library’s own published examples:

settings
opening burst — “realistic look” particleCount: 500, spread: 180, ticks: 400, gravity: 0.5, decay: 0.92, startVelocity: 30, scalar: 1.2
then — “fireworks” volley angle: 60 at x: 0 and angle: 120 at x: 1, spread: 55, count tapering 30 * (timeLeft / 1200) every 250 ms

scalar: 1.2 and the lower gravity are what fix “really small”.

One deliberate departure from the fireworks example: its volley runs for 15 seconds. This one runs for 1.2 s, because the page it lands on is a change request someone is about to read. Fifteen seconds of confetti over the discussion is hostile the second time you see it.

Measured

Real Firefox, real Merge click, 1360×682:

181 frames over 3000ms — median 17ms, p95 20ms, worst 23ms   (~60fps in software rendering)
canvases 6s later: 0                                         (the volley's timer ends with the burst)

So the extra particles cost nothing measurable, and nothing lingers after the effect finishes. disableForReducedMotion still applies to both bursts, the CSP is untouched, and the instance is still created with useWorker: false.

Branch note

This was briefly a second commit on the branch of #01M5Z0119HMHGDXTTWGRH5SKXC, which had already merged, so that request could not carry it. It now has its own branch from the merged head, and the diff against main is exactly the two files below.

Checks

gofmt, go vet ./..., go test ./..., vole workflow check, and vole workflow run verify (7 steps, -race) all pass.

Closes #01M5Z0JYRKH8EV3Y85VDCRMGNS

Discussion (0)

No discussion yet.