Skip to main content

Using Templates

Using templates is the easiest way to get effects playing using the library. Calling them is simple, but some examples are shown here nevertheless.

Confetti#

A demonstration of the confetti template.

party.confetti(runButton, {    // Specify further (optional) configuration here.    count: party.variation.range(0, 100),    size: party.variation.range(0.6, 1.4),});
You can use the following objects in this codeblock: party, mouseEvent, codeblock, runButton.

Sparkles#

A demonstration of the sparkles template.

party.sparkles(runButton, {    // Specify further (optional) configuration here.    count: party.variation.range(10, 60),    speed: party.variation.range(50, 300),});
You can use the following objects in this codeblock: party, mouseEvent, codeblock, runButton.