Running Juggling Lab with a web link

## Basics

The PHP front end to Juggling Lab allows you to quickly animate patterns by embedding all the animation instructions within a URL.

Try clicking on the following examples to get the idea. You can alternatively type this text directly into the browser address bar to pull up the animation. (Note: To see the animation you need a browser with Java available and enabled.)

- http://jugglinglab.sourceforge.net/siteswap.php?5
- http://jugglinglab.sourceforge.net/siteswap.php?(4,2x)(2x,4)
- http://jugglinglab.sourceforge.net/siteswap.php?pattern=<3p|3p>;stereo=true
- http://jugglinglab.sourceforge.net/siteswap.php?pattern=(4x,4x);hands=(32,15)(10).(10)(32,15).;colors=mixed

The pattern information comes after the `'?'` in the URL. It can have two basic formats:

1. A siteswap pattern only, in the generalized siteswap notation used by Juggling Lab.
2. A series of variable assignments in the form `"var1=a;var2=b;var3=c"` and so on.

## Variables recognized by Juggling Lab

When the second form above is used, Juggling Lab recognizes the following variables. Only the `pattern` variable is required; the others are optional.

- `pattern` – siteswap pattern to animate, in generalized siteswap notation. No default.
- `bps` – number of beats per second, a floating point value. Default is automatically calculated from the pattern.
- `dwell` – number of beats a catch is made prior to the subsequent throw. Values are floating-point numbers between 0.0 and 2.0; default is 1.3.
- `hands` – hand movement as a sequence of spatial coordinates for catches and throws and points in-between. This should be provided in the format used in the siteswap input panel.
- `body` – body movement as a sequence of angles and spatial coordinates. This should be provided in the format used in the siteswap input panel.
- `colors` – determines the coloring of the props. Each color is defined either by name or by its red/green/blue components on a 0-255 scale. Thus if this setting is equal to `{red}` or `{255,0,0}`, the animator will use red balls. If you define several colors, they will be assigned to the balls in a cyclical manner. For example, `{255,0,0}{0,255,0}` means that ball 1 is red, ball 2 is green, ball 3 is red, ball 4 is green, and so on. Recognized color names are: `black, blue, cyan, gray, green, magenta, orange, pink, red, yellow`. Using the value `mixed` (no braces) will apply a pre-defined mix of colors. Default is red balls.
- `propdiam` – diameter of the props, in centimeters. Values are floating-point numbers greater than 0.0; default is 10.0.
- `prop` – prop type to use. Recognized prop names are `ball`, `image`, and `ring`; default is `ball`.
- `gravity` – acceleration of gravity, in cm/sec^2. Values are floating-point numbers; default is 980.0 (earth standard).
- `bouncefrac` – fraction of a ball's energy retained after bouncing off the ground (how much of its dropped height does it return to?). Values are floating point numbers greater than 0.0; default is 0.9.
- `stereo` – determines whether to display the pattern as a cross-eyed stereogram. Values are true/false; default value is false.
- `dbuffer` – determines if the display will be double-buffered to minimize flicker. Values are true/false; default value is true.
- `startpaused` – causes the animator to wait for a prompt from the user to begin animation. Values are true/false; default value is false.
- `fps` – sets the number of frames per second to be drawn by the animator. Values are floating point numbers greater than 0.0; default value is 30.0.
- `slowdown` – defines an overall time slowdown factor (e.g., slowdown=1.0 is actual speed, slowdown=2.0 is half actual speed). Values are floating point numbers greater than 0.0; default value is 2.0.
- `border` – defines a border (in pixels) around the animation. Values are integers greater than or equal to 0; default value is 0.

The following variables are also supported for backward compatibility, but their continuing use is discouraged. Most are documented elsewhere:

- `tps` – use `bps` instead.
- `dratio` – defined as half of `dwell`. In the typical case where a given hand throws on every other beat, this equals the fraction of time the hand is filled with a ball. Values are floating-point numbers between 0.0 and 1.0; default is 0.65.
- `throwx` – use `hands` instead .
- `rightthrowx` – use `hands` instead.
- `leftthrowx` – use `hands` instead.
- `catchx` – use `hands` instead.
- `rightcatchx` – use `hands` instead.
- `leftcatchx` – use `hands` instead.
- `balldiam` – use `propdiam` instead.
- `g` – use `gravity` instead.
- `mat_style` – use `hands` instead.
- `mat_HR` – use `tps` instead.
- `mat_DR` – use `dratio` instead.