Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Agezao authored Nov 11, 2017
1 parent e7136ab commit 1e8dc77
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,30 @@ done!
## Options
| Attribute | Description | Example value | Default value |
|---------------------------|-------------|---------------|---------|
|---------------------------|-------------|--------------------|---------|
| *`target`* | The Id tag of the canvas that will be used | 'my-canvas' | 'confetti-holder' |
| *`max`* | The number of props(confetti) to be rendered | 11 | 80 |
| *`animate`* | If the confetti should fall | false | true |
| *`clock`* | The speed confetti fall | 50 | 25 |
| *`props`* | The type of props(confetti) that should be rendered. All the available are at the default. | ['circle', 'square'] | ['circle', 'square', 'triangle', 'line'] |
| *`colors`* | The color to be rendered on the confetti. By default, RGB format inside an array. | [[0,0,0], [255,255,255]] | [[165,104,246],[230,61,135],[0,199,228],[253,214,126]] |
## API
Using the object generated by `new ConfettiGenerator()` is pretty easy, there're just two main methods actually.
| Method | Description |
|---------------------------|-------------|
| *`render`* | Render the confetti at the config `<canvas/>` |
| *`clear`* | Clear the `<canvas/>` where the confetti where rendered |
```javascript
<script>
var confetti = new ConfettiGenerator();
confetti.render();
//
confetti.clear();
</script>
```
## License
to-do

0 comments on commit 1e8dc77

Please sign in to comment.