=== AddonLogic Confetti on Click ===
Contributors: snehalpancholi
Tags: confetti, animation, button, celebration, shortcode
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Trigger a colourful confetti burst on any button or element click. Pure JavaScript canvas animation — no external libraries.

== Description ==

AddonLogic Confetti on Click adds festive confetti animations to your WordPress site using a lightweight pure-JavaScript canvas renderer — no external libraries, no CDN requests.

**Features:**

* `[confetti_button]` shortcode renders a styled celebration button
* CSS class trigger (`confetti-trigger`) works on any existing HTML element
* Per-button overrides: colors, particle count, spread, duration, shape
* Shapes: square, circle, star
* Respects prefers-reduced-motion accessibility preference
* Configurable global defaults via Settings page
* Scripts loaded on-demand (only where shortcode is used) unless "Load Globally" is enabled

== Installation ==

1. Upload the `confetti-on-click/` folder to `/wp-content/plugins/`.
2. Activate via **Plugins → Installed Plugins**.
3. Configure defaults at **Settings → Confetti on Click**.
4. Add `[confetti_button]` to any post or page.

== Shortcodes ==

`[confetti_button]`
A styled button with default confetti settings.

`[confetti_button label="You won! 🎉"]`
Custom button text.

`[confetti_button colors="#ff0000,#00ff00" count="120" spread="180"]`
Custom colors, particle count, and spread angle.

`[confetti_button url="/thank-you"]Claim your prize[/confetti_button]`
As a link — fires confetti and follows the URL.

`[confetti_button shape="star,circle"]`
Mix multiple particle shapes.

**CSS class trigger (no shortcode):**
Add the class `confetti-trigger` (or your custom class from settings) to any element and enable "Load Scripts Globally" in settings.

== Shortcode Attributes ==

| Attribute  | Default          | Description |
|------------|------------------|-------------|
| label      | 🎉 Click Me!     | Button text |
| colors     | (global setting) | Comma-separated hex colors |
| count      | (global setting) | Number of particles |
| spread     | (global setting) | Spread angle in degrees (1–360) |
| duration   | (global setting) | Animation duration in milliseconds |
| shape      | (global setting) | square, circle, star (comma-separated) |
| url        | (none)           | Optional link URL |
| origin     | button           | button = from element, center = page center |
| class      | (none)           | Extra CSS class |

== Frequently Asked Questions ==

= Does it use any external libraries? =
No. The confetti renderer is written from scratch using the HTML5 Canvas API.

= Does it work with page builders? =
Yes. Use the shortcode in any page builder shortcode widget.

= Is it accessible? =
Yes. The animation is suppressed when prefers-reduced-motion is set, and the canvas is marked aria-hidden.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
