0.8.0 • Published 3 years ago

polyavatar v0.8.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

ci npm

What it is

Simple plygin to generate polygonal avatars with customization options.

How to install

Copy the file to your project

Quick Start

  1. Create a canvas element with the desired width:
<canvas class="polyavatar" width="256" height="256"></canvas>
  1. Instantiate the plugin poiting to the canvas element
var newInstance = new PolygonAvatar({
    selector: '.polyavatar'
})
  1. Enjoy the result

ludustack

Options

The plugin can be configured using the one of a combination of the following options:

ParameterDefaultMandatoryDescription
selector''xA CSS selector to the destination canvas to render.
sides6How many sides (more than 2, of course) the polygon should have.
image''Sets the image to be rendered inside the polygon.
percentage0.98The percentage of the progress bar around the image.
showProgresstrueIf the avatar should render the progressbar
animatedtrueIf the progress bar will be animated until it reaches the target percentage
onlineundefinedThe online status of the user. Omitting it will not generate the status indicator.
levelNumberundefinedThe level of the user. It will be shown as a smal polygon on the right with the level number in it.
progressBarColor'#4ff461'The color of the progress bar.
progressBgColor'#293249'The color of the background of the progress bar.
borderColor'#1d2333'The color of the border.
onlineColor'#40d04f'The color of the online indicator.
offlineColor'#888888'The color of the offline indicator.
levelBgColor'#7750f8'The color of the background of the level indicator.

Contributing

Please read this style guidelines documentation project and please follow the contribution guidelines and code of conduct.

License

This project is open-sourced and licensed under the MIT License.

0.8.0

3 years ago

0.7.0

3 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago