Click and drag to draw. Sweep slowly for a wide ribbon, quickly for a thin one. Strokes persist until you start a new one or clear the canvas.
Each frame two particles are emitted at the cursor and spliced into the centre of a flat array, one for each edge of the ribbon. The array forms a zipper: the first half traces the left edge forward from the stroke origin, the second half traces the right edge back toward it. A quadratic bezier runs through all positions in order and closes the shape, drawing the beam outline in one filled path.
Tapering at the tip comes from a spring-target multiplier. Particles near the centre have a multiplier near zero, so their spring target sits close to where they were born at the cursor. Particles near the array ends have a multiplier of one and spring fully out to their perpendicular offsets. The ramp spans six index positions either side of centre.
The glow is two canvas fill passes: a wide coloured shadow at reduced opacity for the outer bloom, and a tight white shadow for the bright core.