konfeti - v0.6.0
    Preparing search index...

    Type Alias WorkerCreateOptions

    WorkerCreateOptions: Omit<CreateOptions, "defaults" | "frameScheduler"> & {
        defaults?: WorkerFireOptions;
        workerUrl?: string | URL;
    }

    Options for a Worker Instance.

    Type Declaration

    • Optional Readonlydefaults?: WorkerFireOptions

      Instance Default Burst Options (worker-safe).

      {}

    • Optional ReadonlyworkerUrl?: string | URL

      Worker Script URL. With a bundler the worker is created from an inlined script (a blob: URL), downloaded only when the first worker instance is created. The <script> build (konfeti.iife.js) loads konfeti.worker.js from its own folder instead. Set this to a self-hosted copy of konfeti/konfeti.worker.js when your Content-Security-Policy does not allow worker-src blob:, or when the script build is served without the worker file next to it.

      inlined worker (bundlers) / konfeti.worker.js next to the script (<script> build)

      createWorker(canvas, { workerUrl: "/vendor/konfeti.worker.js" });
      
    const stage = createWorker(canvas, {
    maxParticles: 3000,
    defaults: { paper: { colors: ["gold", "white"] } },
    });