Dynamic pen movement

Does anyone know how the dynamic movement of this pen is achieved at this site? it changes angle and shape as you move across the screen…

Especially the start were it spins onto the curser