Skip to content

Commit 551788f

Browse files
committed
fix(documentation): improved readme
1 parent 868c222 commit 551788f

14 files changed

Lines changed: 243 additions & 14 deletions

README.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,46 @@
1-
# polyavatar
2-
Generate polygonal avatars
1+
<p align="center">
2+
<img src="docs/polyavatarlogo.svg" />
3+
</p>
34

4-
## Install
5+
# What it is
6+
Simple plygin to generate polygonal avatars with customization options.
7+
8+
## How to install
59
Copy the file to your project
610

7-
## Instantiate
11+
## Quick Start
12+
1. Create a canvas element with the desired width:
13+
14+
``` html
15+
<canvas class="polyavatar" width="256" height="256"></canvas>
16+
```
17+
2. Instantiate the plugin poiting to the canvas element
818
``` javascript
9-
// Create a new instance of the plugin
1019
var newInstance = new PolygonAvatar({
11-
selector: '.polyavatarnoimage',
20+
selector: '.polyavatar'
1221
})
1322
```
23+
24+
3. Enjoy the result
25+
26+
![ludustack](docs/sample.png)
27+
28+
## Options
29+
30+
The plugin can be configured using the one of a combination of the following options:
31+
32+
| Parameter | Description | Default | Mandatory |
33+
|------------------|:---------------------------------------------------------------------------------------------------|:---------:|:---------:|
34+
| selector | A CSS selector to the destination canvas to render. | '' | x |
35+
| sides | How many sides (more than 2, of course) the polygon should have. | 6 | |
36+
| image | Sets the image to be rendered inside the polygon. | '' | |
37+
| percentage | The percentage of the progress bar around the image. | 0.98 | |
38+
| progressBarColor | The color of the progress bar. | '#4ff461' | |
39+
| showProgress | If the avatar should render the progressbar | true | |
40+
| animated | If the progress bar will be animated until it reaches the target percentage | true | |
41+
| online | The online status of the user. Omitting it will not generate the status indicator. | undefined | |
42+
| levelNumber | The level of the user. It will be shown as a smal polygon on the right with the level number in it. | undefined | |
43+
1444
## Contributing
1545
Please read this [style guidelines](https://github.com/joemottershaw/style-guidelines) documentation project and please follow the [contribution guidelines](./.github/CONTRIBUTING.md) and [code of conduct](./.github/CODE_OF_CONDUCT.md).
1646

docs/polyavatarlogo.svg

Lines changed: 199 additions & 0 deletions
Loading

docs/sample.png

54 KB
Loading

samples/avatar.jpg

-9.18 KB
Binary file not shown.

samples/avatar10.jpg

-11.2 KB
Binary file not shown.

samples/avatar2.jpg

-10.9 KB
Binary file not shown.

samples/avatar3.jpg

-10.3 KB
Binary file not shown.

samples/avatar4.jpg

-11.2 KB
Binary file not shown.

samples/avatar5.jpg

-15.4 KB
Binary file not shown.

samples/avatar6.jpg

-15.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)