Animated Thermometer
Animated Thermometer Shortcode
This shortcode is primarily used on the Homecoming website for the class year pages. Its purpose it to encourage those of a specific class year to help their class reach their donation goal.
If this plugin isn’t already enabled on your website, put in a plugin request using ourĀ Web Request Form.
Shortcode: Animated Thermometer
This shortcode builds an animated thermometer that fills an image with color based on how close the current amount is to the goal. Six attributes are required. If any of them is missing, the shortcode prints an error message instead of the thermometer.
Required Attributes
| Attribute | Description |
|---|---|
id | A unique identifier for this thermometer. Use a different value for each thermometer on a page. |
image | The URL of the image the color fills in behind. |
goal_amount | The target amount, as a whole number. |
current_amount | The amount reached so far, as a whole number. |
height | Height of the thermometer in pixels. |
width | Width of the thermometer in pixels. |
Optional Attributes
| Attribute | Default | Description |
|---|---|---|
direction | up | Direction the fill animates. Must be up, down, left, or right. Any other value prints an error message. |
speed | 2000 | Length of the animation in milliseconds. |
repeat | false | Repeat the background image rather than showing it once. |
starting_bgcolor | CCC | Color the thermometer starts at, as a hex value with no leading #. |
target_bgcolor | 090 | Color the thermometer animates to, as a hex value with no leading #. |
use_scale | true | Show a scale alongside the thermometer. |
scale_divisions | 10 | Number of divisions on the scale. |
scale_in_dollars | false | Format the scale values as dollar amounts. |
scale_text_color | 090 | Color of the scale text, as a hex value with no leading #. |
show_goal | false | Display the goal amount. |
convert_amount | false | Shorten amounts over 9,999 to thousands, so 25,000 displays as 25K. |
image_text | empty | Text shown on the image. |
image_overlay_text | empty | Additional text shown over the image. |
over_image | empty | An alternate image used once the goal has been passed. |
over_height | 0 | Height of the over-goal image in pixels. |
over_width | 0 | Width of the over-goal image in pixels. |
over_bgcolor | 009 | Fill color once the goal has been passed, as a hex value with no leading #. |
show_calculation | false | Intended to display the calculation. This attribute currently has no effect. |
Shortcode
[ wfu_animated_thermometer id=”test” image=”https://prod.wp.cdn.aws.wfu.edu/sites/171/2013/06/donor-2009.png” height=180 width=350 goal_amount=200 current_amount=150 ]
