Commit b176a97
committed
animation: unify lightning and thunderstorm components
Replace the old Lightning bolt renderer with the Thunderstorm component,
which now supports both strike mode (single bolt for zaps) and full storm
mode (clouds, fog, multiple bolts for wallet send success).
- Add strike intensity that fires a single bolt without clouds/fog/flash
- Convert StormBolt to ES class with configurable presets (BOLT_STORM vs
BOLT_STRIKE) matching original visual behavior of each
- Delta-time all animation: bolt growth, fade, flash, cloud drift, and
strike chance are now frame-rate independent
- Use Path2D for bolt segments instead of replaying all draw calls
- Add ThunderstormProvider/useThunderstrike hook (replaces class-based
LightningProvider)
- useAnimationEnabled defaults to off when prefers-reduced-motion is
active; useAnimation respects the same default
- Reduced-motion users get immediate dismiss for all intensities
- Recursive isTreeDone check prevents grandchild bolts from vanishing
mid-fade
- Stabilize onDone via ref to prevent spurious re-fires
- Delete components/animation/lightning.js1 parent 87fe98d commit b176a97
5 files changed
Lines changed: 635 additions & 175 deletions
File tree
- components
- animation
- thunderstorm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 5 | + | |
12 | 6 | | |
13 | 7 | | |
14 | 8 | | |
15 | | - | |
| 9 | + | |
16 | 10 | | |
17 | 11 | | |
18 | 12 | | |
19 | | - | |
| 13 | + | |
20 | 14 | | |
21 | 15 | | |
22 | 16 | | |
23 | 17 | | |
24 | | - | |
| 18 | + | |
25 | 19 | | |
26 | 20 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 21 | + | |
| 22 | + | |
30 | 23 | | |
31 | | - | |
| 24 | + | |
32 | 25 | | |
33 | 26 | | |
34 | | - | |
35 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
36 | 33 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 34 | + | |
| 35 | + | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
| |||
This file was deleted.
0 commit comments