Create Worker Instance.
Simulation and drawing move to a Web Worker (the canvas becomes an OffscreenCanvas), so confetti stays
smooth while the page is busy. Falls back to the main thread when OffscreenCanvas is unsupported.
Options must be worker-safe: no hooks, easing functions, Path2D, DOM images or defineShape /
definePhysics extensions (see WorkerFireOptions).
Parameters
Optionalcanvas: HTMLCanvasElement|null
Target Canvas (null or omitted creates a fullscreen overlay)
Create Worker Instance. Simulation and drawing move to a Web Worker (the canvas becomes an
OffscreenCanvas), so confetti stays smooth while the page is busy. Falls back to the main thread whenOffscreenCanvasis unsupported. Options must be worker-safe: no hooks, easing functions,Path2D, DOM images ordefineShape/definePhysicsextensions (seeWorkerFireOptions).